All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] virtio_net: support rx/tx queue reset
@ 2022-03-10 15:12 Dan Carpenter
  2022-03-10 15:20 ` Xuan Zhuo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2022-03-10 15:12 UTC (permalink / raw)
  To: xuanzhuo; +Cc: virtualization

Hello Xuan Zhuo,

The patch 26ae35c46f93: "virtio_net: support rx/tx queue reset" from
Mar 8, 2022, leads to the following Smatch static checker warning:

	drivers/net/virtio_net.c:1410 virtnet_napi_tx_disable()
	warn: sleeping in atomic context

drivers/net/virtio_net.c
  1829        static int virtnet_tx_vq_reset(struct virtnet_info *vi,
  1830                                       struct send_queue *sq, u32 ring_num)
  1831        {
  1832                struct netdev_queue *txq;
  1833                int err, qindex;
  1834
  1835                qindex = sq - vi->sq;
  1836
  1837                txq = netdev_get_tx_queue(vi->dev, qindex);
  1838                __netif_tx_lock_bh(txq);
                      ^^^^^^^^^^^^^^^^^^^^^^^
Disables preempt

  1839
  1840                /* stop tx queue and napi */
  1841                netif_stop_subqueue(vi->dev, qindex);
  1842                virtnet_napi_tx_disable(&sq->napi);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
napi_disable() is a might_sleep() function.

  1843
  1844                __netif_tx_unlock_bh(txq);
  1845
  1846                /* reset the queue */
  1847                err = virtio_reset_vq(sq->vq);
  1848                if (err) {
  1849                        netif_start_subqueue(vi->dev, qindex);
  1850                        goto err;
  1851                }

regards,
dan carpenter
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] virtio_net: support rx/tx queue reset
  2022-03-10 15:12 [bug report] virtio_net: support rx/tx queue reset Dan Carpenter
@ 2022-03-10 15:20 ` Xuan Zhuo
  0 siblings, 0 replies; 2+ messages in thread
From: Xuan Zhuo @ 2022-03-10 15:20 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: virtualization



On Thu, 10 Mar 2022 18:12:21 +0300, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Hello Xuan Zhuo,
>
> The patch 26ae35c46f93: "virtio_net: support rx/tx queue reset" from
> Mar 8, 2022, leads to the following Smatch static checker warning:

Yes, thanks to you, I also found this problem today.

>
> 	drivers/net/virtio_net.c:1410 virtnet_napi_tx_disable()
> 	warn: sleeping in atomic context
>
> drivers/net/virtio_net.c
>   1829        static int virtnet_tx_vq_reset(struct virtnet_info *vi,
>   1830                                       struct send_queue *sq, u32 ring_num)
>   1831        {
>   1832                struct netdev_queue *txq;
>   1833                int err, qindex;
>   1834
>   1835                qindex = sq - vi->sq;
>   1836
>   1837                txq = netdev_get_tx_queue(vi->dev, qindex);
>   1838                __netif_tx_lock_bh(txq);
>                       ^^^^^^^^^^^^^^^^^^^^^^^
> Disables preempt
>
>   1839
>   1840                /* stop tx queue and napi */
>   1841                netif_stop_subqueue(vi->dev, qindex);
>   1842                virtnet_napi_tx_disable(&sq->napi);
>                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> napi_disable() is a might_sleep() function.
>
>   1843
>   1844                __netif_tx_unlock_bh(txq);
>   1845
>   1846                /* reset the queue */
>   1847                err = virtio_reset_vq(sq->vq);
>   1848                if (err) {
>   1849                        netif_start_subqueue(vi->dev, qindex);
>   1850                        goto err;
>   1851                }
>
> regards,
> dan carpenter
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-10 15:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-10 15:12 [bug report] virtio_net: support rx/tx queue reset Dan Carpenter
2022-03-10 15:20 ` Xuan Zhuo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.