Message ID | 20201008183436.3093286-1-jonathan.lemon@gmail.com |
---|---|
State | New |
Headers | show |
Series | [net-next] virtio_net: handle non-napi callers to virtnet_poll_tx | expand |
On Thu, 8 Oct 2020 11:34:36 -0700 Jonathan Lemon wrote: > From: Jonathan Lemon <bsd@fb.com> > > netcons will call napi_poll with a budget of 0, indicating > a non-napi caller (and also called with irqs disabled). Call > free_old_xmit_skbs() with the is_napi parameter set correctly. This is a fix, can we get a Fixes tag, please?
On Thu, Oct 08, 2020 at 12:01:02PM -0700, Jakub Kicinski wrote: > On Thu, 8 Oct 2020 11:34:36 -0700 Jonathan Lemon wrote: > > From: Jonathan Lemon <bsd@fb.com> > > > > netcons will call napi_poll with a budget of 0, indicating > > a non-napi caller (and also called with irqs disabled). Call > > free_old_xmit_skbs() with the is_napi parameter set correctly. > > This is a fix, can we get a Fixes tag, please? As best as I can tell: Fixes: df133f3f9625 ("virtio_net: bulk free tx skbs")
On Thu, 8 Oct 2020 11:34:36 -0700 Jonathan Lemon wrote: > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 21b71148c532..59f65ac9e4c7 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1518,7 +1518,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget) > > txq = netdev_get_tx_queue(vi->dev, index); > __netif_tx_lock(txq, raw_smp_processor_id()); > - free_old_xmit_skbs(sq, true); > + free_old_xmit_skbs(sq, budget != 0); > __netif_tx_unlock(txq); > > virtqueue_napi_complete(napi, sq->vq, 0); Looks like virtnet_poll_cleantx() needs the same treatment.
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 21b71148c532..59f65ac9e4c7 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1518,7 +1518,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget) txq = netdev_get_tx_queue(vi->dev, index); __netif_tx_lock(txq, raw_smp_processor_id()); - free_old_xmit_skbs(sq, true); + free_old_xmit_skbs(sq, budget != 0); __netif_tx_unlock(txq); virtqueue_napi_complete(napi, sq->vq, 0);