[PATCH net-next v6 2/6] virtio_net: Remove command data from control_buf

2024-05-03 Thread Daniel Jurgens
Allocate memory for the data when it's used. Ideally the struct could be on the stack, but we can't DMA stack memory. With this change only the header and status memory are shared between commands, which will allow using a tighter lock than RTNL. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pi

[PATCH net-next v6 1/6] virtio_net: Store RSS setting in virtnet_info

2024-05-03 Thread Daniel Jurgens
Stop storing RSS setting in the control buffer. This is prep work for removing RTNL lock protection of the control buffer. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pirko --- drivers/net/virtio_net.c | 40 1 file changed, 20 insertions(+), 20 delet

[PATCH net-next v6 0/6] Remove RTNL lock protection of CVQ

2024-05-03 Thread Daniel Jurgens
Currently the buffer used for control VQ commands is protected by the RTNL lock. Previously this wasn't a major concern because the control VQ was only used during device setup and user interaction. With the recent addition of dynamic interrupt moderation the control VQ may be used frequently durin

[PATCH net-next v6 3/6] virtio_net: Add a lock for the command VQ.

2024-05-03 Thread Daniel Jurgens
The command VQ will no longer be protected by the RTNL lock. Use a mutex to protect the control buffer header and the VQ. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pirko --- drivers/net/virtio_net.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/ne

[PATCH net-next v6 4/6] virtio_net: Do DIM update for specified queue only

2024-05-03 Thread Daniel Jurgens
Since we no longer have to hold the RTNL lock here just do updates for the specified queue. Signed-off-by: Daniel Jurgens --- drivers/net/virtio_net.c | 40 +++- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers

[PATCH net-next v6 5/6] virtio_net: Add a lock for per queue RX coalesce

2024-05-03 Thread Daniel Jurgens
Once the RTNL locking around the control buffer is removed there can be contention on the per queue RX interrupt coalescing data. Use a mutex per queue. A mutex is required because virtnet_send_command can sleep. Signed-off-by: Daniel Jurgens --- drivers/net/virtio_net.c | 53 +++

[PATCH net-next v6 6/6] virtio_net: Remove rtnl lock protection of command buffers

2024-05-03 Thread Daniel Jurgens
The rtnl lock is no longer needed to protect the control buffer and command VQ. Signed-off-by: Daniel Jurgens Reviewed-by: Jiri Pirko --- drivers/net/virtio_net.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net