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

2021-04-18 Thread Zhu Lingshan
get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan Reviewed-by: Stefano Garzarella Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa

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

2021-04-18 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-block for vDPA. Signed-off-by: Zhu Lingshan Reviewed-by: Stefano Garzarella Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 8 +++- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 2 files changed, 25 insertions

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

2021-04-18 Thread 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 on the device ID. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 1

[PATCH V4 0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-blk

2021-04-18 Thread Zhu Lingshan
odern devices and transitional devices in modern mode.(Jason) (2)remove IFCVF_BLK_SUPPORTED_FEATURES, use hardware feature bits directly(Jason) (3)add error handling and message in get_config_size(Stefano) Thanks! Zhu Lingshan (3): vDPA/ifcvf: deduce VIRTIO device ID when probe vDPA/ifcvf: enabl

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

2021-04-16 Thread Zhu Lingshan
get_config_size() should return the size based on the decected device type. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c

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

2021-04-16 Thread 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 on the device ID. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 1

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

2021-04-16 Thread 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 | 8 +++- drivers/vdpa/ifcvf/ifcvf_main.c | 19 ++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifcvf

[PATCH V3 0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-blk

2021-04-16 Thread Zhu Lingshan
error handling and message in get_config_size(Stefano) Thanks! Zhu Lingshan (3): vDPA/ifcvf: deduce VIRTIO device ID when probe vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA vDPA/ifcvf: get_config_size should return dev specific config size drivers/vdpa/ifcvf/ifcvf_base.h

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

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

2021-04-15 Thread Zhu Lingshan
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, 17 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c

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

2021-04-15 Thread 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 | 8 +++- drivers/vdpa/ifcvf/ifcvf_main.c | 10 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifcvf

[PATCH V2 0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-blk

2021-04-15 Thread Zhu Lingshan
1)add comments to explain this driver drives virtio modern devices and transitional devices in modern mode.(Jason) (2)remove IFCVF_BLK_SUPPORTED_FEATURES, use hardware feature bits directly(Jason) (3)add error handling and message in get_config_size(Stefano) Thanks! Zhu Lingshan (3): vDPA/ifcvf: d

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

2021-04-15 Thread 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 on the device ID. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 1

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

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 2/3] vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA

2021-04-14 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-14 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 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 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 on the

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

2021-04-14 Thread 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 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/ifcvf

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

2021-04-14 Thread Zhu Lingshan
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 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index

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

2021-04-14 Thread 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 on the device ID. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 1

[PATCH 0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-blk

2021-04-14 Thread Zhu Lingshan
This series enabled Intel FGPA SmartNIC C5000X-PL virtio-blk for vDPA. This series requires: Stefano's vdpa block patchset: https://lkml.org/lkml/2021/3/15/2113 my patchset to enable Intel FGPA SmartNIC C5000X-PL virtio-net for vDPA: https://lkml.org/lkml/2021/3/17/432 Thanks! Zhu Lingsh

[PATCH V5 7/7] vDPA/ifcvf: deduce VIRTIO device ID from pdev ids

2021-03-17 Thread Zhu Lingshan
This commit deduces the VIRTIO device ID of a probed device from its pdev device ids. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 14 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf

[PATCH V5 6/7] vDPA/ifcvf: verify mandatory feature bits for vDPA

2021-03-17 Thread Zhu Lingshan
vDPA requres VIRTIO_F_ACCESS_PLATFORM as a must, this commit examines this when set features. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.c | 12 drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 3 files

[PATCH V5 5/7] vDPA/ifcvf: fetch device feature bits when probe

2021-03-17 Thread Zhu Lingshan
This commit would read and store device feature bits when probe. rename ifcvf_get_features() to ifcvf_get_hw_features(), it reads and stores features of the probed device. new ifcvf_get_features() simply returns stored feature bits. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang

[PATCH V5 4/7] vDPA/ifcvf: remove the version number string

2021-03-17 Thread Zhu Lingshan
This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan Reviewed-by: Leon Romanovsky Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa

[PATCH V5 3/7] vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids

2021-03-17 Thread Zhu Lingshan
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 Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 8 drivers/vdpa/ifcvf/ifcvf_main.c | 8 ---

[PATCH V5 0/7] vDPA/ifcvf: enables Intel C5000X-PL virtio-net

2021-03-17 Thread Zhu Lingshan
patches(Jason) Zhu Lingshan (7): vDPA/ifcvf: get_vendor_id returns a device specific vendor id vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids vDPA/ifcvf: remove the version number string vDPA/ifcvf: fetch device feature bits when

[PATCH V5 2/7] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

2021-03-17 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b

[PATCH V5 1/7] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-17 Thread Zhu Lingshan
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 Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa

[PATCH V4 7/7] vDPA/ifcvf: deduce VIRTIO device ID from pdev ids

2021-03-15 Thread Zhu Lingshan
This commit checks the device ids from pdev, then deduce VIRTIO device ID from the probed device. Here we checks all four device ids than only subsystem_device_id, help detecting a certain device for furture enabling. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 42

[PATCH V4 6/7] vDPA/ifcvf: verify mandatory feature bits for vDPA

2021-03-15 Thread Zhu Lingshan
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 | 12 drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 3 files changed, 18 insertions

[PATCH V4 4/7] vDPA/ifcvf: remove the version number string

2021-03-15 Thread Zhu Lingshan
This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan Reviewed-by: Leon Romanovsky --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c

[PATCH V4 3/7] vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids

2021-03-15 Thread Zhu Lingshan
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/ifcvf_base.h | 8 drivers/vdpa/ifcvf/ifcvf_main.c | 8 2 files changed, 8

[PATCH V4 5/7] vDPA/ifcvf: fetch device feature bits when probe

2021-03-15 Thread Zhu Lingshan
This commit would read and store device feature bits when probe. rename ifcvf_get_features() to ifcvf_get_hw_features(), it reads and stores features of the probed device. new ifcvf_get_features() simply returns stored feature bits. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf

[PATCH V4 0/7] vDPA/ifcvf: enables Intel C5000X-PL virtio-net

2021-03-15 Thread Zhu Lingshan
get_device_id(Jason) Changes from V2: verify VIRTIO_F_ACCESS_PLATFORM when set features(Jason) Changes from V1: remove version number string(Leon) add new device ids and remove original device ids in separate patches(Jason) Zhu Lingshan (7): vDPA/ifcvf: get_vendor_id returns a device specific vendor id

[PATCH V4 1/7] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-15 Thread Zhu Lingshan
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 changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b

[PATCH V4 2/7] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

2021-03-15 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf

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

2021-03-11 Thread Zhu, Lingshan
On 3/12/2021 3:00 PM, Jason Wang wrote: On 2021/3/12 2:40 下午, Zhu, Lingshan wrote: On 3/12/2021 1:52 PM, Jason Wang wrote: On 2021/3/11 3:19 下午, Zhu, Lingshan wrote: On 3/11/2021 2:20 PM, Jason Wang wrote: On 2021/3/11 12:16 下午, Zhu Lingshan wrote: On 3/11/2021 11:20 AM, Jason

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

2021-03-11 Thread Zhu, Lingshan
On 3/12/2021 1:52 PM, Jason Wang wrote: On 2021/3/11 3:19 下午, Zhu, Lingshan wrote: On 3/11/2021 2:20 PM, Jason Wang wrote: On 2021/3/11 12:16 下午, Zhu Lingshan wrote: On 3/11/2021 11:20 AM, Jason Wang wrote: On 2021/3/10 5:00 下午, Zhu Lingshan wrote: vDPA requres

Re: [PATCH 1/2] vhost-vdpa: fix use-after-free of v->config_ctx

2021-03-11 Thread Zhu, Lingshan
t_vdpa *v) { - if (v->config_ctx) + if (v->config_ctx) { eventfd_ctx_put(v->config_ctx); + v->config_ctx = NULL; + } } static long vhost_vdpa_set_config_call(struct vhost_vdpa *v, u32 __user *argp) Thanks Stefano! Reviewed-by: Zhu Lingshan

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 2:13 PM, Jason Wang wrote: On 2021/3/11 12:21 下午, Zhu Lingshan wrote: 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

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

2021-03-10 Thread Zhu, Lingshan
On 3/11/2021 2:20 PM, Jason Wang wrote: On 2021/3/11 12:16 下午, Zhu Lingshan wrote: 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

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 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 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

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

2021-03-10 Thread Zhu Lingshan
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 | 1 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 3 files changed, 14 insertions(+) diff

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

2021-03-10 Thread Zhu Lingshan
This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index fd5befc5cbcc..c34e1eec6b6c

[PATCH V3 5/6] vDPA/ifcvf: fetch device feature bits when probe

2021-03-10 Thread Zhu Lingshan
This commit would read and store device feature bits when probe. rename ifcvf_get_features() to ifcvf_get_hw_features(), it reads and stores features of the probed device. new ifcvf_get_features() simply returns stored feature bits. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf

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

2021-03-10 Thread Zhu Lingshan
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/ifcvf_base.h | 8 drivers/vdpa/ifcvf/ifcvf_main.c | 8 2 files changed, 8

[PATCH V3 2/6] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

2021-03-10 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf

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

2021-03-10 Thread Zhu Lingshan
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 changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b

[PATCH V3 0/6] vDPA/ifcvf: enables Intel C5000X-PL virtio-net

2021-03-10 Thread Zhu Lingshan
(Leon) add new device ids and remove original device ids in separate patches(Jason) Zhu Lingshan (6): vDPA/ifcvf: get_vendor_id returns a device specific vendor id vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids vDPA/ifcvf: remove

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

2021-03-08 Thread Zhu, Lingshan
On 3/9/2021 10:42 AM, Jason Wang wrote: On 2021/3/9 10:28 上午, Zhu, Lingshan wrote: On 3/9/2021 10:23 AM, Jason Wang wrote: On 2021/3/8 4:35 下午, Zhu Lingshan wrote: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan ---   drivers/vdpa

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

2021-03-08 Thread Zhu, Lingshan
On 3/9/2021 10:23 AM, Jason Wang wrote: On 2021/3/8 4:35 下午, Zhu Lingshan wrote: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan ---   drivers/vdpa/ifcvf/ifcvf_base.h | 5 +   drivers/vdpa/ifcvf/ifcvf_main.c | 5 +   2 files changed

[PATCH V2 4/4] vDPA/ifcvf: remove the version number string

2021-03-08 Thread Zhu Lingshan
This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b/drivers/vdpa/ifcvf/ifcvf_main.c index fd5befc5cbcc..c34e1eec6b6c

[PATCH V2 2/4] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

2021-03-08 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/vdpa/ifcvf/ifcvf_base.h b/drivers/vdpa/ifcvf

[PATCH V2 3/4] vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids

2021-03-08 Thread Zhu Lingshan
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/ifcvf_base.h | 8 drivers/vdpa/ifcvf/ifcvf_main.c | 8 2 files changed, 8

[PATCH V2 0/4] vDPA/ifcvf: enables Intel C5000X-PL virtio-net

2021-03-08 Thread Zhu Lingshan
This series enabled Intel FGPA SmartNIC C5000X-PL virtio-net for vDPA changes from V1: remove version number string(Leon) add new device ids and remove original device ids in separate patches(Jason) Zhu Lingshan (4): vDPA/ifcvf: get_vendor_id returns a device specific vendor id vDPA/ifcvf

[PATCH V2 1/4] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-08 Thread Zhu Lingshan
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 changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b

Re: [PATCH 3/3] vDPA/ifcvf: bump version string to 1.0

2021-03-07 Thread Zhu, Lingshan
Hi Leon, Thanks for point this out, will send a V2 patchset delete it. Thanks Zhu Lingshan On 3/7/2021 5:01 PM, Leon Romanovsky wrote: On Fri, Mar 05, 2021 at 10:20:00PM +0800, Zhu Lingshan wrote: This commit bumps ifcvf driver version string to 1.0 Signed-off-by: Zhu Lingshan

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

2021-03-05 Thread Zhu Lingshan
This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA. C5000X-PL vendor id 0x1AF4, device id 0x1000, subvendor id 0x8086, sub device id 0x0001 To distinguish C5000X-PL from other ifcvf driven devices, the original ifcvf device is named "N3000". Signed-off-by: Zh

[PATCH 3/3] vDPA/ifcvf: bump version string to 1.0

2021-03-05 Thread Zhu Lingshan
This commit bumps ifcvf driver version string to 1.0 Signed-off-by: Zhu Lingshan --- 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 fd5befc5cbcc..56a0974cf93c 100644

[PATCH 1/3] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-05 Thread Zhu Lingshan
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 changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/ifcvf/ifcvf_main.c b

[PATCH 0/3] vDPA/ifcvf: enables Intel C5000X-PL virtio-net

2021-03-05 Thread Zhu Lingshan
This series enabled Intel FGPA SmartNIC C5000X-PL virtio-net for vDPA Zhu Lingshan (3): vDPA/ifcvf: get_vendor_id returns a device specific vendor id vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA vDPA/ifcvf: bump version string to 1.0 drivers/vdpa/ifcvf/ifcvf_base.h | 13

[PATCH] vdpa: handle irq bypass register failure case

2020-10-23 Thread Zhu Lingshan
r producer fail, in this case, vqs still remain functional. Signed-off-by: Zhu Lingshan Reported-by: kernel test robot --- drivers/vhost/vdpa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index 62a9bb0efc55..d6b2c3bd1b01 100644 --- a/dri

[PATCH] vhost_vdpa: remove unnecessary spin_lock in vhost_vring_call

2020-09-08 Thread Zhu Lingshan
This commit removed unnecessary spin_locks in vhost_vring_call and related operations. Because we manipulate irq offloading contents in vhost_vdpa ioctl code path which is already protected by dev mutex and vq mutex. Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 8 +--- drivers

[PATCH] vhost: new vhost_vdpa SET/GET_BACKEND_FEATURES handlers

2020-09-08 Thread Zhu Lingshan
wrap of vhost_set_backend_features() with necessary mutex lockings. Signed-off-by: Zhu Lingshan --- drivers/vhost/net.c | 9 - drivers/vhost/vdpa.c | 47 ++- drivers/vhost/vhost.c | 2 -- 3 files changed, 41 insertions(+), 17 deletions

[PATCH 2/2] vhost_net: introduce vhost_net_set_backend_features()

2020-09-07 Thread Zhu Lingshan
This commit introduced a new function vhost_net_set_backend_features() which is a wrap of vhost_set_backend_features() with necessary mutex lockings. Signed-off-by: Zhu Lingshan --- drivers/vhost/net.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/vhost

[PATCH 1/2] vhost: remove mutex ops in vhost_set_backend_features

2020-09-07 Thread Zhu Lingshan
commit will add needed mutex lock/unlock operations in a new function vhost_net_set_backend_features() which is a wrap of vhost_set_backend_features(). Signed-off-by: Zhu Lingshan --- drivers/vhost/vhost.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost

[PATCH 0/2] fix dead lock issues in vhost_vdpa

2020-09-07 Thread Zhu Lingshan
, a new function vhost_net_set_backend_features() in vhost_net is introduced to do proper mutex locking and call vhost_set_backend_features() Please help review. Thanks! Zhu Lingshan (2): vhost: remove mutex ops in vhost_set_backend_features vhost_net: introduce vhost_net_set_backend_features

[PATCH 1/2] vDPA: get_vq_irq() should be optional

2020-08-05 Thread Zhu Lingshan
get_vq_irq() should be optional, it's required when we need to setup irq offloading, otherwise it‘s OK to be NULL. Signed-off-by: Zhu Lingshan --- include/linux/vdpa.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h

[PATCH 2/2] vhost_vdpa: unified set_vq_irq() and update_vq_irq()

2020-08-05 Thread Zhu Lingshan
This commit merge vhost_vdpa_update_vq_irq() logics into vhost_vdpa_setup_vq_irq(), so that code are unified. In vhost_vdpa_setup_vq_irq(), added checks for the existence for get_vq_irq(). Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 28 ++-- 1 file changed, 6

Re: [PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-08-05 Thread Zhu, Lingshan
On 8/5/2020 4:06 PM, Jason Wang wrote: On 2020/7/31 下午2:55, Zhu Lingshan wrote: +static void vhost_vdpa_setup_vq_irq(struct vhost_vdpa *v, u16 qid) +{ +    struct vhost_virtqueue *vq = &v->vqs[qid]; +    const struct vdpa_config_ops *ops = v->vdpa->config; +    struct vdpa_dev

[PATCH] vDPA: dont change vq irq after DRIVER_OK

2020-08-04 Thread Zhu Lingshan
IRQ of a vq is not expected to be changed in a DRIVER_OK ~ !DRIVER_OK period for irq offloading purposes. Place this comment at the side of bus ops get_vq_irq than in set_status in vhost_vdpa. Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 1 - include/linux/vdpa.h | 1 + 2 files

[PATCH] vDPA: dont change vq irq after DRIVER_OK

2020-08-04 Thread Zhu Lingshan
IRQ of a vq is not expected to be changed in a DRIVER_OK ~ !DRIVER_OK period for irq offloading purposes. Place this comment at the side of bus ops get_vq_irq than in set_status in vhost_vdpa. Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 1 - include/linux/vdpa.h | 1 + 2 files

[PATCH V5 3/6] vDPA: add get_vq_irq() in vdpa_config_ops

2020-07-31 Thread Zhu Lingshan
This commit adds a new function get_vq_irq() in struct vdpa_config_ops, which will return the irq number of a virtqueue. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- include/linux/vdpa.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux

[PATCH V5 5/6] ifcvf: implement vdpa_config_ops.get_vq_irq()

2020-07-31 Thread Zhu Lingshan
This commit implemented vdpa_config_ops.get_vq_irq() in ifcvf, and initialized vq irq to -EINVAL. So that ifcvf can report irq number of a vq, or -EINVAL if the vq is not assigned an irq number. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 18

[PATCH V5 6/6] irqbypass: do not start cons/prod when failed connect

2020-07-31 Thread Zhu Lingshan
If failed to connect, there is no need to start consumer nor producer. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- virt/lib/irqbypass.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c index

[PATCH V5 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-31 Thread Zhu Lingshan
through SET_VRING_CALL. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/Kconfig | 1 + drivers/vhost/vdpa.c | 79 ++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index

[PATCH V5 2/6] kvm: detect assigned device via irqbypass manager

2020-07-31 Thread Zhu Lingshan
detected in update_pi_irte() We will increase/decrease the assigned device counter in kvm/x86. Both vDPA and VFIO would go through this code path. Only X86 uses these counters and kvm_arch_start/end_assignment(), so this code path only affect x86 for now. Signed-off-by: Zhu Lingshan Suggested-by

[PATCH V5 0/6] IRQ offloading for vDPA

2020-07-31 Thread Zhu Lingshan
ied vhost_vdpa_updat Zhu Lingshan (6): vhost: introduce vhost_vring_call kvm: detect assigned device via irqbypass manager vDPA: add get_vq_irq() in vdpa_config_ops vhost_vdpa: implement IRQ offloading in vhost_vdpa ifcvf: implement vdpa_config_ops.get_vq_irq() irqbypass: do not start cons/prod w

[PATCH V5 1/6] vhost: introduce vhost_vring_call

2020-07-30 Thread 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 a spin lock and an irq_bypass_producer in its structure. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/vdpa.c

[PATCH V4 1/6] vhost: introduce vhost_vring_call

2020-07-27 Thread 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 a spin lock and an irq_bypass_producer in its structure. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/vdpa.c

[PATCH V4 6/6] irqbypass: do not start cons/prod when failed connect

2020-07-27 Thread Zhu Lingshan
If failed to connect, there is no need to start consumer nor producer. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- virt/lib/irqbypass.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c index

[PATCH V4 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-27 Thread Zhu Lingshan
through SET_VRING_CALL. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vhost/Kconfig | 1 + drivers/vhost/vdpa.c | 79 ++- 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index

[PATCH V4 5/6] ifcvf: implement vdpa_config_ops.get_vq_irq()

2020-07-27 Thread Zhu Lingshan
This commit implemented vdpa_config_ops.get_vq_irq() in ifcvf, and initialized vq irq to -EINVAL. So that ifcvf can report irq number of a vq, or -EINVAL if the vq is not assigned an irq number. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 18

[PATCH V4 0/6] IRQ offloading for vDPA

2020-07-27 Thread Zhu Lingshan
vhost_vdpa_release(). This is safe for control vq. (7) minor improvements changes from V1: (1)dropped vfio changes. (3)removed KVM_HVAE_IRQ_BYPASS checks (4)locking fixes (5)simplified vhost_vdpa_updat Zhu Lingshan (6): vhost: introduce vhost_vring_call kvm: detect assigned device via irqbypass

[PATCH V4 2/6] kvm: detect assigned device via irqbypass manager

2020-07-27 Thread Zhu Lingshan
detected in update_pi_irte() We will increase/decrease the assigned device counter in kvm/x86. Both vDPA and VFIO would go through this code path. Only X86 uses these counters and kvm_arch_start/end_assignment(), so this code path only affect x86 for now. Signed-off-by: Zhu Lingshan Suggested-by

[PATCH V4 3/6] vDPA: add get_vq_irq() in vdpa_config_ops

2020-07-27 Thread Zhu Lingshan
This commit adds a new function get_vq_irq() in struct vdpa_config_ops, which will return the irq number of a virtqueue. Signed-off-by: Zhu Lingshan Suggested-by: Jason Wang --- include/linux/vdpa.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux

[PATCH V3 6/6] irqbypass: do not start cons/prod when failed connect

2020-07-22 Thread Zhu Lingshan
If failed to connect, there is no need to start consumer nor producer. Signed-off-by: Zhu Lingshan --- virt/lib/irqbypass.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/virt/lib/irqbypass.c b/virt/lib/irqbypass.c index 28fda42e471b..c9bb3957f58a 100644

[PATCH V3 5/6] ifcvf: replace irq_request/free with vDPA helpers

2020-07-22 Thread Zhu Lingshan
This commit replaced irq_request/free() with vDPA helpers vdpa_devm_request/free_irq() so that it can request/free irq and setup irq offloading on order. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_main.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff

[PATCH V3 0/6] IRQ offloading for vDPA

2020-07-22 Thread Zhu Lingshan
KVM_HVAE_IRQ_BYPASS checks (4)locking fixes (5)simplified vhost_vdpa_updat Zhu Lingshan (6): vhost: introduce vhost_vring_call kvm: detect assigned device via irqbypass manager vDPA: implement vq IRQ allocate/free helpers in vDPA core vhost_vdpa: implement IRQ offloading in vhost_vdpa ifcvf

[PATCH V3 4/6] vhost_vdpa: implement IRQ offloading in vhost_vdpa

2020-07-22 Thread Zhu Lingshan
This patch introduce a set of functions for setup/unsetup and update irq offloading respectively by register/unregister and re-register the irq_bypass_producer. Signed-off-by: Zhu Lingshan --- drivers/vhost/Kconfig | 1 + drivers/vhost/vdpa.c | 66

[PATCH V3 2/6] kvm: detect assigned device via irqbypass manager

2020-07-22 Thread Zhu Lingshan
detected in update_pi_irte() We will increase/decrease the assigned device counter in kvm/x86. Both vDPA and VFIO would go through this code path. Only X86 uses these counters and kvm_arch_start/end_assignment(), so this code path only affect x86 for now. Signed-off-by: Zhu Lingshan --- arch/x86

[PATCH V3 3/6] vDPA: implement vq IRQ allocate/free helpers in vDPA core

2020-07-22 Thread Zhu Lingshan
helpers. Signed-off-by: Zhu Lingshan --- drivers/vdpa/vdpa.c | 49 include/linux/vdpa.h | 13 2 files changed, 62 insertions(+) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index de211ef3738c..4dfc86eba0f6 100644 --- a/drivers/vdpa

[PATCH V3 1/6] vhost: introduce vhost_vring_call

2020-07-22 Thread 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 a spin lock and an irq_bypass_producer in its structure. Signed-off-by: Zhu Lingshan --- drivers/vhost/vdpa.c | 4 ++-- drivers/vhost

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 a

  1   2   >