[PATCH net-next v1 0/4] virtio_net: enable premapped mode by default

2024-10-29 Thread Xuan Zhuo
v1: 1. fix some small problems 2. remove commit "virtio_net: introduce vi->mode" 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...@lin

[PATCH net-next v1 1/4] virtio-net: fix overflow inside virtnet_rq_alloc

2024-10-29 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 net-next v1 4/4] virtio_net: rx remove premapped failover code

2024-10-29 Thread Xuan Zhuo
Now, the premapped mode can be enabled unconditionally. So we can remove the failover code for merge and small mode. The virtnet_rq_xxx() helper would be only used if the mode is using pre mapping. A check is added to prevent misusing of these API. Tested-by: Darren Kenny Signed-off-by: Xuan Zh

[PATCH net-next v1 3/4] virtio_net: enable premapped mode for merge and small by default

2024-10-29 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 net-next v1 2/4] virtio_net: big mode skip the unmap check

2024-10-29 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. Tested-by: Darren Kenny