]> git.baikalelectronics.ru Git - kernel.git/commit
virtio-net: drop rq->max and rq->num
authorJason Wang <jasowang@redhat.com>
Thu, 16 Jan 2014 06:45:24 +0000 (14:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Jan 2014 01:30:42 +0000 (17:30 -0800)
commit2c24b81ea279538e42666afc485cc9534bfd9286
treeac9a515a86987e519a8dc26ae33e06c4ee6bf525
parentc040c83d90854eef448602278af0a2e1b45268ff
virtio-net: drop rq->max and rq->num

It looks like there's no need for those two fields:

- Unless there's a failure for the first refill try, rq->max should be always
  equal to the vring size.
- rq->num is only used to determine the condition that we need to do the refill,
  we could check vq->num_free instead.
- rq->num was required to be increased or decreased explicitly after each
  get/put which results a bad API.

So this patch removes them both to make the code simpler.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/virtio_net.c