mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
virtio-net: returns whether napi is complete
rx netdim needs to count the traffic during a complete napi process, and start updating and comparing samples to make decisions after the napi ends. Let virtqueue_napi_complete() return true if napi is done, otherwise vice versa. Signed-off-by: Heng Qi <hengqi@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d2e9464e63
commit
7949c06ad9
@ -431,7 +431,7 @@ static void virtqueue_napi_schedule(struct napi_struct *napi,
|
||||
}
|
||||
}
|
||||
|
||||
static void virtqueue_napi_complete(struct napi_struct *napi,
|
||||
static bool virtqueue_napi_complete(struct napi_struct *napi,
|
||||
struct virtqueue *vq, int processed)
|
||||
{
|
||||
int opaque;
|
||||
@ -440,9 +440,13 @@ static void virtqueue_napi_complete(struct napi_struct *napi,
|
||||
if (napi_complete_done(napi, processed)) {
|
||||
if (unlikely(virtqueue_poll(vq, opaque)))
|
||||
virtqueue_napi_schedule(napi, vq);
|
||||
else
|
||||
return true;
|
||||
} else {
|
||||
virtqueue_disable_cb(vq);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static void skb_xmit_done(struct virtqueue *vq)
|
||||
|
Loading…
Reference in New Issue
Block a user