Re: [PATCH net-next V2 1/2] virtio-net: convert rx mode setting to use workqueue

2023-05-09 Thread Michael S. Tsirkin
On Mon, Apr 17, 2023 at 11:40:58AM +0800, Jason Wang wrote: > On Fri, Apr 14, 2023 at 3:21 PM Michael S. Tsirkin wrote: > > > > On Fri, Apr 14, 2023 at 01:04:15PM +0800, Jason Wang wrote: > > > Forget to cc netdev, adding. > > > > > > On Fri, Apr 14, 2023 at 12:25 AM Michael S. Tsirkin > > > wro

Re: [PATCH net v3] virtio_net: Fix error unwinding of XDP initialization

2023-05-09 Thread Jason Wang
在 2023/5/9 09:43, Xuan Zhuo 写道: On Mon, 8 May 2023 11:00:10 -0400, Feng Liu wrote: On 2023-05-07 p.m.9:45, Xuan Zhuo wrote: External email: Use caution opening links or attachments On Sat, 6 May 2023 08:08:02 -0400, Feng Liu wrote: On 2023-05-05 p.m.10:33, Xuan Zhuo wrote: External ema

Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread Michael S. Tsirkin
On Wed, May 10, 2023 at 12:04:50PM +0800, Jason Wang wrote: > On Wed, May 10, 2023 at 11:44 AM Michael S. Tsirkin wrote: > > > > On Wed, May 10, 2023 at 11:26:54AM +0800, Xuan Zhuo wrote: > > > On Wed, 10 May 2023 10:54:37 +0800, zhenwei pi > > > wrote: > > > > Both split ring and packed ring us

Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread Jason Wang
On Wed, May 10, 2023 at 11:44 AM Michael S. Tsirkin wrote: > > On Wed, May 10, 2023 at 11:26:54AM +0800, Xuan Zhuo wrote: > > On Wed, 10 May 2023 10:54:37 +0800, zhenwei pi > > wrote: > > > Both split ring and packed ring use 32bits to describe the length of > > > a descriptor: see struct vring_

Re: [RFC PATCH v2 1/3] PCI: endpoint: introduce a helper to implement pci ep virtio function

2023-05-09 Thread Shunsuke Mie
I'll fix the typo and some styles you mentioned. In this e-mail, I reply to the other comments. 2023年4月28日(金) 3:28 Bjorn Helgaas : > > Simple typos, don't repost until there's more substantive feedback. > > On Thu, Apr 27, 2023 at 07:44:26PM +0900, Shunsuke Mie wrote: > > The Linux PCIe Endpoint fr

Re: Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread zhenwei pi via Virtualization
On 5/10/23 11:39, Michael S. Tsirkin wrote: On Wed, May 10, 2023 at 10:54:37AM +0800, zhenwei pi wrote: Both split ring and packed ring use 32bits to describe the length of a descriptor: see struct vring_desc and struct vring_packed_desc. This means the max segment size supported by virtio is

Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread Michael S. Tsirkin
On Wed, May 10, 2023 at 10:54:37AM +0800, zhenwei pi wrote: > Both split ring and packed ring use 32bits to describe the length of > a descriptor: see struct vring_desc and struct vring_packed_desc. > This means the max segment size supported by virtio is U32_MAX. > > An example of virtio_max_dma_

Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread Michael S. Tsirkin
On Wed, May 10, 2023 at 11:26:54AM +0800, Xuan Zhuo wrote: > On Wed, 10 May 2023 10:54:37 +0800, zhenwei pi > wrote: > > Both split ring and packed ring use 32bits to describe the length of > > a descriptor: see struct vring_desc and struct vring_packed_desc. > > This means the max segment size s

Re: [PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread Xuan Zhuo
On Wed, 10 May 2023 10:54:37 +0800, zhenwei pi wrote: > Both split ring and packed ring use 32bits to describe the length of > a descriptor: see struct vring_desc and struct vring_packed_desc. > This means the max segment size supported by virtio is U32_MAX. > > An example of virtio_max_dma_size i

Re: [RFC PATCH v2 2/3] virtio_pci: add a definition of queue flag in ISR

2023-05-09 Thread Shunsuke Mie
2023年5月8日(月) 12:59 Jason Wang : > > On Thu, Apr 27, 2023 at 6:44 PM Shunsuke Mie wrote: > > > > Already it has beed defined a config changed flag of ISR, but not the queue > > Typo should be "been". Thanks for pointing that out. > > flag. Add a macro for it. > > > > Signed-off-by: Shunsuke Mie >

Re: [RFC PATCH v2 3/3] PCI: endpoint: Add EP function driver to provide virtio-console functionality

2023-05-09 Thread Shunsuke Mie
Hi Json, 2023年5月8日(月) 13:03 Jason Wang : > > On Thu, Apr 27, 2023 at 6:44 PM Shunsuke Mie wrote: > > > > Add a new PCIe endpoint function driver that works as a pci virtio-console > > device. The console connect to endpoint side console. It enables to > > communicate PCIe host and endpoint. > > >

[PATCH] virtio_ring: use u32 for virtio_max_dma_size

2023-05-09 Thread zhenwei pi via Virtualization
Both split ring and packed ring use 32bits to describe the length of a descriptor: see struct vring_desc and struct vring_packed_desc. This means the max segment size supported by virtio is U32_MAX. An example of virtio_max_dma_size in virtio_blk.c: u32 v, max_size; max_size = virtio_max_dma_

Re: [RFC PATCH v2 3/3] PCI: endpoint: Add EP function driver to provide virtio-console functionality

2023-05-09 Thread Shunsuke Mie
Hi Bjorn, Thanks for the many comments. I will fix the mannerisms and typos as noted. 2023年4月28日(金) 3:09 Bjorn Helgaas : > > Random typos and trivial things. No need to repost until somebody > does a more substantive review. > > On Thu, Apr 27, 2023 at 07:44:28PM +0900, Shunsuke Mie wrote: > > Ad

Re: [RFC PATCH 2/2] virtio-balloon: Add Working Set reporting

2023-05-09 Thread Michael S. Tsirkin
On Wed, May 10, 2023 at 02:54:19AM +0800, Yuanchu Xie wrote: > diff --git a/include/uapi/linux/virtio_balloon.h > b/include/uapi/linux/virtio_balloon.h > index ddaa45e723c4..06d0683d8d8c 100644 > --- a/include/uapi/linux/virtio_balloon.h > +++ b/include/uapi/linux/virtio_balloon.h Any changes to

[PATCH net v5] virtio_net: Fix error unwinding of XDP initialization

2023-05-09 Thread Feng Liu via Virtualization
When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error unwi

Re: [PATCH net v4] virtio_net: Fix error unwinding of XDP initialization

2023-05-09 Thread Feng Liu via Virtualization
On 2023-05-09 a.m.12:42, Michael S. Tsirkin wrote: External email: Use caution opening links or attachments On Mon, May 08, 2023 at 06:27:08PM -0400, Feng Liu wrote: When initializing XDP in virtnet_open(), some rq xdp initialization may hit an error causing net device open failed. However,

Re: [PATCH v2 2/3] vhost: support PACKED when setting-getting vring_base

2023-05-09 Thread Stefano Garzarella
On Mon, Apr 24, 2023 at 03:50:30PM -0700, Shannon Nelson via Virtualization wrote: Use the right structs for PACKED or split vqs when setting and getting the vring base. Signed-off-by: Shannon Nelson --- drivers/vhost/vhost.c | 18 +- drivers/vhost/vhost.h | 8 ++-- 2 files

[PATCH vhost v8 11/12] virtio_ring: separate the logic of reset/enable from virtqueue_resize

2023-05-09 Thread Xuan Zhuo
The subsequent reset function will reuse these logic. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 58 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ri

[PATCH vhost v8 12/12] virtio_ring: introduce virtqueue_reset()

2023-05-09 Thread Xuan Zhuo
Introduce virtqueue_reset() to release all buffer inside vq. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 33 + include/linux/virtio.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/drivers/virtio/virtio_ring.c

[PATCH vhost v8 02/12] virtio_ring: packed: separate dma codes

2023-05-09 Thread Xuan Zhuo
DMA-related logic is separated from the virtqueue_add_packed(). DMA address will be saved as sg->dma_address, then virtqueue_add_packed() will use it directly. Unmap operation will be simpler. The purpose of this is to facilitate subsequent support to receive dma address mapped by drivers. Signed

[PATCH vhost v8 09/12] virtio_ring: introduce virtqueue_dma_dev()

2023-05-09 Thread Xuan Zhuo
Added virtqueue_dma_dev() to get DMA device for virtio. Then the caller can do dma operation in advance. The purpose is to keep memory mapped across multiple add/get buf operations. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 17 + include/linux/virtio.h |

[PATCH vhost v8 10/12] virtio_ring: correct the expression of the description of virtqueue_resize()

2023-05-09 Thread Xuan Zhuo
Modify the "useless" to a more accurate "unused". Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index a0cad2977a61..e063ac764db6 10064

[PATCH vhost v8 08/12] virtio_ring: update document for virtqueue_add_*

2023-05-09 Thread Xuan Zhuo
Update the document of virtqueue_add_* series API, allowing the callers to use sg->dma_address to pass the dma address to Virtio Core. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/virtio/virtio_ring.c

[PATCH vhost v8 00/12] virtio core prepares for AF_XDP

2023-05-09 Thread Xuan Zhuo
## About DMA APIs Now, virtio may can not work with DMA APIs when virtio features do not have VIRTIO_F_ACCESS_PLATFORM. 1. I tried to let DMA APIs return phy address by virtio-device. But DMA APIs just work with the "real" devices. 2. I tried to let xsk support callballs to get phy address fr

[PATCH vhost v8 07/12] virtio_ring: remove unused code

2023-05-09 Thread Xuan Zhuo
Now, vring_map_one_sg() is only called by virtqueue_map_sgs(). And !use_dma_api is check before vring_map_one_sg(), so we not need to check !use_dma_api inside vring_map_one_sg(). Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 10 -- 1 file changed, 10 deletions(-) diff --g

[PATCH vhost v8 05/12] virtio_ring: packed: support premapped

2023-05-09 Thread Xuan Zhuo
virtio core only supports virtual addresses, dma is completed in virtio core. In some scenarios (such as the AF_XDP), the memory is allocated and DMA mapping is completed in advance, so it is necessary for us to support passing the DMA address to virtio core. Drives can use sg->dma_address to pas

[PATCH vhost v8 06/12] virtio_ring: packed-indirect: support premapped

2023-05-09 Thread Xuan Zhuo
virtio core only supports virtual addresses, dma is completed in virtio core. In some scenarios (such as the AF_XDP), the memory is allocated and DMA mapping is completed in advance, so it is necessary for us to support passing the DMA address to virtio core. Drives can use sg->dma_address to pas

[PATCH vhost v8 04/12] virtio_ring: split: support premapped

2023-05-09 Thread Xuan Zhuo
virtio core only supports virtual addresses, dma is completed in virtio core. In some scenarios (such as the AF_XDP), the memory is allocated and DMA mapping is completed in advance, so it is necessary for us to support passing the DMA address to virtio core. Drives can use sg->dma_address to pas

[PATCH vhost v8 03/12] virtio_ring: packed-indirect: separate dma codes

2023-05-09 Thread Xuan Zhuo
DMA-related logic is separated from the virtqueue_add_indirect_packed(). DMA address will be saved as sg->dma_address, then virtqueue_add_indirect_packed() will use it directly. Unmap operation will be simpler. The purpose of this is to facilitate subsequent support to receive dma address mapped

[PATCH vhost v8 01/12] virtio_ring: split: separate dma codes

2023-05-09 Thread Xuan Zhuo
DMA-related logic is separated from the virtqueue_add_split() to one new function. DMA address will be saved as sg->dma_address if use_dma_api is true, then virtqueue_add_split() will use it directly. Unmap operation will be simpler. The purpose of this is to facilitate subsequent support to recei