Re: [PATCH 0/5] virtio_net: enable premapped mode by default

2024-10-13 Thread Michael S. Tsirkin
On Mon, Oct 14, 2024 at 11:12:29AM +0800, Xuan Zhuo wrote: > In the last linux version, we disabled this feature to fix the > regress[1]. > > The patch set is try to fix the problem and re-enable it. > > More info: > http://lore.kernel.org/all/20240820071913.68004-1-xuanz...@linux.alibaba.com >

[PATCH 5/5] virtio_net: rx remove premapped failover code

2024-10-13 Thread Xuan Zhuo
Now, the premapped mode can be enabled unconditionally. So we can remove the failover code for merge and small mode. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 80 +--- 1 file changed, 33 insertions(+), 47 deletions(-) diff --git a/drivers/net/v

[PATCH 4/5] virtio_net: enable premapped mode for merge and small by default

2024-10-13 Thread Xuan Zhuo
Currently, the virtio core will perform a dma operation for each buffer. Although, the same page may be operated multiple times. In premapped mod, we can perform only one dma operation for the pages of the alloc frag. This is beneficial for the iommu device. kernel command line: intel_iommu=on io

[PATCH 2/5] virtio_net: introduce vi->mode

2024-10-13 Thread Xuan Zhuo
Now, if we want to judge the rx work mode, we have to use such codes: 1. merge mode: vi->mergeable_rx_bufs 2. big mode: vi->big_packets && !vi->mergeable_rx_bufs 3. small: !vi->big_packets && !vi->mergeable_rx_bufs This is inconvenient and abstract, and we also have this use case: if (vi->

[PATCH 3/5] virtio_net: big mode skip the unmap check

2024-10-13 Thread Xuan Zhuo
The virtio-net big mode did not enable premapped mode, so we did not need to check the unmap. And the subsequent commit will remove the failover code for failing enable premapped for merge and small mode. So we need to remove the checking do_dma code in the big mode path. Signed-off-by: Xuan Zhuo

[PATCH 1/5] virtio-net: fix overflow inside virtnet_rq_alloc

2024-10-13 Thread Xuan Zhuo
When the frag just got a page, then may lead to regression on VM. Specially if the sysctl net.core.high_order_alloc_disable value is 1, then the frag always get a page when do refill. Which could see reliable crashes or scp failure (scp a file 100M in size to VM): The issue is that the virtnet_rq

[PATCH 0/5] virtio_net: enable premapped mode by default

2024-10-13 Thread Xuan Zhuo
In the last linux version, we disabled this feature to fix the regress[1]. The patch set is try to fix the problem and re-enable it. More info: http://lore.kernel.org/all/20240820071913.68004-1-xuanz...@linux.alibaba.com Thanks. [1]: http://lore.kernel.org/all/8b20cc28-45a9-4643-8e87-ba164a540