Re: [PATCH net-next v5 2/9] virtio_net: virtnet_send_command supports command-specific-result

2024-04-10 Thread Xuan Zhuo
On Wed, 10 Apr 2024 14:09:11 +0800, Jason Wang wrote: > On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > > > As the spec > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > The virtnet cvq supports to get result from the device. > > > > Signed

Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-10 Thread Xuan Zhuo
On Wed, 10 Apr 2024 14:09:23 +0800, Jason Wang wrote: > On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo wrote: > > > > As the spec > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > make virtio-net support getting the stats from the device by ethtool -

Re: [PATCH net-next v5 4/4] virtio-net: support dim profile fine-tuning

2024-04-10 Thread Jakub Kicinski
On Wed, 10 Apr 2024 11:09:16 +0800 Heng Qi wrote: > The point is that the driver may check whether the user has set > parameters that it does not want. > For example, virtio may not want the modification of comps, and ice/idpf > may not want the modification > of comps and pkts. If it's simply a

[PATCH vhost 0/6] virtio_net: rx enable premapped mode by default

2024-04-10 Thread Xuan Zhuo
Actually, for the virtio drivers, we can enable premapped mode whatever the value of use_dma_api. Because we provide the virtio dma apis. So the driver can enable premapped mode unconditionally. This patch set makes the big mode of virtio-net to support premapped mode. And enable premapped mode fo

[PATCH vhost 1/6] virtio_ring: introduce dma map api for page

2024-04-10 Thread Xuan Zhuo
The virtio-net big mode sq will use these APIs to map the pages. dma_addr_t virtqueue_dma_map_page_attrs(struct virtqueue *_vq, struct page *page, size_t offset, size_t size, enum dma_data_direction dir,

[PATCH vhost 2/6] virtio_ring: enable premapped mode whatever use_dma_api

2024-04-10 Thread Xuan Zhuo
Now, we have virtio DMA APIs, the driver can be the premapped mode whatever the virtio core uses dma api or not. So remove the limit of checking use_dma_api from virtqueue_set_dma_premapped(). Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 7 +-- 1 file changed, 1 insertion(+),

[PATCH vhost 3/6] virtio_net: replace private by pp struct inside page

2024-04-10 Thread Xuan Zhuo
Now, we chain the pages of big mode by the page's private variable. But a subsequent patch aims to make the big mode to support premapped mode. This requires additional space to store the dma addr. Within the sub-struct that contains the 'private', there is no suitable variable for storing the DMA

[PATCH vhost 4/6] virtio_net: big mode support premapped

2024-04-10 Thread Xuan Zhuo
In big mode, pre-mapping DMA is beneficial because if the pages are not used, we can reuse them without needing to unmap and remap. We require space to store the DMA address. I use the page.dma_addr to store the DMA address from the pp structure inside the page. Every page retrieved from get_a_pa

[PATCH vhost 5/6] virtio_net: enable premapped by default

2024-04-10 Thread Xuan Zhuo
Currently, big, merge, and small modes all support the premapped mode. We can now enable premapped mode by default. Furthermore, virtqueue_set_dma_premapped() must succeed when called immediately after find_vqs(). Consequently, we can assume that premapped mode is always enabled. Signed-off-by: Xu

[PATCH vhost 6/6] virtio_net: rx remove premapped failover code

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

Re: [PATCH net-next v5 4/9] virtio_net: support device stats

2024-04-10 Thread Jason Wang
On Wed, Apr 10, 2024 at 6:55 PM Xuan Zhuo wrote: > > On Wed, 10 Apr 2024 14:09:23 +0800, Jason Wang wrote: > > On Mon, Mar 18, 2024 at 7:06 PM Xuan Zhuo > > wrote: > > > > > > As the spec > > > https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82 > > > > > >