[PATCH 1/6] vdpa: fix improper error message when adding vdpa dev

2023-01-30 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported. kernel answers: Operation not supported $ vdpa dev add mgmtdev vdpasim_net name vdpasim0 max_vqp 2 Error: vdpa: All provided attributes are not supported. kernel answers: Operation not supported Signed-off-by:

[PATCH 5/6] vdpa: validate device feature provisioning against supported class

2023-01-30 Thread Si-Wei Liu
ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 51 ++- 1 file changed, 42 insertions(+), 9

[PATCH 6/6] vdpa/mlx5: support device features provisioning

2023-01-30 Thread Si-Wei Liu
vDPA device with a subset of parent features # vdpa dev add name vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 72

Re: [PATCH v3 0/4] vDPA: initial config export via "vdpa dev show"

2023-01-30 Thread Si-Wei Liu
On 1/30/2023 1:05 PM, Si-Wei Liu wrote: Apologies, I was over booked for multiple things in parallel, and there had been urgent internal priorities popped up at times for the past few weeks. On the other hand, there were brokenness or incompleteness identified around features provisioning

Re: [PATCH 1/6] vdpa: fix improper error message when adding vdpa dev

2023-01-31 Thread Si-Wei Liu
On 1/31/2023 3:42 AM, Eli Cohen wrote: On 30/01/2023 22:30, Si-Wei Liu wrote: In below example, before the fix, mtu attribute is supported by the parent mgmtdev, but the error message showing "All provided are not supported" is just misleading. $ vdpa mgmtdev show v

Re: [PATCH 6/6] vdpa/mlx5: support device features provisioning

2023-01-31 Thread Si-Wei Liu
On 1/31/2023 4:56 AM, Eli Cohen wrote: On 30/01/2023 22:30, Si-Wei Liu wrote: This patch implements features provisioning for mlx5_vdpa. 1) Validate the provisioned features are a subset of the parent     features. 2) Clearing features that are not wanted by userspace. 3) Set config space

[PATCH 0/6] features provisioning fixes and mlx5_vdpa support

2023-01-31 Thread Si-Wei Liu
er to formalize migration compatibility support at the driver level. Thanks, -Siwei [1] [PATCH v3 0/4] vDPA: initial config export via "vdpa dev show" https://lore.kernel.org/virtualization/1666392237-4042-1-git-send-email-si-wei@oracle.com/ --- Si-Wei Liu (6): vdpa: fix improper err

[PATCH 3/6] vdpa: validate provisioned device features against specified attribute

2023-01-31 Thread Si-Wei Liu
e_features without providing a corresponding @mac attribute, in which case the vdpa vendor driver could load certain default value for attribute that is not explicitly specified. Generalize this check in vdpa core so that there's no duplicate code in each vendor driver. Signed-off-by: Si-Wei

[PATCH 2/6] vdpa: conditionally read STATUS in config space

2023-01-31 Thread Si-Wei Liu
The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 20 +++- 1 file changed, 15 insertions

[PATCH 1/6] vdpa: fix improper error message when adding vdpa dev

2023-01-31 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported. kernel answers: Operation not supported $ vdpa dev add mgmtdev vdpasim_net name vdpasim0 max_vqp 2 Error: vdpa: All provided attributes are not supported. kernel answers: Operation not supported Signed-off-by:

[PATCH 6/6] vdpa/mlx5: support device features provisioning

2023-01-31 Thread Si-Wei Liu
vDPA device with a subset of parent features # vdpa dev add name vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 72

[PATCH 4/6] virtio: VIRTIO_DEVICE_F_MASK for all per-device features

2023-01-31 Thread Si-Wei Liu
Introduce VIRTIO_DEVICE_F_MASK bitmask used for identification of per-device features. Feature bits VIRTIO_TRANSPORT_F_START through VIRTIO_TRANSPORT_F_END are reserved for transport features hence are not counted as per-device features against the 64bit feature space. Signed-off-by: Si-Wei Liu

[PATCH 5/6] vdpa: validate device feature provisioning against supported class

2023-01-31 Thread Si-Wei Liu
ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 51 ++- 1 file changed, 42 insertions(+), 9

[PATCH v2 0/7] features provisioning fixes and mlx5_vdpa support

2023-01-31 Thread Si-Wei Liu
bute info to error message - move conditional feature presence in mlx5_vdpa config space to a separate patch - remove redundant check --- Si-Wei Liu (7): vdpa: fix improper error message when adding vdpa dev vdpa: conditionally read STATUS in config space vdpa: validate provisioned devic

[PATCH v2 5/7] vdpa: validate device feature provisioning against supported class

2023-01-31 Thread Si-Wei Liu
ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 51 ++- 1 file changed, 42 insertions(+), 9

[PATCH v2 7/7] vdpa/mlx5: support device features provisioning

2023-01-31 Thread Si-Wei Liu
vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 49 ++- 1 file changed, 43 insertions

[PATCH v2 1/7] vdpa: fix improper error message when adding vdpa dev

2023-01-31 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported: 0x1000. kernel answers: Operation not supported Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vd

[PATCH v2 4/7] virtio: VIRTIO_DEVICE_F_MASK for all per-device features

2023-01-31 Thread Si-Wei Liu
Introduce VIRTIO_DEVICE_F_MASK bitmask used for identification of per-device features. Feature bits VIRTIO_TRANSPORT_F_START through VIRTIO_TRANSPORT_F_END are reserved for transport features hence are not counted as per-device features against the 64bit feature space. Signed-off-by: Si-Wei Liu

[PATCH v2 6/7] vdpa/mlx5: conditionally show MTU and STATUS in config space

2023-01-31 Thread Si-Wei Liu
The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only show MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 22 ++ 1 file

[PATCH v2 2/7] vdpa: conditionally read STATUS in config space

2023-01-31 Thread Si-Wei Liu
The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 20 +++- 1 file changed, 15 insertions

[PATCH v2 3/7] vdpa: validate provisioned device features against specified attribute

2023-01-31 Thread Si-Wei Liu
e_features without providing a corresponding @mac attribute, in which case the vdpa vendor driver could load certain default value for attribute that is not explicitly specified. Generalize this check in vdpa core so that there's no duplicate code in each vendor driver. Signed-off-by: Si-Wei

Re: [PATCH 0/6] features provisioning fixes and mlx5_vdpa support

2023-01-31 Thread Si-Wei Liu
Please disregard this series for v1, please refer to the v2 at: Message-ID: 1675207345-22328-1-git-send-email-si-wei@oracle.com Apologies I accidentally got v1 resent at the same time when v2 was sent. -Siwei On 1/31/2023 3:22 PM, Si-Wei Liu wrote: You are currently receiving this

Re: [PATCH v2 3/7] vdpa: validate provisioned device features against specified attribute

2023-02-02 Thread Si-Wei Liu
On 2/1/2023 9:05 PM, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, January 31, 2023 6:22 PM With device feature provisioning, there's a chance for misconfiguration that the vdpa feature attribute supplied in 'vdpa dev add' command doesn't get selected on the d

Re: [PATCH v2 4/7] virtio: VIRTIO_DEVICE_F_MASK for all per-device features

2023-02-02 Thread Si-Wei Liu

Re: [PATCH 0/6] features provisioning fixes and mlx5_vdpa support

2023-02-02 Thread Si-Wei Liu
On 2/2/2023 9:30 AM, Michael S. Tsirkin wrote: On Tue, Jan 31, 2023 at 03:22:01PM -0800, Si-Wei Liu wrote: This patchset is pre-requisite to export and provision device config attributes and features for vdpa live migration, in a way backward and forward compatibility can be retained. The

Re: [PATCH v2 6/7] vdpa/mlx5: conditionally show MTU and STATUS in config space

2023-02-02 Thread Si-Wei Liu
On 2/2/2023 5:31 AM, Eli Cohen wrote: On 01/02/2023 1:22, Si-Wei Liu wrote: The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only show MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si

[PATCH v3 0/6] features provisioning fixes and mlx5_vdpa support

2023-02-02 Thread Si-Wei Liu
local variable in future patch - prohibit per-device bitmask macro from exposure in uapi header - add fixes tag v1 -> v2: - include specific attribute info to error message - move conditional feature presence in mlx5_vdpa config space to a separate patch - remove redundant che

[PATCH v3 3/6] vdpa: validate provisioned device features against specified attribute

2023-02-02 Thread Si-Wei Liu
e_features without providing a corresponding @mac attribute, in which case the vdpa vendor driver could load certain default value for attribute that is not explicitly specified. Generalize this check in vdpa core so that there's no duplicate code in each vendor driver. Signed-off-by: Si-Wei

[PATCH v3 1/6] vdpa: fix improper error message when adding vdpa dev

2023-02-02 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported: 0x1000. kernel answers: Operation not supported Fixes: d8ca2fa5be1b ("vdpa: Enable user to set mac and mtu of vdpa device") Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit Reviewed-by: Eli Cohe

[PATCH v3 2/6] vdpa: conditionally read STATUS in config space

2023-02-02 Thread Si-Wei Liu
The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit --- drivers/vdpa/vdpa.c | 20 +++- 1 file

[PATCH v3 6/6] vdpa/mlx5: support device features provisioning

2023-02-02 Thread Si-Wei Liu
vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 53 +-- 1 file changed, 45 insertions

[PATCH v3 4/6] vdpa: validate device feature provisioning against supported class

2023-02-02 Thread Si-Wei Liu
ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 61 + 1 file changed, 52 insertions(+), 9

[PATCH v3 5/6] vdpa/mlx5: conditionally show MTU and STATUS in config space

2023-02-02 Thread Si-Wei Liu
The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only show MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 22 ++ 1 file

Re: [PATCH v2 5/7] vdpa: validate device feature provisioning against supported class

2023-02-03 Thread Si-Wei Liu
On 2/3/2023 12:09 AM, Michael S. Tsirkin wrote: On Tue, Jan 31, 2023 at 03:22:23PM -0800, Si-Wei Liu wrote: Today when device features are explicitly provisioned, the features user supplied may contain device class specific features that are not supported by the parent managment device. On

Re: [PATCH v2 6/7] vdpa/mlx5: conditionally show MTU and STATUS in config space

2023-02-03 Thread Si-Wei Liu
On 2/3/2023 12:14 AM, Michael S. Tsirkin wrote: On Tue, Jan 31, 2023 at 03:22:24PM -0800, Si-Wei Liu wrote: The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only show MTU and STATUS conditionally depending on the

Re: [PATCH v3 5/6] vdpa/mlx5: conditionally show MTU and STATUS in config space

2023-02-05 Thread Si-Wei Liu
On 2/5/2023 1:36 AM, Eli Cohen wrote: On 03/02/2023 7:02, Si-Wei Liu wrote: The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only show MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si

Re: [PATCH v3 2/6] vdpa: conditionally read STATUS in config space

2023-02-05 Thread Si-Wei Liu
On 2/5/2023 12:26 AM, Eli Cohen wrote: On 03/02/2023 7:01, Si-Wei Liu wrote: The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu

[PATCH v3 5/6] vdpa/mlx5: make MTU/STATUS presence conditional on feature bits

2023-02-06 Thread Si-Wei Liu
The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only present MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 22

[PATCH v3 6/6] vdpa/mlx5: support device features provisioning

2023-02-06 Thread Si-Wei Liu
vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 53 +-- 1 file

[PATCH v3 1/6] vdpa: fix improper error message when adding vdpa dev

2023-02-06 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported: 0x1000. kernel answers: Operation not supported Fixes: d8ca2fa5be1b ("vdpa: Enable user to set mac and mtu of vdpa device") Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit Reviewed-by: Eli Cohe

[PATCH v3 3/6] vdpa: validate provisioned device features against specified attribute

2023-02-06 Thread Si-Wei Liu
e_features without providing a corresponding @mac attribute, in which case the vdpa vendor driver could load certain default value for attribute that is not explicitly specified. Generalize this check in vdpa core so that there's no duplicate code in each vendor driver. Signed-off-by: Si-Wei Liu R

[PATCH v4 0/6] features provisioning fixes and mlx5_vdpa support

2023-02-06 Thread Si-Wei Liu
- move conditional feature presence in mlx5_vdpa config space to a separate patch - remove redundant check --- Si-Wei Liu (6): vdpa: fix improper error message when adding vdpa dev vdpa: conditionally read STATUS in config space vdpa: validate provisioned device features against specifi

[PATCH v3 2/6] vdpa: conditionally read STATUS in config space

2023-02-06 Thread Si-Wei Liu
The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit Reviewed-by: Eli Cohen --- drivers/vdpa/vdpa.c | 20

[PATCH v3 4/6] vdpa: validate device feature provisioning against supported class

2023-02-06 Thread Si-Wei Liu
be ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 59 + 1 file changed, 50 insertions(+), 9

[PATCH RESENT v4 0/6] features provisioning fixes and mlx5_vdpa support

2023-02-06 Thread Si-Wei Liu
- move conditional feature presence in mlx5_vdpa config space to a separate patch - remove redundant check --- Si-Wei Liu (6): vdpa: fix improper error message when adding vdpa dev vdpa: conditionally read STATUS in config space vdpa: validate provisioned device features against specifi

[PATCH RESENT v4 1/6] vdpa: fix improper error message when adding vdpa dev

2023-02-06 Thread Si-Wei Liu
e vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported: 0x1000. kernel answers: Operation not supported Fixes: d8ca2fa5be1b ("vdpa: Enable user to set mac and mtu of vdpa device") Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit Reviewed-by: Eli Cohe

[PATCH RESENT v4 6/6] vdpa/mlx5: support device features provisioning

2023-02-06 Thread Si-Wei Liu
vdpa1 mgmtdev pci/:41:04.2 device_features 0x30002 # vdpa dev config show vdpa1: negotiated_features CTRL_VQ VERSION_1 ACCESS_PLATFORM Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 53 +-- 1 file

[PATCH RESENT v4 2/6] vdpa: conditionally read STATUS in config space

2023-02-06 Thread Si-Wei Liu
The spec says: status only exists if VIRTIO_NET_F_STATUS is set Similar to MAC and MTU, vdpa_dev_net_config_fill() should read STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu Reviewed-by: Parav Pandit Reviewed-by: Eli Cohen --- drivers/vdpa/vdpa.c | 20

[PATCH RESENT v4 5/6] vdpa/mlx5: make MTU/STATUS presence conditional on feature bits

2023-02-06 Thread Si-Wei Liu
The spec says: mtu only exists if VIRTIO_NET_F_MTU is set status only exists if VIRTIO_NET_F_STATUS is set We should only present MTU and STATUS conditionally depending on the feature bits. Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 22

[PATCH RESENT v4 3/6] vdpa: validate provisioned device features against specified attribute

2023-02-06 Thread Si-Wei Liu
e_features without providing a corresponding @mac attribute, in which case the vdpa vendor driver could load certain default value for attribute that is not explicitly specified. Generalize this check in vdpa core so that there's no duplicate code in each vendor driver. Signed-off-by: Si-Wei Liu R

[PATCH RESENT v4 4/6] vdpa: validate device feature provisioning against supported class

2023-02-06 Thread Si-Wei Liu
be ambiguous if none of the class specific attributes is provided at the same time. Validate these cases and prompt appropriate user errors accordingly. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 59 + 1 file changed, 50 insertions(+), 9

Re: [PATCH v4 0/6] features provisioning fixes and mlx5_vdpa support

2023-02-06 Thread Si-Wei Liu
Apologies folks. Please ignore the patches posted with an incorrect "[PATCH v3 ...]" subject in this thread. I've resent the patch with subject line corrected: Message-Id: 1675725124-7375-1-git-send-email-si-wei@oracle.com Sorry again, -Siwei On 2/6/2023 3:07 PM, Si-Wei L

[PATCH] vdpa/mlx5: should not activate virtq object when suspended

2023-02-10 Thread Si-Wei Liu
warning message to tell apart which object is responsible for the CREATE_GENERAL_OBJECT command failure. Fixes: cae15c2ed8e6 ("vdpa/mlx5: Implement susupend virtqueue callback") Cc: Eli Cohen Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 17 ++--- 1 file c

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup functions. Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- net/vhost-vdpa.c | 99 +

Re: [PATCH v2 09/13] vdpa net: block migration if the device has CVQ

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Devices with CVQ needs to migrate state beyond vq state. Leaving this to future series. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index bca13f97f

Re: [PATCH v2 07/13] vdpa: add vdpa net migration state notifier

2023-02-12 Thread Si-Wei Liu
On 2/8/2023 1:42 AM, Eugenio Pérez wrote: This allows net to restart the device backend to configure SVQ on it. Ideally, these changes should not be net specific. However, the vdpa net backend is the one with enough knowledge to configure everything because of some reasons: * Queues might need

Re: [PATCH] vdpa/mlx5: should not activate virtq object when suspended

2023-02-13 Thread Si-Wei Liu
+ Eugenio On 2/11/2023 10:55 PM, Eli Cohen wrote: On 11/02/2023 8:08, Si-Wei Liu wrote: Otherwise the virtqueue object to instate could point to invalid address that was unmapped from the MTT:    mlx5_core :41:04.2: mlx5_cmd_out_err:782:(pid 8321):    CREATE_GENERAL_OBJECT(0xa00) op_mod

[PATCH v2] vdpa/mlx5: should not activate virtq object when suspended

2023-02-13 Thread Si-Wei Liu
("vdpa/mlx5: Implement susupend virtqueue callback") Cc: Eli Cohen Signed-off-by: Si-Wei Liu --- v2: removed the change for improving warning message --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/net/mlx5

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-13 Thread Si-Wei Liu
On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM Si-Wei Liu wrote: On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is needed. The cleanup keeps being responsible of last VQ but this change allows it to merge both cleanup

Re: [PATCH v2] vdpa/mlx5: should not activate virtq object when suspended

2023-02-14 Thread Si-Wei Liu
On 2/13/2023 10:20 PM, Jason Wang wrote: On Tue, Feb 14, 2023 at 6:48 AM Si-Wei Liu wrote: Otherwise the virtqueue object to instate could point to invalid address that was unmapped from the MTT: mlx5_core :41:04.2: mlx5_cmd_out_err:782:(pid 8321): CREATE_GENERAL_OBJECT(0xa00

[PATCH v3] vdpa/mlx5: should not activate virtq object when suspended

2023-02-14 Thread Si-Wei Liu
("vdpa/mlx5: Implement susupend virtqueue callback") Cc: Eli Cohen Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- v3: move suspended to struct mlx5_vdpa_dev v2: removed the change for improving warning message --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 + drivers/vdpa/mlx5/net/m

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-15 Thread Si-Wei Liu
On 2/14/2023 11:07 AM, Eugenio Perez Martin wrote: On Tue, Feb 14, 2023 at 2:45 AM Si-Wei Liu wrote: On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM Si-Wei Liu wrote: On 2/8/2023 1:42 AM, Eugenio Pérez wrote: Only create iova_tree if and when it is

Re: [PATCH v3] vdpa/mlx5: should not activate virtq object when suspended

2023-02-15 Thread Si-Wei Liu
On 2/15/2023 8:48 PM, Jason Wang wrote: On Wed, Feb 15, 2023 at 9:31 AM Si-Wei Liu wrote: Otherwise the virtqueue object to instate could point to invalid address that was unmapped from the MTT: mlx5_core :41:04.2: mlx5_cmd_out_err:782:(pid 8321): CREATE_GENERAL_OBJECT(0xa00

Re: [PATCH v2 01/13] vdpa net: move iova tree creation from init to start

2023-02-16 Thread Si-Wei Liu
On 2/15/2023 11:35 PM, Eugenio Perez Martin wrote: On Thu, Feb 16, 2023 at 3:15 AM Si-Wei Liu wrote: On 2/14/2023 11:07 AM, Eugenio Perez Martin wrote: On Tue, Feb 14, 2023 at 2:45 AM Si-Wei Liu wrote: On 2/13/2023 3:14 AM, Eugenio Perez Martin wrote: On Mon, Feb 13, 2023 at 7:51 AM

Re: [PATCH v4 07/15] vdpa: add vhost_vdpa_suspend

2023-02-28 Thread Si-Wei Liu
On 2/24/2023 7:54 AM, Eugenio Pérez wrote: The function vhost.c:vhost_dev_stop fetches the vring base so the vq state can be migrated to other devices. However, this is unreliable in vdpa, since we didn't signal the device to suspend the queues, making the value fetched useless. Suspend the d

Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-13 Thread Si-Wei Liu
On 3/13/2023 2:23 PM, Michael S. Tsirkin wrote: On Mon, Mar 13, 2023 at 09:14:38PM +, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Sunday, March 12, 2023 12:24 PM On Sun, Mar 12, 2023 at 01:28:06PM +, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Sunday, March 12, 2

Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-13 Thread Si-Wei Liu
On 3/12/2023 6:28 AM, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Sunday, March 12, 2023 6:25 AM On Sun, Mar 12, 2023 at 11:10:25AM +0200, Eli Cohen wrote: On 12/03/2023 10:58, Michael S. Tsirkin wrote: On Sun, Mar 12, 2023 at 10:39:19AM +0200, Eli Cohen wrote: One can still enab

Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-14 Thread Si-Wei Liu
On 3/13/2023 8:47 PM, Parav Pandit wrote: From: Michael S. Tsirkin Sent: Monday, March 13, 2023 11:38 PM On Tue, Mar 14, 2023 at 02:05:50AM +, Parav Pandit wrote: From: Si-Wei Liu Sent: Monday, March 13, 2023 6:19 PM Actually there's no such burden or requirement to maintain bac

Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-14 Thread Si-Wei Liu
On 3/14/2023 7:09 PM, Parav Pandit wrote: From: Si-Wei Liu Sent: Tuesday, March 14, 2023 3:29 PM If user supplied feature bits and device doesn’t support some of the feature bits -> add command fails. If user supplied feature bits, than use only the feature bits. Do not OR user suppl

Re: [PATCH v2 1/2] vdpa/mlx5: Extend driver support for new features

2023-03-20 Thread Si-Wei Liu
On 3/19/2023 11:44 PM, Jason Wang wrote: On Fri, Mar 17, 2023 at 9:58 PM Parav Pandit wrote: From: Eli Cohen Sent: Wednesday, March 15, 2023 3:28 AM Extend the possible list for features that can be supported by firmware. Note that different versions of firmware may or may not support th

Re: [PATCH v3 1/2] vdpa/mlx5: Extend driver support for new features

2023-03-20 Thread Si-Wei Liu
_VIRTIO_NET_F_GUEST_TSO6)) + result += BIT_ULL(VIRTIO_NET_F_GUEST_TSO6); + if (dev_features & BIT_ULL(MLX5_VIRTIO_NET_F_GUEST_TSO4)) + result += BIT_ULL(VIRTIO_NET_F_GUEST_TSO4); It would be more consistent to use OR rather than ADD. With that, Reviewed-by:

Re: [PATCH v4 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default

2023-03-21 Thread Si-Wei Liu
default. One can still enable it when creating the vdpa device using vdpa tool by providing features that include it. For example: $ vdpa dev add name vdpa0 mgmtdev pci/:86:00.2 device_features 0x300cb982b Acked-by: Jason Wang Signed-off-by: Eli Cohen Looks good to me. Reviewed-by: Si-Wei Liu

Re: [PATCH v3 1/2] vdpa: Add support for querying vendor statistics

2022-05-02 Thread Si-Wei Liu
vdpa_name_match); + if (!dev) { + NL_SET_ERR_MSG_MOD(info->extack, "device not found"); + err = -ENODEV; + goto dev_err; Missing nlmsg_free(). + } + vdev = container_of(dev, struct vdpa_device, dev); + if (!vdev->mdev) { + NL_SET_ERR_

Re: [PATCH v3 2/2] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-02 Thread Si-Wei Liu
side stat counter for the vq reset to zero? Anyway, the above could be good enhancement with future patches. Given that, Reviewed-by: Si-Wei Liu qp_destroy(ndev, &mvq->vqqp); qp_destroy(ndev, &mvq->fwqp); cq_destroy(ndev, mvq->index);

Re: [PATCH v3 1/2] vdpa: Add support for querying vendor statistics

2022-05-03 Thread Si-Wei Liu
On 5/2/2022 10:13 PM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Tuesday, May 3, 2022 2:48 AM To: Eli Cohen ; m...@redhat.com; jasow...@redhat.com Cc: virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org Subject: Re: [PATCH v3 1/2] vdpa: Add

Re: [PATCH v3 1/2] vdpa: Add support for querying vendor statistics

2022-05-05 Thread Si-Wei Liu
On 5/3/2022 10:44 PM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Wednesday, May 4, 2022 7:44 AM To: Eli Cohen ; m...@redhat.com; jasow...@redhat.com Cc: virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org Subject: Re: [PATCH v3 1/2] vdpa: Add

Re: [PATCH v5 1/3] vdpa: Fix error logic in vdpa_nl_cmd_dev_get_doit

2022-05-10 Thread Si-Wei Liu
ned-off-by: Eli Cohen Reviewed-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c index 2b75c00b1005..fac89a0d8178 100644 --- a/drivers/vdpa/vdpa.c +++ b/drivers/vdpa/vdpa.c

Re: [PATCH v3 1/2] vdpa: Add support for querying vendor statistics

2022-05-10 Thread Si-Wei Liu
On 5/8/2022 12:44 AM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Tuesday, May 3, 2022 2:48 AM To: Eli Cohen ; m...@redhat.com; jasow...@redhat.com Cc: virtualization@lists.linux-foundation.org; linux-ker...@vger.kernel.org Subject: Re: [PATCH v3 1/2] vdpa: Add support

Re: [PATCH v5 3/3] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-11 Thread Si-Wei Liu
On 5/10/2022 4:27 AM, Eli Cohen wrote: Implement the get_vq_stats calback of vdpa_config_ops to return the statistics for a virtqueue. The statistics are provided as vendor specific statistics where the driver provides a pair of attribute name and attribute value. In addition to the attribut

Re: [PATCH] net/vdpa: Use reader/writers semaphore instead of mutex

2022-05-11 Thread Si-Wei Liu
On 5/11/2022 5:58 AM, Eli Cohen wrote: Use rw_semaphore instead of mutex to control access to vdpa devices. This can be especially beneficial in case process poll on statistics information. Suggested-by: Si-Wei Liu Signed-off-by: Eli Cohen LGTM. It might be good to pack this patch into the

Re: [PATCH v5 2/3] vdpa: Add support for querying vendor statistics

2022-05-11 Thread Si-Wei Liu
On 5/10/2022 4:27 AM, Eli Cohen wrote: Allows to read vendor statistics of a vdpa device. The specific statistics data are received from the upstream driver in the form of an (attribute name, attribute value) pairs. An example of statistics for mlx5_vdpa device are: received_desc - number of

Re: [PATCH v5 3/3] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-12 Thread Si-Wei Liu
On 5/11/2022 10:25 AM, Si-Wei Liu wrote: + +static int mlx5_vdpa_get_vendor_vq_stats(struct vdpa_device *vdev, u16 idx, + struct sk_buff *msg, + struct netlink_ext_ack *extack) +{ +    struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); +    struct

Re: [PATCH v5 3/3] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-12 Thread Si-Wei Liu
On 5/11/2022 10:25 AM, Si-Wei Liu wrote: + +static int mlx5_vdpa_get_vendor_vq_stats(struct vdpa_device *vdev, u16 idx, + struct sk_buff *msg, + struct netlink_ext_ack *extack) +{ +    struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev); +    struct

Re: [PATCH v5 3/3] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-12 Thread Si-Wei Liu
On 5/11/2022 10:25 AM, Si-Wei Liu wrote: @@ -164,6 +165,7 @@ struct mlx5_vdpa_net {   struct notifier_block nb;   struct vdpa_callback config_cb;   struct mlx5_vdpa_wq_ent cvq_ent; +    /* sync access to virtqueues statistics */ Dangling code change? ... and this. Thanks

Re: [PATCH v1 for reference] vdpa: Add support for reading vdpa device statistics

2022-05-12 Thread Si-Wei Liu
On 5/11/2022 10:40 PM, Eli Cohen wrote: Read statistics of a vdpa device. The specific data is a received as a pair of attribute name and attribute value. Examples: 1. Read statistics for the virtqueue at index 1 $ vdpa dev vstats show vdpa-a qidx 1 vdpa-a: qtype tx qidx 1 received_desc 4583

Re: [PATCH v5 3/3] vdpa/mlx5: Add support for reading descriptor statistics

2022-05-12 Thread Si-Wei Liu
On 5/11/2022 7:27 PM, Jason Wang wrote: On Thu, May 12, 2022 at 1:26 AM Si-Wei Liu wrote: On 5/10/2022 4:27 AM, Eli Cohen wrote: Implement the get_vq_stats calback of vdpa_config_ops to return the statistics for a virtqueue. The statistics are provided as vendor specific statistics

Re: [PATCH v7 5/5] vdpa/mlx5: Use readers/writers semaphore instead of mutex

2022-05-17 Thread Si-Wei Liu
On 5/17/2022 6:13 AM, Eli Cohen wrote: Reading statistics could be done intensively and by several processes concurrently. Reader's lock is sufficient in this case. Change reslock from mutex to a rwsem. Suggested-by: Si-Wei Liu Signed-off-by: Eli Cohen Reviewed-by: Si-We

Re: [PATCH v7 2/5] vdpa: Add support for querying vendor statistics

2022-05-17 Thread Si-Wei Liu
On 5/17/2022 6:13 AM, Eli Cohen wrote: Allows to read vendor statistics of a vdpa device. The specific statistics data are received from the upstream driver in the form of an (attribute name, attribute value) pairs. An example of statistics for mlx5_vdpa device are: received_desc - number of

Re: [PATCH 1/4] vdpa: Add stop operation

2022-05-21 Thread Si-Wei Liu
On 5/20/2022 10:23 AM, Eugenio Pérez wrote: This operation is optional: It it's not implemented, backend feature bit will not be exposed. Signed-off-by: Eugenio Pérez --- include/linux/vdpa.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdp

Re: [PATCH 2/4] vhost-vdpa: introduce STOP backend feature bit

2022-05-21 Thread Si-Wei Liu
On 5/20/2022 10:23 AM, Eugenio Pérez wrote: Userland knows if it can stop the device or not by checking this feature bit. It's only offered if the vdpa driver backend implements the stop() operation callback, and try to set it if the backend does not offer that callback is an error. Signed-of

Re: [PATCH 1/4] vdpa: Add stop operation

2022-05-23 Thread Si-Wei Liu
On 5/23/2022 12:20 PM, Eugenio Perez Martin wrote: On Sat, May 21, 2022 at 12:13 PM Si-Wei Liu wrote: On 5/20/2022 10:23 AM, Eugenio Pérez wrote: This operation is optional: It it's not implemented, backend feature bit will not be exposed. Signed-off-by: Eugenio Pérez --- in

Re: [PATCH 1/4] vdpa: Add stop operation

2022-05-23 Thread Si-Wei Liu
On 5/23/2022 4:54 PM, Si-Wei Liu wrote: On 5/23/2022 12:20 PM, Eugenio Perez Martin wrote: On Sat, May 21, 2022 at 12:13 PM Si-Wei Liu wrote: On 5/20/2022 10:23 AM, Eugenio Pérez wrote: This operation is optional: It it's not implemented, backend feature bit will not be ex

Re: [PATCH 1/2] vdpa/mlx5: fix error code for deleting vlan

2022-06-07 Thread Si-Wei Liu
On 6/6/2022 11:49 PM, Dan Carpenter wrote: Return success if we were able to delete a vlan. The current code always returns failure. Fixes: baf2ad3f6a98 ("vdpa/mlx5: Add RX MAC VLAN filter support") Signed-off-by: Dan Carpenter Acked-by: Si-Wei Liu --- From review. (

Re: [PATCH 2/2] vdpa/mlx5: clean up indenting in handle_ctrl_vlan()

2022-06-07 Thread Si-Wei Liu
On 6/6/2022 11:50 PM, Dan Carpenter wrote: These lines were supposed to be indented. Signed-off-by: Dan Carpenter Acked-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b

Re: [PATCH V3 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0

2022-07-27 Thread Si-Wei Liu
On 7/26/2022 11:01 PM, Michael S. Tsirkin wrote: On Wed, Jul 27, 2022 at 03:47:35AM +, Parav Pandit wrote: From: Zhu, Lingshan Sent: Tuesday, July 26, 2022 10:53 PM On 7/27/2022 10:17 AM, Parav Pandit wrote: From: Zhu, Lingshan Sent: Tuesday, July 26, 2022 10:15 PM On 7/26/2022 11:56

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

2022-07-27 Thread Si-Wei Liu
On 7/5/2022 4:56 AM, Parav Pandit via Virtualization wrote: From: Zhu, Lingshan Sent: Tuesday, July 5, 2022 3:59 AM On 7/4/2022 8:53 PM, Parav Pandit wrote: From: Jason Wang Sent: Monday, July 4, 2022 12:47 AM 在 2022/7/2 06:02, Parav Pandit 写道: From: Zhu Lingshan Sent: Friday, July 1,

Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space

2022-07-27 Thread Si-Wei Liu
Sorry to chime in late in the game. For some reason I couldn't get to most emails for this discussion (I only subscribed to the virtualization list), while I was taking off amongst the past few weeks. It looks to me this patch is incomplete. Noted down the way in vdpa_dev_net_config_fill(), we

Re: [PATCH V3 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0

2022-07-27 Thread Si-Wei Liu
On 7/27/2022 2:01 AM, Michael S. Tsirkin wrote: On Wed, Jul 27, 2022 at 12:50:33AM -0700, Si-Wei Liu wrote: On 7/26/2022 11:01 PM, Michael S. Tsirkin wrote: On Wed, Jul 27, 2022 at 03:47:35AM +, Parav Pandit wrote: From: Zhu, Lingshan Sent: Tuesday, July 26, 2022 10:53 PM On 7/27

Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space

2022-07-27 Thread Si-Wei Liu
On 7/27/2022 4:47 AM, Zhu, Lingshan wrote: On 7/27/2022 5:43 PM, Si-Wei Liu wrote: Sorry to chime in late in the game. For some reason I couldn't get to most emails for this discussion (I only subscribed to the virtualization list), while I was taking off amongst the past few weeks.

Re: [PATCH V3 5/6] vDPA: answer num of queue pairs = 1 to userspace when VIRTIO_NET_F_MQ == 0

2022-07-27 Thread Si-Wei Liu
On 7/27/2022 4:54 AM, Zhu, Lingshan wrote: On 7/27/2022 6:09 PM, Si-Wei Liu wrote: On 7/27/2022 2:01 AM, Michael S. Tsirkin wrote: On Wed, Jul 27, 2022 at 12:50:33AM -0700, Si-Wei Liu wrote: On 7/26/2022 11:01 PM, Michael S. Tsirkin wrote: On Wed, Jul 27, 2022 at 03:47:35AM +

<    1   2   3   4   5   >