virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 net-next 0/2] virtio-net: don't busy poll for cvq command
@ 2023-05-24  8:18 Jason Wang
  2023-05-24  8:18 ` [PATCH V3 net-next 1/2] virtio-net: convert rx mode setting to use workqueue Jason Wang
  2023-05-24  8:18 ` [PATCH V3 net-next 2/2] virtio-net: add cond_resched() to the command waiting loop Jason Wang
  0 siblings, 2 replies; 12+ messages in thread
From: Jason Wang @ 2023-05-24  8:18 UTC (permalink / raw)
  To: mst, jasowang, xuanzhuo, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, virtualization

Hi all:

The code used to busy poll for cvq command which turns out to have
several side effects:

1) infinite poll for buggy devices
2) bad interaction with scheduler

So this series tries to use cond_resched() in the waiting loop. Before
doing this we need first make sure the cvq command is not executed in
atomic environment, so we need first convert rx mode handling to a
workqueue.

Please review.

Thanks

Changes since V2:

- Don't use interrupt but cond_resched()

Changes since V1:

- use RTNL to synchronize rx mode worker
- use completion for simplicity
- don't try to harden CVQ command

Changes since RFC:

- switch to use BAD_RING in virtio_break_device()
- check virtqueue_is_broken() after being woken up
- use more_used() instead of virtqueue_get_buf() to allow caller to
  get buffers afterwards
  - break the virtio-net device when timeout
  - get buffer manually since the virtio core check more_used() instead

Jason Wang (2):
  virtio-net: convert rx mode setting to use workqueue
  virtio-net: add cond_resched() to the command waiting loop

 drivers/net/virtio_net.c | 59 +++++++++++++++++++++++++++++++++++++---
 1 file changed, 55 insertions(+), 4 deletions(-)

-- 
2.25.1

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

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

end of thread, other threads:[~2023-06-29  3:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24  8:18 [PATCH V3 net-next 0/2] virtio-net: don't busy poll for cvq command Jason Wang
2023-05-24  8:18 ` [PATCH V3 net-next 1/2] virtio-net: convert rx mode setting to use workqueue Jason Wang
2023-05-24  9:15   ` Michael S. Tsirkin
2023-05-25  3:43     ` Jason Wang
2023-05-25  7:41       ` Michael S. Tsirkin
2023-05-26  1:31         ` Jason Wang
2023-05-28 11:39           ` Michael S. Tsirkin
2023-05-29  1:21             ` Jason Wang
2023-05-31  1:07               ` Jason Wang
2023-06-28 13:33                 ` Michael S. Tsirkin
2023-06-29  3:20                   ` Jason Wang
2023-05-24  8:18 ` [PATCH V3 net-next 2/2] virtio-net: add cond_resched() to the command waiting loop Jason Wang

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).