From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>, Jason Wang <jasowang@redhat.com>
Subject: Re: [PATCH net-next] virtio_net: remove custom busy_poll
Date: Thu, 2 Feb 2017 18:17:39 +0200 [thread overview]
Message-ID: <20170202181707-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1486046136.13103.42.camel@edumazet-glaptop3.roam.corp.google.com>
On Thu, Feb 02, 2017 at 06:35:36AM -0800, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> Generic NAPI busy polling allows us to remove custom implementations
> found in drivers.
>
> It is possible further optimization could be done by testing
> napi_complete_done() return value.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> drivers/net/virtio_net.c | 41 -------------------------------------
> 1 file changed, 41 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index bd22cf306a9267cecf8c7ce03dccff8ebd16089e..0382827829d90b1d25d059609bae6d1c5ad2b6d9 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -29,7 +29,6 @@
> #include <linux/slab.h>
> #include <linux/cpu.h>
> #include <linux/average.h>
> -#include <net/busy_poll.h>
>
> static int napi_weight = NAPI_POLL_WEIGHT;
> module_param(napi_weight, int, 0444);
> @@ -1024,43 +1023,6 @@ static int virtnet_poll(struct napi_struct *napi, int budget)
> return received;
> }
>
> -#ifdef CONFIG_NET_RX_BUSY_POLL
> -/* must be called with local_bh_disable()d */
> -static int virtnet_busy_poll(struct napi_struct *napi)
> -{
> - struct receive_queue *rq =
> - container_of(napi, struct receive_queue, napi);
> - struct virtnet_info *vi = rq->vq->vdev->priv;
> - int r, received = 0, budget = 4;
> -
> - if (!(vi->status & VIRTIO_NET_S_LINK_UP))
> - return LL_FLUSH_FAILED;
> -
> - if (!napi_schedule_prep(napi))
> - return LL_FLUSH_BUSY;
> -
> - virtqueue_disable_cb(rq->vq);
> -
> -again:
> - received += virtnet_receive(rq, budget);
> -
> - r = virtqueue_enable_cb_prepare(rq->vq);
> - clear_bit(NAPI_STATE_SCHED, &napi->state);
> - if (unlikely(virtqueue_poll(rq->vq, r)) &&
> - napi_schedule_prep(napi)) {
> - virtqueue_disable_cb(rq->vq);
> - if (received < budget) {
> - budget -= received;
> - goto again;
> - } else {
> - __napi_schedule(napi);
> - }
> - }
> -
> - return received;
> -}
> -#endif /* CONFIG_NET_RX_BUSY_POLL */
> -
> static int virtnet_open(struct net_device *dev)
> {
> struct virtnet_info *vi = netdev_priv(dev);
> @@ -1817,9 +1779,6 @@ static const struct net_device_ops virtnet_netdev = {
> #ifdef CONFIG_NET_POLL_CONTROLLER
> .ndo_poll_controller = virtnet_netpoll,
> #endif
> -#ifdef CONFIG_NET_RX_BUSY_POLL
> - .ndo_busy_poll = virtnet_busy_poll,
> -#endif
> .ndo_xdp = virtnet_xdp,
> };
>
>
next prev parent reply other threads:[~2017-02-02 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 14:35 [PATCH net-next] virtio_net: remove custom busy_poll Eric Dumazet
2017-02-02 16:17 ` Michael S. Tsirkin [this message]
2017-02-03 16:14 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170202181707-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jasowang@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).