[PATCH net-next] virtio-net: Reduce debug name field size to 16 bytes

2023-01-22 Thread Parav Pandit via Virtualization
virtio queue index can be maximum of 65535. 16 bytes are enough to store the vq name with the existing string prefix. With this change, send queue struct saves 24 bytes and receive queue saves whole cache line worth 64 bytes per structure due to saving in alignment bytes. Pahole results before:

Re: [PATCH 0/4] virtio_net: vdpa: update MAC address when it is generated by virtio-net

2023-01-22 Thread Michael S. Tsirkin
On Sun, Jan 22, 2023 at 11:05:22AM +0100, Laurent Vivier wrote: > When the MAC address is not provided by the vdpa device virtio_net > driver assigns a random one without notifying the device. > The consequence, in the case of mlx5_vdpa, is the internal routing > tables of the device are not

[PATCH 4/4] virtio_net: fix virtnet_send_command() with vdpa_sim_net

2023-01-22 Thread Laurent Vivier
virtnet_send_command() sends a command to the control virtqueue by adding the command to the virtqueue, kicking the queue and waiting in a loop. The vdpa simulator simulates the control virqueue using a work queue: the virqueue_kick() calls schedule_work() to start the queue processing. But as

[PATCH 0/4] virtio_net: vdpa: update MAC address when it is generated by virtio-net

2023-01-22 Thread Laurent Vivier
When the MAC address is not provided by the vdpa device virtio_net driver assigns a random one without notifying the device. The consequence, in the case of mlx5_vdpa, is the internal routing tables of the device are not updated and this can block the communication between two namespaces. To fix

[PATCH 1/4] virtio_net: notify MAC address change on device initialization

2023-01-22 Thread Laurent Vivier
In virtnet_probe(), if the device doesn't provide a MAC address the driver assigns a random one. As we modify the MAC address we need to notify the device to allow it to update all the related information. The problem can be seen with vDPA and mlx5_vdpa driver as it doesn't assign a MAC address

[PATCH 2/4] virtio_net: add a timeout in virtnet_send_command()

2023-01-22 Thread Laurent Vivier
if the device control queue is buggy, don't crash the kernel by waiting for ever the response. Signed-off-by: Laurent Vivier --- drivers/net/virtio_net.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index

[PATCH 3/4] vdpa_sim_net: don't always set VIRTIO_NET_F_MAC

2023-01-22 Thread Laurent Vivier
if vdpa dev command doesn't set a MAC address, don't report VIRTIO_NET_F_MAC. As vdpa_sim_net sets VIRTIO_NET_F_MAC without setting the MAC address, virtio-net doesn't set a random one and the address appears to be the zero MAC address. Signed-off-by: Laurent Vivier ---

Re: [PATCH 0/2] vhost: improve livepatch switching for heavily loaded vhost worker kthreads

2023-01-22 Thread Michael S. Tsirkin
On Fri, Jan 20, 2023 at 04:12:20PM -0600, Seth Forshee (DigitalOcean) wrote: > We've fairly regularaly seen liveptches which cannot transition within > kpatch's > timeout period due to busy vhost worker kthreads. In looking for a solution > the > only answer I found was to call