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)
commit94249369e9930276e30087da205349a55478cbb5
treeb5040c7bb90bbd772f0692c7f6a367d5ce758f37
parentcfbdab951369f15de890597530076bf0119361be
vhost-net: Unify the code of mergeable and big buffer handling

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