Commit 7949c06a authored by Heng Qi's avatar Heng Qi Committed by David S. Miller

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: default avatarHeng Qi <hengqi@linux.alibaba.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2e9464e
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment