Re: [PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa

2020-04-26 Thread Zhu Lingshan
On 4/26/2020 2:58 PM, Jason Wang wrote: On 2020/4/26 下午2:09, Zhu Lingshan wrote: This commit implements config interrupt support in vhost_vdpa layer. Signed-off-by: Zhu Lingshan ---   drivers/vhost/vdpa.c   | 47 ++   drivers/vhost/vhost.c

Re: [PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa

2020-04-26 Thread Zhu Lingshan
On 4/26/2020 3:03 PM, Jason Wang wrote: On 2020/4/26 下午2:58, Jason Wang wrote: diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 1813821..8663139 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -18,6 +18,8 @@   typedef void (*vhost_work_fn_t)(struct

Re: [PATCH 1/2] vdpa: Support config interrupt in vhost_vdpa

2020-04-25 Thread Zhu Lingshan
On 4/26/2020 11:07 AM, Jason Wang wrote: On 2020/4/24 下午6:04, Zhu Lingshan wrote: This commit implements config interrupt support in vhost_vdpa layer. Signed-off-by: Zhu Lingshan Signed-off-by: Zhu Lingshan One should be sufficient. ---   drivers/vhost/vdpa.c | 53

Re: [PATCH 2/2] vdpa: implement config interrupt in IFCVF

2020-04-25 Thread Zhu Lingshan
On 4/26/2020 11:25 AM, Jason Wang wrote: On 2020/4/24 下午6:04, Zhu Lingshan wrote: This commit implements config interrupt support in IFC VF Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.c |  3 +++   drivers/vdpa/ifcvf/ifcvf_base.h |  2 ++   drivers/vdpa/ifcvf/ifcvf_main.c

Re: [PATCH V3 1/6] vhost: introduce vhost_vring_call

2020-07-22 Thread Zhu Lingshan
Please ignore this patchset incorrect metadata, will resend soon. Thanks! On 7/22/2020 5:49 PM, Zhu Lingshan wrote: From: Zhu Lingshan This commit introduces struct vhost_vring_call which replaced raw struct eventfd_ctx *call_ctx in struct vhost_virtqueue. Besides eventfd_ctx, it contains

Re: [PATCH V3 4/6] vDPA/ifcvf: remove the version number string

2021-03-10 Thread Zhu Lingshan
Thanks Leon, I will include your ROB if there is a V4. On 3/10/2021 5:16 PM, Leon Romanovsky wrote: On Wed, Mar 10, 2021 at 05:00:50PM +0800, Zhu Lingshan wrote: This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan --- drivers/vdpa

Re: [PATCH V3 3/6] vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids

2021-03-10 Thread Zhu Lingshan
On 3/11/2021 11:25 AM, Jason Wang wrote: On 2021/3/10 5:00 下午, Zhu Lingshan wrote: IFCVF driver probes multiple types of devices now, to distinguish the original device driven by IFCVF from others, it is renamed as "N3000". Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/if

Re: [PATCH V3 6/6] vDPA/ifcvf: verify mandatory feature bits for vDPA

2021-03-10 Thread Zhu Lingshan
On 3/11/2021 11:20 AM, Jason Wang wrote: On 2021/3/10 5:00 下午, Zhu Lingshan wrote: vDPA requres VIRTIO_F_ACCESS_PLATFORM as a must, this commit examines this when set features. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.c | 8   drivers/vdpa/ifcvf/ifcvf_base.h

Re: [PATCH V3 6/6] vDPA/ifcvf: verify mandatory feature bits for vDPA

2021-03-10 Thread Zhu Lingshan
On 3/11/2021 11:20 AM, Jason Wang wrote: On 2021/3/10 5:00 下午, Zhu Lingshan wrote: vDPA requres VIRTIO_F_ACCESS_PLATFORM as a must, this commit examines this when set features. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.c | 8   drivers/vdpa/ifcvf/ifcvf_base.h

Re: [PATCH V3 1/6] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-10 Thread Zhu Lingshan
On 3/11/2021 11:23 AM, Jason Wang wrote: On 2021/3/10 5:00 下午, Zhu Lingshan wrote: In this commit, ifcvf_get_vendor_id() will return a device specific vendor id of the probed pci device than a hard code. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_main.c | 5 -   1 file

Re: [PATCH 1/3] vDPA/ifcvf: deduce VIRTIO device ID when probe

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 2:30 PM, Jason Wang wrote: 在 2021/4/15 下午1:52, Zhu Lingshan 写道: On 4/15/2021 11:30 AM, Jason Wang wrote: 在 2021/4/14 下午5:18, Zhu Lingshan 写道: This commit deduces VIRTIO device ID as device type when probe, then ifcvf_vdpa_get_device_id() can simply return the ID

Re: [PATCH 1/3] vDPA/ifcvf: deduce VIRTIO device ID when probe

2021-04-14 Thread Zhu Lingshan
On 4/15/2021 11:30 AM, Jason Wang wrote: 在 2021/4/14 下午5:18, Zhu Lingshan 写道: This commit deduces VIRTIO device ID as device type when probe, then ifcvf_vdpa_get_device_id() can simply return the ID. ifcvf_vdpa_get_features() and ifcvf_vdpa_get_config_size() can work properly based

Re: [PATCH 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-14 Thread Zhu Lingshan
On 4/15/2021 11:34 AM, Jason Wang wrote: 在 2021/4/14 下午5:18, Zhu Lingshan 写道: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.h | 17 -   drivers/vdpa/ifcvf/ifcvf_main.c | 10

Re: [PATCH 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 3:17 PM, Jason Wang wrote: 在 2021/4/15 下午2:41, Zhu Lingshan 写道: I think we've discussed this sometime in the past but what's the reason for such whitelist consider there's already a get_features() implemention? E.g Any reason to block VIRTIO_BLK_F_WRITE_ZEROS

Re: [PATCH 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 2:31 PM, Jason Wang wrote: 在 2021/4/15 下午1:55, Zhu Lingshan 写道: On 4/15/2021 11:34 AM, Jason Wang wrote: 在 2021/4/14 下午5:18, Zhu Lingshan 写道: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf

Re: [PATCH 1/3] vDPA/ifcvf: deduce VIRTIO device ID when probe

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 3:16 PM, Jason Wang wrote: 在 2021/4/15 下午2:36, Zhu Lingshan 写道: On 4/15/2021 2:30 PM, Jason Wang wrote: 在 2021/4/15 下午1:52, Zhu Lingshan 写道: On 4/15/2021 11:30 AM, Jason Wang wrote: 在 2021/4/14 下午5:18, Zhu Lingshan 写道: This commit deduces VIRTIO device ID as device

Re: [PATCH 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 4:12 PM, Stefano Garzarella wrote: On Wed, Apr 14, 2021 at 05:18:32PM +0800, Zhu Lingshan wrote: get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 11 ++- 1 file changed, 10

Re: [PATCH V2 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 9:41 PM, Stefano Garzarella wrote: On Thu, Apr 15, 2021 at 05:53:35PM +0800, Zhu Lingshan wrote: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h |  8 +++- drivers/vdpa/ifcvf

Re: [PATCH V2 3/3] vDPA/ifcvf: get_config_size should return dev specific config size

2021-04-15 Thread Zhu Lingshan
On 4/15/2021 9:48 PM, Stefano Garzarella wrote: On Thu, Apr 15, 2021 at 05:53:36PM +0800, Zhu Lingshan wrote: get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 18 +- 1 file changed

Re: [PATCH V4 4/4] vDPA/ifcvf: implement shared IRQ feature

2022-02-14 Thread Zhu Lingshan
On 2/14/2022 3:19 PM, Jason Wang wrote: 在 2022/2/3 下午3:27, Zhu Lingshan 写道: On some platforms/devices, there may not be enough MSI vector slots allocated for virtqueues and config changes. In such a case, the interrupt sources(virtqueues, config changes) must share an IRQ/vector, to avoid

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-13 Thread Zhu, Lingshan
On 10/12/2023 9:27 PM, Jason Gunthorpe wrote: On Thu, Oct 12, 2023 at 06:29:47PM +0800, Zhu, Lingshan wrote: sorry for the late reply, we have discussed this for weeks in virtio mailing list. I have proposed a live migration solution which is a config space solution. I'm sorry that can't

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-24 Thread Zhu, Lingshan
On 9/22/2023 4:55 AM, Michael S. Tsirkin wrote: On Thu, Sep 21, 2023 at 04:51:15PM -0300, Jason Gunthorpe wrote: On Thu, Sep 21, 2023 at 03:17:25PM -0400, Michael S. Tsirkin wrote: On Thu, Sep 21, 2023 at 03:39:26PM -0300, Jason Gunthorpe wrote: What is the huge amount of work am I asking

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-21 Thread Zhu, Lingshan
On 9/22/2023 2:39 AM, Jason Gunthorpe wrote: On Thu, Sep 21, 2023 at 12:53:04PM -0400, Michael S. Tsirkin wrote: vdpa is not vfio, I don't know how you can suggest vdpa is a replacement for a vfio driver. They are completely different things. Each side has its own strengths, and vfio

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Zhu, Lingshan
that wait in hardware, though. Just defer completion until read is done. I agree with MST. At least Intel devices work fine with vfio-pci and legacy driver without any changes. So far so good. Thanks Zhu Lingshan Please see the reset flow of 1.x device as below. In fact the comment of the 1.x d

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-12 Thread Zhu, Lingshan
the virtio core support vendor specific behavior like that? It's not a thing it's Zhu Lingshan :) intel is just one of the vendors that implemented vdpa support and so Zhu Lingshan from intel is working on vdpa and has also proposed virtio spec extensions for migration. intel's driver is called ifcvf

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-12 Thread Zhu, Lingshan
On 10/11/2023 2:59 PM, Christoph Hellwig wrote: On Wed, Oct 11, 2023 at 02:43:37AM -0400, Michael S. Tsirkin wrote: Btw, what is that intel thing everyone is talking about? And why would the virtio core support vendor specific behavior like that? It's not a thing it's Zhu Lingshan :) intel

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-16 Thread Zhu, Lingshan
On 10/16/2023 4:52 PM, Michael S. Tsirkin wrote: On Mon, Oct 16, 2023 at 04:33:10PM +0800, Zhu, Lingshan wrote: On 10/13/2023 9:50 PM, Michael S. Tsirkin wrote: On Fri, Oct 13, 2023 at 06:28:34PM +0800, Zhu, Lingshan wrote: On 10/12/2023 9:27 PM, Jason Gunthorpe wrote: On Thu, Oct

Re: [PATCH vfio 10/11] vfio/virtio: Expose admin commands over virtio device

2023-10-16 Thread Zhu, Lingshan
On 10/13/2023 9:50 PM, Michael S. Tsirkin wrote: On Fri, Oct 13, 2023 at 06:28:34PM +0800, Zhu, Lingshan wrote: On 10/12/2023 9:27 PM, Jason Gunthorpe wrote: On Thu, Oct 12, 2023 at 06:29:47PM +0800, Zhu, Lingshan wrote: sorry for the late reply, we have discussed

Re: [PATCH V4 3/6] vDPA: allow userspace to query features of a vDPA device

2022-07-26 Thread Zhu Lingshan
On 7/26/2022 7:06 PM, Parav Pandit via Virtualization wrote: From: Zhu, Lingshan Sent: Tuesday, July 26, 2022 7:03 AM On 7/24/2022 11:21 PM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Saturday, July 23, 2022 7:24 AM On 7/22/2022 9:12 PM, Parav Pandit wrote: From: Zhu Lingshan Sent

Re: [PATCH] vdpa: ifcvf: Do proper cleanup if IFCVF init fails

2022-12-28 Thread Zhu, Lingshan
han <0070472...@gmail.com> Acked-by: Jason Wang Thanks Acked-by: Zhu Lingshan Thanks --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index f9c0044c6442..44b29289aa19 10

Re: [PATCH V2 00/12] ifcvf/vDPA implement features provisioning

2022-12-21 Thread Zhu, Lingshan
On 12/13/2022 2:57 PM, Zhu, Lingshan wrote: On 12/6/2022 4:25 PM, Jason Wang wrote: On Fri, Nov 25, 2022 at 11:06 PM Zhu Lingshan wrote: This series implements features provisioning for ifcvf. By applying this series, we allow userspace to create a vDPA device with selected (management

Re: [PATCH V2 00/12] ifcvf/vDPA implement features provisioning

2022-12-12 Thread Zhu, Lingshan
On 12/6/2022 4:25 PM, Jason Wang wrote: On Fri, Nov 25, 2022 at 11:06 PM Zhu Lingshan wrote: This series implements features provisioning for ifcvf. By applying this series, we allow userspace to create a vDPA device with selected (management device supported) feature bits and mask out

[PATCH V2 01/12] vDPA/ifcvf: decouple hw features manipulators from the adapter

2022-11-25 Thread Zhu Lingshan
This commit gets rid of ifcvf_adapter in hw features related functions in ifcvf_base. Then these functions are more rubust and de-coupling from the ifcvf_adapter layer. So these functions could be invoded once the device is probed, even before the adapter is allocaed. Signed-off-by: Zhu Lingshan

[PATCH V2 02/12] vDPA/ifcvf: decouple config space ops from the adapter

2022-11-25 Thread Zhu Lingshan
This commit decopules the config space ops from the adapter layer, so these functions can be invoked once the device is probed. Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_base.c | 21 + 1 file changed, 5 insertions(+), 16 deletions

[PATCH V2 00/12] ifcvf/vDPA implement features provisioning

2022-11-25 Thread Zhu Lingshan
show vdpa0 mac 00:e8:ca:11:be:05 link up link_announce false negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Please help review Thanks Changes from V1: split original patch 1 ~ patch 3 to small patches that are less than 100 lines, so they can be applied to stalbe kernel(Jason) Zhu Lingshan

[PATCH V2 03/12] vDPA/ifcvf: alloc the mgmt_dev before the adapter

2022-11-25 Thread Zhu Lingshan
This commit reverses the order of allocating the management device and the adapter. So that it would be possible to move the allocation of the adapter to dev_add(). Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c | 31 ++- 1

[PATCH V2 04/12] vDPA/ifcvf: decouple vq IRQ releasers from the adapter

2022-11-25 Thread Zhu Lingshan
This commit decouples the IRQ releasers from the adapter, so that these functions could be safely invoked once probe Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff

[PATCH V2 05/12] vDPA/ifcvf: decouple config IRQ releaser from the adapter

2022-11-25 Thread Zhu Lingshan
This commit decouples config IRQ releaser from the adapter, so that it could be invoked once probe or in err handlers. ifcvf_free_irq() works on ifcvf_hw in this commit Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c | 22 ++ 1 file

[PATCH V2 11/12] vDPA/ifcvf: retire ifcvf_private_to_vf

2022-11-25 Thread Zhu Lingshan
This commit retires ifcvf_private_to_vf, because the vf is already a member of the adapter, so it could be easily addressed by adapter->vf. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 3 --- drivers/vdpa/ifcvf/ifcvf_main.c | 10 +- 2 files changed, 5 inserti

[PATCH V2 12/12] vDPA/ifcvf: implement features provisioning

2022-11-25 Thread Zhu Lingshan
vdpa0 mac 00:e8:ca:11:be:05 link up link_announce false negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 2 +- drivers/vdpa/ifcvf/ifcvf_base.h | 3 +++ drivers/vdpa/ifcvf/ifcvf_main.c | 13 + 3 files changed, 17

[PATCH V2 07/12] vDPA/ifcvf: decouple config/dev IRQ requester and vectors allocator from the adapter

2022-11-25 Thread Zhu Lingshan
This commit decouples the config irq requester, the device shared irq requester and the MSI vectors allocator from the adapter. So they can be safely invoked since probe before the adapter is allocated. Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c

[PATCH V2 06/12] vDPA/ifcvf: decouple vq irq requester from the adapter

2022-11-25 Thread Zhu Lingshan
This commit decouples the vq irq requester from the adapter, so that these functions can be invoked since probe. Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git

[PATCH V2 09/12] vDPA/ifcvf: manage ifcvf_hw in the mgmt_dev

2022-11-25 Thread Zhu Lingshan
This commit allocates the hw structure in the management device structure. So the hardware can be initialized once the management device is allocated in probe. Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 +++-- drivers/vdpa/ifcvf/ifcvf_main.c

[PATCH V2 10/12] vDPA/ifcvf: allocate the adapter in dev_add()

2022-11-25 Thread Zhu Lingshan
The adapter is the container of the vdpa_device, this commits allocate the adapter in dev_add() rather than in probe(). So that the vdpa_device() could be re-created when the userspace creates the vdpa device, and free-ed in dev_del() Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org

[PATCH V2 08/12] vDPA/ifcvf: ifcvf_request_irq works on ifcvf_hw

2022-11-25 Thread Zhu Lingshan
All ifcvf_request_irq's callees are refactored to work on ifcvf_hw, so it should be decoupled from the adapter as well Signed-off-by: Zhu Lingshan Cc: sta...@vger.kernel.org --- drivers/vdpa/ifcvf/ifcvf_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa

Re: [PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-10 Thread Zhu, Lingshan
On 11/10/2022 5:13 PM, Jason Wang wrote: On Thu, Nov 10, 2022 at 4:59 PM Zhu, Lingshan wrote: On 11/10/2022 2:29 PM, Jason Wang wrote: 在 2022/11/10 14:20, Zhu, Lingshan 写道: On 11/10/2022 11:49 AM, Jason Wang wrote: On Wed, Nov 9, 2022 at 5:06 PM Zhu, Lingshan wrote: On 11/9/2022 4

Re: [PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-09 Thread Zhu, Lingshan
On 11/9/2022 4:59 PM, Jason Wang wrote: On Wed, Nov 9, 2022 at 4:14 PM Zhu, Lingshan wrote: On 11/9/2022 2:51 PM, Jason Wang wrote: On Mon, Nov 7, 2022 at 5:42 PM Zhu Lingshan wrote: This series implements features provisioning for ifcvf. By applying this series, we allow userspace

Re: [PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-09 Thread Zhu, Lingshan
On 11/9/2022 2:51 PM, Jason Wang wrote: On Mon, Nov 7, 2022 at 5:42 PM Zhu Lingshan wrote: This series implements features provisioning for ifcvf. By applying this series, we allow userspace to create a vDPA device with selected (management device supported) feature bits and mask out others

[PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-07 Thread Zhu Lingshan
This series implements features provisioning for ifcvf. By applying this series, we allow userspace to create a vDPA device with selected (management device supported) feature bits and mask out others. Please help review Thanks Zhu Lingshan (4): vDPA/ifcvf: ifcvf base layer interfaces work

[PATCH 1/4] vDPA/ifcvf: ifcvf base layer interfaces work on struct ifcvf_hw

2022-11-07 Thread Zhu Lingshan
To be more rubust and low coupling in ifcvf base layer, this commit gets rid of struct ifcvf_adapter in ifcvf_base which is introduced in ifcvf_main. Now ifcvf base layer interfaces work on ifcvf_hw only, so that the base interfaces can be safely invoked since probe. Signed-off-by: Zhu Lingshan

[PATCH 2/4] vDPA/ifcvf: IRQ interfaces work on ifcvf_hw

2022-11-07 Thread Zhu Lingshan
In this commit, ifcvf IRQ interfaces work on ifcvf_hw, so these functions can be safely invoked before the adapter struct is allocated since probe. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 85 ++--- 1 file changed, 37 insertions(+), 48

[PATCH 3/4] vDPA/ifcvf: allocate ifcvf_adapter in dev_add()

2022-11-07 Thread Zhu Lingshan
This commits allocates ifcvf_adapter which is a container of struct vdpa_device in dev_add() interface than in probe() Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 +-- drivers/vdpa/ifcvf/ifcvf_main.c | 58 ++--- 2 files changed, 26 insertions

[PATCH 4/4] vDPA/ifcvf: implement features provisioning

2022-11-07 Thread Zhu Lingshan
vdpa0 mac 00:e8:ca:11:be:05 link up link_announce false negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 2 +- drivers/vdpa/ifcvf/ifcvf_base.h | 3 +++ drivers/vdpa/ifcvf/ifcvf_main.c | 13 + 3 files changed, 17

Re: [PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-09 Thread Zhu, Lingshan
On 11/10/2022 11:49 AM, Jason Wang wrote: On Wed, Nov 9, 2022 at 5:06 PM Zhu, Lingshan wrote: On 11/9/2022 4:59 PM, Jason Wang wrote: On Wed, Nov 9, 2022 at 4:14 PM Zhu, Lingshan wrote: On 11/9/2022 2:51 PM, Jason Wang wrote: On Mon, Nov 7, 2022 at 5:42 PM Zhu Lingshan wrote

Re: [PATCH 0/4] ifcvf/vDPA implement features provisioning

2022-11-10 Thread Zhu, Lingshan
On 11/10/2022 2:29 PM, Jason Wang wrote: 在 2022/11/10 14:20, Zhu, Lingshan 写道: On 11/10/2022 11:49 AM, Jason Wang wrote: On Wed, Nov 9, 2022 at 5:06 PM Zhu, Lingshan wrote: On 11/9/2022 4:59 PM, Jason Wang wrote: On Wed, Nov 9, 2022 at 4:14 PM Zhu, Lingshan wrote: On 11/9/2022 2

Re: [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-04-20 Thread Zhu, Lingshan
On 4/3/2023 6:10 PM, Zhu, Lingshan wrote: On 4/3/2023 1:28 PM, Jason Wang wrote: On Fri, Mar 31, 2023 at 8:49 PM Zhu Lingshan wrote: Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations

Re: [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-04-24 Thread Zhu, Lingshan
On 4/24/2023 12:51 PM, Michael S. Tsirkin wrote: On Sat, Apr 01, 2023 at 04:48:49AM +0800, Zhu Lingshan wrote: Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations that passed down from

Re: [PATCH 2/5] get_driver_features from virito registers

2023-04-24 Thread Zhu, Lingshan
On 4/24/2023 12:50 PM, Michael S. Tsirkin wrote: subj typo: virtio will fix in V2, thanks! On Sat, Apr 01, 2023 at 04:48:51AM +0800, Zhu Lingshan wrote: This commit implements a new function ifcvf_get_driver_feature() which read driver_features from virtio registers. To be less ambiguous

Re: [PATCH 1/5] virt queue ops take immediate actions

2023-04-27 Thread Zhu, Lingshan
On 4/26/2023 11:39 AM, Jason Wang wrote: 在 2023/4/1 04:48, Zhu Lingshan 写道: In this commit, virtqueue operations including: set_vq_num(), set_vq_address(), set_vq_ready() and get_vq_ready() access PCI registers directly to take immediate actions. Signed-off-by: Zhu Lingshan ---   drivers

Re: [PATCH 4/5] synchronize irqs in the reset routine

2023-04-27 Thread Zhu, Lingshan
On 4/26/2023 1:06 PM, Jason Wang wrote: 在 2023/4/1 04:48, Zhu Lingshan 写道: This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus ifcvf_stop_hw() and reset() are refactored as well. Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.c | 61

Re: [PATCH 2/5] get_driver_features from virito registers

2023-04-27 Thread Zhu, Lingshan
On 4/26/2023 12:02 PM, Jason Wang wrote: 在 2023/4/1 04:48, Zhu Lingshan 写道: This commit implements a new function ifcvf_get_driver_feature() which read driver_features from virtio registers. To be less ambiguous, ifcvf_set_features() is renamed to ifcvf_set_driver_features

[PATCH 4/5] synchronize irqs in the reset routine

2023-03-31 Thread Zhu Lingshan
This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus ifcvf_stop_hw() and reset() are refactored as well. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 61 ++--- drivers/vdpa/ifcvf/ifcvf_main.c | 45

[PATCH 1/5] virt queue ops take immediate actions

2023-03-31 Thread Zhu Lingshan
In this commit, virtqueue operations including: set_vq_num(), set_vq_address(), set_vq_ready() and get_vq_ready() access PCI registers directly to take immediate actions. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 58 - drivers/vdpa/ifcvf

[PATCH 2/5] get_driver_features from virito registers

2023-03-31 Thread Zhu Lingshan
vDPA device features. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 38 + drivers/vdpa/ifcvf/ifcvf_base.h | 5 +++-- drivers/vdpa/ifcvf/ifcvf_main.c | 9 +--- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/vdpa

[PATCH 3/5] retire ifcvf_start_datapath and ifcvf_add_status

2023-03-31 Thread Zhu Lingshan
by a vendor driver's decision, this driver should only set device status which is from virito drivers upon vdpa_ops.set_status() Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 19 --- drivers/vdpa/ifcvf/ifcvf_base.h | 1 - drivers/vdpa/ifcvf/ifcvf_main.c | 23

[PATCH 5/5] a vendor driver should not set _CONFIG_S_FAILED

2023-03-31 Thread Zhu Lingshan
VIRTIO_CONFIG_S_FAILED indicates the guest driver has given up the device due to fatal errors. So it is the guest decision, the vendor driver should not set this status to the device. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-03-31 Thread Zhu Lingshan
this series implement an immediate initialization mechanism, which means rather than the former store-load process, the virtio operations like vq ops would take immediate actions by access the virtio registers. This series also implement irq synchronization in the reset routine Zhu Lingshan (5): virt

Re: [PATCH 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-04-03 Thread Zhu, Lingshan
On 4/3/2023 1:28 PM, Jason Wang wrote: On Fri, Mar 31, 2023 at 8:49 PM Zhu Lingshan wrote: Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations that passed down from the userspace

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27, 2023 at 02:15:42AM +0800, Zhu Lingshan wrote: Current virtio-net only probes a device with VIRITO_ID_NET == 1. For a modern-transtional virtio-net device which has a transtional device id 0x1000 and acts as a modern device

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27, 2023 at 02:15:42AM +0800, Zhu Lingshan wrote: Current virtio-net only probes a device with VIRITO_ID_NET == 1

Re: [PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine

2023-05-25 Thread Zhu, Lingshan
On 5/26/2023 11:36 AM, Zhu, Lingshan wrote: On 5/26/2023 9:34 AM, Jason Wang wrote: On Thu, May 25, 2023 at 5:38 PM Zhu, Lingshan wrote: On 5/24/2023 4:03 PM, Jason Wang wrote: On Mon, May 8, 2023 at 6:05 PM Zhu Lingshan wrote: This commit synchronize irqs of the virtqueues

Re: [PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine

2023-05-26 Thread Zhu, Lingshan
On 5/26/2023 2:09 PM, Jason Wang wrote: On Fri, May 26, 2023 at 1:30 PM Zhu, Lingshan wrote: On 5/26/2023 11:36 AM, Zhu, Lingshan wrote: On 5/26/2023 9:34 AM, Jason Wang wrote: On Thu, May 25, 2023 at 5:38 PM Zhu, Lingshan wrote: On 5/24/2023 4:03 PM, Jason Wang wrote: On Mon, May 8

[PATCH V3 1/5] vDPA/ifcvf: virt queue ops take immediate actions

2023-05-26 Thread Zhu Lingshan
In this commit, virtqueue operations including: set_vq_num(), set_vq_address(), set_vq_ready() and get_vq_ready() access PCI registers directly to take immediate actions. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 58

[PATCH V3 2/5] vDPA/ifcvf: get_driver_features from virtio registers

2023-05-26 Thread Zhu Lingshan
vDPA device features. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 38 + drivers/vdpa/ifcvf/ifcvf_base.h | 5 +++-- drivers/vdpa/ifcvf/ifcvf_main.c | 9 +--- 3 files changed, 29 insertions(+), 23 deletions(-) diff

[PATCH V3 5/5] vDPA/ifcvf: a vendor driver should not set _CONFIG_S_FAILED

2023-05-26 Thread Zhu Lingshan
VIRTIO_CONFIG_S_FAILED indicates the guest driver has given up the device due to fatal errors. So it is the guest decision, the vendor driver should not set this status to the device. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 4 +--- 1 file changed

[PATCH V3 4/5] vDPA/ifcvf: synchronize irqs in the reset routine

2023-05-26 Thread Zhu Lingshan
This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus ifcvf_stop() and reset() are refactored as well. This commit renames ifcvf_stop_hw() to ifcvf_stop() Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 43

[PATCH V3 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-05-26 Thread Zhu Lingshan
function ifcvf_stop_hw to ifcvf_stop (Jason) Changes from V1: 1)pull device status in devce_reset (Jason) 2)simplify the procedure which sycn irqs (Jason) 3)fix typos(Michael) Zhu Lingshan (5): vDPA/ifcvf: virt queue ops take immediate actions vDPA/ifcvf: get_driver_features from virtio

[PATCH V3 3/5] vDPA/ifcvf: retire ifcvf_start_datapath and ifcvf_add_status

2023-05-26 Thread Zhu Lingshan
by a vendor driver's decision, this driver should only set device status which is from virito drivers upon vdpa_ops.set_status() Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 19 --- drivers/vdpa/ifcvf/ifcvf_base.h | 1 - drivers/vdpa/ifcvf

Re: [PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine

2023-05-25 Thread Zhu, Lingshan
On 5/26/2023 9:34 AM, Jason Wang wrote: On Thu, May 25, 2023 at 5:38 PM Zhu, Lingshan wrote: On 5/24/2023 4:03 PM, Jason Wang wrote: On Mon, May 8, 2023 at 6:05 PM Zhu Lingshan wrote: This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus

[RFC] virtio-net: support modern-transtional devices

2023-05-26 Thread Zhu Lingshan
ith this solution, all in the modern code path: 1) assign the device id to mdev->id.device 2) add transitional device ids in the virtio-net(and others) probe table. Comments are welcome! Thanks! Signed-off-by: Zhu Lingshan --- drivers/net/virtio_net.c | 1 + drivers/

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 02:19:36PM +0800, Zhu, Lingshan wrote: On 5/28/2023 7:28 PM, Michael S. Tsirkin wrote: On Sat, May 27

Re: [RFC] virtio-net: support modern-transtional devices

2023-05-29 Thread Zhu, Lingshan
On 5/29/2023 8:04 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 06:41:54PM +0800, Zhu, Lingshan wrote: On 5/29/2023 6:12 PM, Michael S. Tsirkin wrote: On Mon, May 29, 2023 at 04:07:42PM +0800, Zhu, Lingshan wrote: On 5/29/2023 2:38 PM, Michael S. Tsirkin wrote

Re: [PATCH V2 4/5] vDPA/ifcvf: synchronize irqs in the reset routine

2023-05-25 Thread Zhu, Lingshan
On 5/24/2023 4:03 PM, Jason Wang wrote: On Mon, May 8, 2023 at 6:05 PM Zhu Lingshan wrote: This commit synchronize irqs of the virtqueues and config space in the reset routine. Thus ifcvf_stop_hw() and reset() are refactored as well. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf

[PATCH 1/3] vDPA/ifcvf: dynamic allocate vq data stores

2023-06-09 Thread Zhu Lingshan
This commit dynamically allocates the data stores for the virtqueues based on virtio_pci_common_cfg.num_queues. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 4 drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 2 ++ 3 files changed, 7 insertions

[PATCH 0/3] vDPA/ifcvf: enable virtio-net on Intel F2000X-PL

2023-06-09 Thread Zhu Lingshan
Hi This series enables vDPA/ifcvf support for virtio-net devices on Intel F2000X-PL Infrastructure Processing Unit. Please help review Thanks! Zhu Lingshan (3): vDPA/ifcvf: dynamic allocate vq data stores vDPA/ifcvf: detect and report max allowed vq size vDPA/ifcvf: implement new

[PATCH 3/3] vDPA/ifcvf: implement new accessors for vq_state

2023-06-09 Thread Zhu Lingshan
This commit implements a better layout of the live migration bar, therefore the accessors for virtqueue state have been refactored. This commit also add a comment to the probing-ids list, indicating this driver drives F2000X-PL virtio-net Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf

[PATCH 2/3] vDPA/ifcvf: detect and report max allowed vq size

2023-06-09 Thread Zhu Lingshan
Rather than a hardcode, this commit detects and reports the max value of allowed size of the virtqueues Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 31 +++ drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 4 +++- 3

Re: [PATCH V2 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-05-21 Thread Zhu, Lingshan
ping On 5/9/2023 2:05 AM, Zhu Lingshan wrote: Formerly, ifcvf driver has implemented a lazy-initialization mechanism for the virtqueues and other config space contents, it would store all configurations that passed down from the userspace, then load them to the device config space upon

Re: [PATCH 0/3] vDPA/ifcvf: enable virtio-net on Intel F2000X-PL

2023-06-12 Thread Zhu, Lingshan
On 6/10/2023 12:15 AM, Michael S. Tsirkin wrote: On Sat, Jun 10, 2023 at 12:21:57AM +0800, Zhu Lingshan wrote: Hi This series enables vDPA/ifcvf support for virtio-net devices on Intel F2000X-PL Infrastructure Processing Unit. Please help review Hard trouble applying - which tree

[PATCH V2 3/3] vDPA/ifcvf: implement new accessors for vq_state

2023-06-12 Thread Zhu Lingshan
This commit implements a better layout of the live migration bar, therefore the accessors for virtqueue state have been refactored. This commit also add a comment to the probing-ids list, indicating this driver drives F2000X-PL virtio-net Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf

[PATCH V2 2/3] vDPA/ifcvf: detect and report max allowed vq size

2023-06-12 Thread Zhu Lingshan
Rather than a hardcode, this commit detects and reports the max value of allowed size of the virtqueues Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 31 +++ drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 4 +++- 3

[PATCH V2 0/3] vDPA/ifcvf: enable virtio-net on Intel F2000X-PL

2023-06-12 Thread Zhu Lingshan
improvements Zhu Lingshan (3): vDPA/ifcvf: dynamic allocate vq data stores vDPA/ifcvf: detect and report max allowed vq size vDPA/ifcvf: implement new accessors for vq_state drivers/vdpa/ifcvf/ifcvf_base.c | 55 +++-- drivers/vdpa/ifcvf/ifcvf_base.h | 29

[PATCH V2 1/3] vDPA/ifcvf: dynamic allocate vq data stores

2023-06-12 Thread Zhu Lingshan
This commit dynamically allocates the data stores for the virtqueues based on virtio_pci_common_cfg.num_queues. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 3 +++ drivers/vdpa/ifcvf/ifcvf_base.h | 2 +- drivers/vdpa/ifcvf/ifcvf_main.c | 2 ++ 3 files changed, 6 insertions

Re: [PATCH V2 1/3] vDPA/ifcvf: dynamic allocate vq data stores

2023-06-25 Thread Zhu, Lingshan
On 6/26/2023 10:49 AM, Jason Wang wrote: On Mon, Jun 26, 2023 at 10:38 AM Zhu, Lingshan wrote: On 6/26/2023 10:32 AM, Jason Wang wrote: On Mon, Jun 12, 2023 at 3:14 PM Zhu Lingshan wrote: This commit dynamically allocates the data stores for the virtqueues based

[PATCH] vp_vdpa: synchronize irq when free irq

2023-06-29 Thread Zhu Lingshan
This commits synchronizes irqs when free them Signed-off-by: Zhu Lingshan Tested-by: Cindy Lu --- drivers/vdpa/virtio_pci/vp_vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vdpa/virtio_pci/vp_vdpa.c b/drivers/vdpa/virtio_pci/vp_vdpa.c index 281287fae89f..d8ee3e68cd2d

Re: [PATCH] vp_vdpa: synchronize irq when free irq

2023-06-30 Thread Zhu, Lingshan
On 6/30/2023 4:02 PM, Jason Wang wrote: On Fri, Jun 30, 2023 at 10:37 AM Zhu Lingshan wrote: This commits synchronizes irqs when free them Need to explain why it is needed. Signed-off-by: Zhu Lingshan Tested-by: Cindy Lu --- drivers/vdpa/virtio_pci/vp_vdpa.c | 2 ++ 1 file changed, 2

Re: [PATCH] vp_vdpa: synchronize irq when free irq

2023-06-30 Thread Zhu, Lingshan
On 6/30/2023 4:34 PM, Michael S. Tsirkin wrote: On Fri, Jun 30, 2023 at 06:36:56PM +0800, Zhu Lingshan wrote: This commits synchronizes irqs when free them Signed-off-by: Zhu Lingshan Tested-by: Cindy Lu --- drivers/vdpa/virtio_pci/vp_vdpa.c | 2 ++ 1 file changed, 2 insertions

Re: [PATCH V2 1/3] vDPA/ifcvf: dynamic allocate vq data stores

2023-06-25 Thread Zhu, Lingshan
On 6/26/2023 10:32 AM, Jason Wang wrote: On Mon, Jun 12, 2023 at 3:14 PM Zhu Lingshan wrote: This commit dynamically allocates the data stores for the virtqueues based on virtio_pci_common_cfg.num_queues. While at it, it's better to allocate vring_lm_cfg as well and drop IFCVF_MAX_QUEUES

[PATCH V2 0/5] vDPA/ifcvf: implement immediate initialization mechanism

2023-05-08 Thread Zhu Lingshan
device status in devce_reset (Jason) 2)simplify the procedure which sycn irqs (Jason) 3)fix typos(Michael) Zhu Lingshan (5): vDPA/ifcvf: virt queue ops take immediate actions vDPA/ifcvf: get_driver_features from virtio registers vDPA/ifcvf: retire ifcvf_start_datapath and ifcvf_add_status

[PATCH V2 2/5] vDPA/ifcvf: get_driver_features from virtio registers

2023-05-08 Thread Zhu Lingshan
vDPA device features. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 38 + drivers/vdpa/ifcvf/ifcvf_base.h | 5 +++-- drivers/vdpa/ifcvf/ifcvf_main.c | 9 +--- 3 files changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/vdpa

  1   2   >