vhost-net: Unify the code of mergeable and big buffer handling
authorJason Wang <jasowang@redhat.com>
Mon, 17 Jan 2011 08:11:08 +0000 (16:11 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 13 Mar 2011 15:00:10 +0000 (17:00 +0200)
Codes duplication were found between the handling of mergeable and big
buffers, so this patch tries to unify them. This could be easily done
by adding a quota to the get_rx_bufs() which is used to limit the
number of buffers it returns (for mergeable buffer, the quota is
simply UIO_MAXIOV, for big buffers, the quota is just 1), and then the
previous handle_rx_mergeable() could be resued also for big buffers.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/net.c

Simple merge