[PATCH 2/3] vdpa/mlx5: set_features should nack MQ if no CTRL_VQ

2022-01-12 Thread Si-Wei Liu
Made corresponding change per spec: The device MUST NOT offer a feature which requires another feature which was not offered. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 16 +--- 1 file c

[PATCH 1/3] vdpa: factor out vdpa_set_features_unlocked for vdpa internal use

2022-01-12 Thread Si-Wei Liu
No functional change introduced. vdpa bus driver such as virtio_vdpa or vhost_vdpa is not supposed to take care of the locking for core by its own. The locked API vdpa_set_features should suffice the bus driver's need. Signed-off-by: Si-Wei Liu --- drivers/vdpa/vdpa.c | 2 +- dr

Re: [PATCH 2/3] vdpa/mlx5: set_features should nack MQ if no CTRL_VQ

2022-01-14 Thread Si-Wei Liu
On 1/12/2022 10:57 PM, Michael S. Tsirkin wrote: On Thu, Jan 13, 2022 at 12:10:50AM -0500, Si-Wei Liu wrote: Made corresponding change per spec: The device MUST NOT offer a feature which requires another feature which was not offered. Says nothing about the driver though, and you seem to

Re: [PATCH 3/3] vdpa/mlx5: validate the queue pair value from driver

2022-01-14 Thread Si-Wei Liu
On 1/12/2022 11:00 PM, Michael S. Tsirkin wrote: On Thu, Jan 13, 2022 at 12:10:51AM -0500, Si-Wei Liu wrote: Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Si-Wei Liu Add motivation for change in the commit log. --- drivers/vdpa/mlx5/net/mlx5_v

Re: [PATCH 0/3] fixes for mlx5_vdpa multiqueue support

2022-01-14 Thread Si-Wei Liu
On 1/12/2022 11:03 PM, Michael S. Tsirkin wrote: On Thu, Jan 13, 2022 at 12:10:48AM -0500, Si-Wei Liu wrote: This patchset contains the fixes for a few issues uncovered during the review for the "Allow for configuring max number of virtqueue pairs" series. It is based on E

[PATCH v2 0/3] fixes for mlx5_vdpa multiqueue support

2022-01-14 Thread Si-Wei Liu
t the actual code change - fixed corrupted email address format in SoB Si-Wei Liu (3): vdpa: factor out vdpa_set_features_unlocked for vdpa internal use vdpa/mlx5: should verify CTRL_VQ feature exists for MQ vdpa/mlx5: add validation for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command drivers/vd

[PATCH v2 2/3] vdpa/mlx5: should verify CTRL_VQ feature exists for MQ

2022-01-14 Thread Si-Wei Liu
han just validate the minimum features. verify_driver_features() is now used to accommodate various checks against the driver features for set_driver_features(). Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 18 -- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git

[PATCH v2 3/3] vdpa/mlx5: add validation for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command

2022-01-14 Thread Si-Wei Liu
for the queues were there any bogus request sent down by untrusted driver. Tie up the loose ends there. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 16 1 file changed, 16 insertions(+) di

[PATCH v2 1/3] vdpa: factor out vdpa_set_features_unlocked for vdpa internal use

2022-01-14 Thread Si-Wei Liu
No functional change introduced. vdpa bus driver such as virtio_vdpa or vhost_vdpa is not supposed to take care of the locking for core by its own. The locked API vdpa_set_features should suffice the bus driver's need. Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen --- drivers/vdpa/v

Re: [PATCH] net/mlx5: Add support for configuring max device MTU

2022-02-16 Thread Si-Wei Liu
On 2/16/2022 3:33 AM, Eli Cohen wrote: Allow an admin creating a vdpa device to specify the max MTU for the net device. For example, to create a device with max MTU of 1000, the following command can be used: $ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 mtu 1000 Signed-off-by

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

2022-02-16 Thread Si-Wei Liu
On 2/16/2022 12:00 AM, Eli Cohen wrote: Allows to read vendor statistics of a vdpa device. The specific statistics data is received by 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 d

Re: [PATCH] net/mlx5: Add support for configuring max device MTU

2022-02-18 Thread Si-Wei Liu
On 2/16/2022 10:20 PM, Eli Cohen wrote: On Wed, Feb 16, 2022 at 10:19:52AM -0800, Si-Wei Liu wrote: On 2/16/2022 3:33 AM, Eli Cohen wrote: Allow an admin creating a vdpa device to specify the max MTU for the net device. For example, to create a device with max MTU of 1000, the following

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

2022-03-04 Thread Si-Wei Liu
Sorry, I somehow missed this after my break. Please see comments in line. On 2/16/2022 10:46 PM, Eli Cohen wrote: On Wed, Feb 16, 2022 at 10:49:26AM -0800, Si-Wei Liu wrote: On 2/16/2022 12:00 AM, Eli Cohen wrote: Allows to read vendor statistics of a vdpa device. The specific statistics

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

2022-03-07 Thread Si-Wei Liu
On 3/6/2022 11:57 PM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Saturday, March 5, 2022 12:34 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- foundation.org; epere...@redhat.com; amore...@redhat.com; lviv...@redhat.com; sgarz

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

2022-03-08 Thread Si-Wei Liu
On 3/8/2022 6:13 AM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Tuesday, March 8, 2022 8:16 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- foundation.org; epere...@redhat.com; amore...@redhat.com; lviv...@redhat.com; sgarz

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

2022-03-09 Thread Si-Wei Liu
On 3/8/2022 9:07 PM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Wednesday, March 9, 2022 5:33 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- foundation.org; epere...@redhat.com; amore...@redhat.com; lviv...@redhat.com; sgarz

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

2022-03-15 Thread Si-Wei Liu
On 3/13/2022 8:26 AM, Eli Cohen wrote: On 3/8/2022 9:07 PM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Wednesday, March 9, 2022 5:33 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- foundation.org; epere...@redhat.com; amore

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

2022-03-15 Thread Si-Wei Liu
On 3/13/2022 11:25 PM, Jason Wang wrote: On Sun, Mar 13, 2022 at 11:26 PM Eli Cohen wrote: > On 3/8/2022 9:07 PM, Eli Cohen wrote: > > > >> -Original Message----- > >> From: Si-Wei Liu > >> Sent: Wednesday, March 9, 2022 5:33 AM

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

2022-03-15 Thread Si-Wei Liu
On 3/15/2022 2:10 AM, Eli Cohen wrote: <...snip...> Say you got a vdpa net device created with 4 data queue pairs and a control vq. On boot some guest firmware may support just F_CTRL_VQ but not F_MQ, then the index for the control vq in guest ends up with 2, as in this case there's only a si

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

2022-03-16 Thread Si-Wei Liu
On 3/16/2022 12:10 AM, Eli Cohen wrote: From: Si-Wei Liu Sent: Wednesday, March 16, 2022 8:52 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux-foundation.org; epere...@redhat.com; amore...@redhat.com; lviv...@redhat.com; sgarz...@redhat.com; Parav

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

2022-03-17 Thread Si-Wei Liu
On 3/16/2022 7:32 PM, Jason Wang wrote: On Thu, Mar 17, 2022 at 6:00 AM Si-Wei Liu wrote: On 3/16/2022 12:10 AM, Eli Cohen wrote: From: Si-Wei Liu Sent: Wednesday, March 16, 2022 8:52 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux-foundation.org

Re: [PATCH] vdpa: Update man page with added support to configure max vq pair

2022-03-18 Thread Si-Wei Liu
for the network type of vdpa device. This is optional. .BI mtu " MTU" - specifies the mtu for the new vdpa device. This is applicable only for the network type of vdpa device. This is optional. Otherwise looks good to me. Reviewed-by: Si-Wei Liu Thanks, -Siwei .ti -8 .B vdpa de

Re: [PATCH] vdpa: Update man page with added support to configure max vq pair

2022-03-18 Thread Si-Wei Liu
e only for the network type of vdpa device. This is optional. .BI mtu " MTU" - specifies the mtu for the new vdpa device. This is applicable only for the network type of vdpa device. This is optional. Otherwise looks good to me. Reviewed-by: Si-Wei Liu Thanks, -Siwei .ti -8 .B vdpa

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

2022-03-18 Thread Si-Wei Liu
On 3/17/2022 7:27 PM, Jason Wang wrote: On Fri, Mar 18, 2022 at 8:59 AM Si-Wei Liu wrote: On 3/16/2022 7:32 PM, Jason Wang wrote: On Thu, Mar 17, 2022 at 6:00 AM Si-Wei Liu wrote: On 3/16/2022 12:10 AM, Eli Cohen wrote: From: Si-Wei Liu Sent: Wednesday, March 16, 2022 8:52 AM To

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-10-15 Thread si-wei liu
On 10/15/2020 6:11 AM, Michael S. Tsirkin wrote: On Thu, Oct 15, 2020 at 02:15:32PM +0800, Jason Wang wrote: On 2020/10/14 上午7:42, si-wei liu wrote: So what I suggest is to fix the pinning leakage first and do the possible optimization on top (which is still questionable to me). OK

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-10-29 Thread si-wei liu
On 10/29/2020 2:53 PM, Michael S. Tsirkin wrote: On Thu, Oct 15, 2020 at 01:17:14PM -0700, si-wei liu wrote: On 10/15/2020 6:11 AM, Michael S. Tsirkin wrote: On Thu, Oct 15, 2020 at 02:15:32PM +0800, Jason Wang wrote: On 2020/10/14 上午7:42, si-wei liu wrote: So what I suggest is to fix the

[PATCH 1/2] Revert "vhost-vdpa: fix page pinning leakage in error path"

2020-10-30 Thread Si-Wei Liu
This reverts commit 7ed9e3d97c32d969caded2dfb6e67c1a2cc5a0b1. Signed-off-by: Si-Wei Liu --- drivers/vhost/vdpa.c | 119 +-- 1 file changed, 48 insertions(+), 71 deletions(-) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index a2dbc85

[PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-10-30 Thread Si-Wei Liu
memory demand for VM with a large amount of memory, or in the situation where host is running short of free memory. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Si-Wei Liu --- drivers/vhost/vdpa.c | 64 +--- 1 fi

Re: [PATCH v3 2/2] vhost-vdpa: fix page pinning leakage in error path

2020-11-02 Thread si-wei liu
On 10/29/2020 2:53 PM, Michael S. Tsirkin wrote: On Thu, Oct 15, 2020 at 01:17:14PM -0700, si-wei liu wrote: On 10/15/2020 6:11 AM, Michael S. Tsirkin wrote: On Thu, Oct 15, 2020 at 02:15:32PM +0800, Jason Wang wrote: On 2020/10/14 上午7:42, si-wei liu wrote: So what I suggest is to fix the

Re: [PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-03 Thread si-wei liu
On 11/3/2020 5:00 AM, Jason Wang wrote: On 2020/10/30 下午3:45, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for bookkeeping pinned pages is reverted to what

Re: [PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-03 Thread si-wei liu
On 11/3/2020 5:06 PM, si-wei liu wrote: On 11/3/2020 5:00 AM, Jason Wang wrote: On 2020/10/30 下午3:45, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for

Re: [PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-03 Thread si-wei liu
On 11/3/2020 5:58 PM, Jason Wang wrote: On 2020/11/4 上午9:08, si-wei liu wrote: On 11/3/2020 5:06 PM, si-wei liu wrote: On 11/3/2020 5:00 AM, Jason Wang wrote: On 2020/10/30 下午3:45, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB

Re: [PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-04 Thread si-wei liu
On 11/3/2020 6:42 PM, Jason Wang wrote: On 2020/10/30 下午3:45, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for bookkeeping pinned pages is reverted to what

[PATCH v2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-04 Thread Si-Wei Liu
memory demand for VM with a large amount of memory, or in the situation where host is running short of free memory. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Si-Wei Liu --- Changes in v2: - Drop the reversion patch - Fix unhandled page leak towards the end of

Re: [PATCH 2/2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-05 Thread si-wei liu
On 11/4/2020 7:12 PM, Jason Wang wrote: On 2020/11/5 上午7:40, si-wei liu wrote: On 11/3/2020 6:42 PM, Jason Wang wrote: On 2020/10/30 下午3:45, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for

Re: [PATCH v2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-05 Thread si-wei liu
On 11/4/2020 7:26 PM, Jason Wang wrote: On 2020/11/5 上午7:33, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for bookkeeping pinned pages is reverted to what

[PATCH v3] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-05 Thread Si-Wei Liu
memory demand for VM with a large amount of memory, or in the situation where host is running short of free memory. Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") Signed-off-by: Si-Wei Liu --- Changes in v3: - Turn explicit last_pfn check to a WARN_ON() (Jason) Changes in v2:

Re: [PATCH v2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-09 Thread si-wei liu
On 11/8/2020 7:21 PM, Jason Wang wrote: On 2020/11/6 上午6:57, si-wei liu wrote: On 11/4/2020 7:26 PM, Jason Wang wrote: On 2020/11/5 上午7:33, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for

Re: [PATCH v2] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-09 Thread si-wei liu
On 11/9/2020 2:42 PM, Michael S. Tsirkin wrote: On Mon, Nov 09, 2020 at 01:44:03PM -0800, si-wei liu wrote: On 11/8/2020 7:21 PM, Jason Wang wrote: On 2020/11/6 上午6:57, si-wei liu wrote: On 11/4/2020 7:26 PM, Jason Wang wrote: On 2020/11/5 上午7:33, Si-Wei Liu wrote: Pinned pages are not

Re: [PATCH v3] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-10 Thread si-wei liu
On 11/9/2020 7:28 PM, Jason Wang wrote: On 2020/11/6 上午7:26, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for bookkeeping pinned pages is reverted to what

Re: [PATCH v3] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-19 Thread si-wei liu
A gentle reminder. Any chance this patch will get picked soon? Thanks, -Siwei On 11/9/2020 7:28 PM, Jason Wang wrote: On 2020/11/6 上午7:26, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the

Re: [PATCH v3] vhost-vdpa: fix page pinning leakage in error path (rework)

2020-11-25 Thread si-wei liu
On 11/25/2020 1:30 AM, Michael S. Tsirkin wrote: On Thu, Nov 05, 2020 at 06:26:33PM -0500, Si-Wei Liu wrote: Pinned pages are not properly accounted particularly when mapping error occurs on IOTLB update. Clean up dangling pinned pages for the error path. The memory usage for bookkeeping

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-05 Thread Si-Wei Liu
On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new memory map. In such case, we need to restore the hardware available and used indices. The driver failed to restore the used index which is adde

[PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-06 Thread Si-Wei Liu
to be started, i.e. until VIRTIO_CONFIG_S_DRIVER_OK is set again in set_status(). Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

[PATCH 1/3] mlx5_vdpa: should exclude header length and fcs from mtu

2021-02-06 Thread Si-Wei Liu
e Ethernet header up to the FCS altogether. Fix the MTU so packets won't get dropped silently. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 drivers/vdpa/mlx5/net/mlx5_vnet.c | 15 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git

[PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset

2021-02-06 Thread Si-Wei Liu
wire. Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index b8416c4..aa6f8cd 100644 --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c +++ b/drivers/vdpa/mlx5/net/mlx5_v

Re: [PATCH 2/3] mlx5_vdpa: fix feature negotiation across device reset

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:35 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:23AM -0800, Si-Wei Liu wrote: The mlx_features denotes the capability for which set of virtio features is supported by device. In principle, this field needs not be cleared during virtio device reset, as this capability is

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-08 Thread Si-Wei Liu
On 2/7/2021 9:48 PM, Eli Cohen wrote: On Sat, Feb 06, 2021 at 04:29:24AM -0800, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from device. The saved avail_index is used to restate the virtq

Re: [PATCH 3/3] mlx5_vdpa: defer clear_virtqueues to until DRIVER_OK

2021-02-09 Thread Si-Wei Liu
On 2/8/2021 7:37 PM, Jason Wang wrote: On 2021/2/6 下午8:29, Si-Wei Liu wrote: While virtq is stopped,  get_vq_state() is supposed to be  called to  get  sync'ed  with  the latest internal avail_index from device. The saved avail_index is used to restate  the virtq  once device is st

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-09 Thread Si-Wei Liu
, 2021 at 12:27:18PM +0800, Jason Wang wrote: On 2021/2/6 上午7:07, Si-Wei Liu wrote: On 2/3/2021 11:36 PM, Eli Cohen wrote: When a change of memory map occurs, the hardware resources are destroyed and then re-created again with the new memory map. In such case, we need to restore the hardware

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-10 Thread Si-Wei Liu
On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20:14AM +0800, Jason Wang wrote: On 2021/2/8 下午6:04, Eli Cohen wrote: On Mon, Feb 08, 2021 at 05:04

[PATCH v2 3/3] vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK

2021-02-10 Thread Si-Wei Liu
to be started, i.e. until VIRTIO_CONFIG_S_DRIVER_OK is set again in set_status(). Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 0/3] mlx5_vdpa bug fixes

2021-02-10 Thread Si-Wei Liu
-- v1->v2: move feature capability query to probing (Eli) Si-Wei Liu (3): vdpa/mlx5: should exclude header length and fcs from mtu vdpa/mlx5: fix feature negotiation across device reset vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 driv

[PATCH v2 2/3] vdpa/mlx5: fix feature negotiation across device reset

2021-02-10 Thread Si-Wei Liu
wire. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/driver

[PATCH v2 1/3] vdpa/mlx5: should exclude header length and fcs from mtu

2021-02-10 Thread Si-Wei Liu
e Ethernet header up to the FCS altogether. Fix the MTU so packets won't get dropped silently. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-Wei Liu Acked-by: Jason Wang Acked-by: Eli Cohen --- drivers/vdpa/mlx5/core/mlx5_vdpa.

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-16 Thread Si-Wei Liu
On 2/10/2021 7:45 AM, Eli Cohen wrote: On Wed, Feb 10, 2021 at 12:59:03AM -0800, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-17 Thread Si-Wei Liu
set_vq_state(). In get_vq_state() we return the value of hardware used index. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen Acked-by: Si-Wei Liu --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 17 - 1 file changed, 4 inserti

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-17 Thread Si-Wei Liu
On 2/17/2021 1:20 PM, Michael S. Tsirkin wrote: On Wed, Feb 17, 2021 at 11:42:48AM -0800, Si-Wei Liu wrote: On 2/16/2021 8:20 AM, Eli Cohen wrote: When we suspend the VM, the VDPA interface will be reset. When the VM is resumed again, clear_virtqueues() will clear the available and used

Re: [PATCH v2 3/3] vdpa/mlx5: defer clear_virtqueues to until DRIVER_OK

2021-02-17 Thread Si-Wei Liu
On 2/16/2021 7:21 AM, Eli Cohen wrote: On Thu, Feb 11, 2021 at 09:33:14AM +0200, Eli Cohen wrote: On Wed, Feb 10, 2021 at 01:48:00PM -0800, Si-Wei Liu wrote: While virtq is stopped, get_vq_state() is supposed to be called to get sync'ed with the latest internal avail_index from d

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-18 Thread Si-Wei Liu
On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote: On 2021/2/9 下午2:12, Eli Cohen wrote: On Tue, Feb 09, 2021 at 11:20:14AM +0800, Jason

[PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-19 Thread Si-Wei Liu
o 0 prematurely causes correct MTU and link status unable to load for the very first config space access, rendering issues like guest showing inaccurate MTU value, or failure to reject out-of-range MTU. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by:

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/18/2021 7:10 PM, Jason Wang wrote: On 2021/2/18 8:43 下午, Si-Wei Liu wrote: On 2/17/2021 8:44 PM, Jason Wang wrote: On 2021/2/10 下午4:59, Si-Wei Liu wrote: On 2/9/2021 7:53 PM, Jason Wang wrote: On 2021/2/10 上午10:30, Si-Wei Liu wrote: On 2/8/2021 10:37 PM, Jason Wang wrote

Re: [PATCH 1/2] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-19 Thread Si-Wei Liu
On 2/17/2021 11:42 AM, Si-Wei Liu wrote: On 2/16/2021 8:20 AM, Eli Cohen wrote: When we suspend the VM, the VDPA interface will be reset. When the VM is resumed again, clear_virtqueues() will clear the available and used indices resulting in hardware virqtqueue objects becoming out of sync

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/19/2021 6:38 PM, Jason Wang wrote: Right now the value is exposed to userspace via GET_VRING_BASE, so only last_avail_idx is synced. If we need sync last_used_idx, we should also sync pending indices which requires more thoughts. Technically it doesn't sound right - crossing the bounda

Re: [PATCH v1] vdpa/mlx5: Restore the hardware used index after change map

2021-02-19 Thread Si-Wei Liu
On 2/19/2021 6:38 PM, Jason Wang wrote: Right now the value is exposed to userspace via GET_VRING_BASE, so only last_avail_idx is synced. If we need sync last_used_idx, we should also sync pending indices which requires more thoughts. Technically it doesn't sound right - crossing the bound

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-22 Thread Si-Wei Liu
On 2/21/2021 8:14 PM, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei Liu wrote: Commit 452639a64ad8 ("vdpa: make sure set_features is invoked for legacy") made an exception for legacy guests to reset features to 0, when config space is accessed before features are set. We should r

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-22 Thread Si-Wei Liu
On 2/21/2021 11:34 PM, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 12:14:17PM +0800, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei Liu wrote: Commit 452639a64ad8 ("vdpa: make sure set_features is invoked for legacy") made an exception for legacy guests to reset features

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-23 Thread Si-Wei Liu
On 2/23/2021 5:26 AM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 10:03:57AM +0800, Jason Wang wrote: On 2021/2/23 9:12 上午, Si-Wei Liu wrote: On 2/21/2021 11:34 PM, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 12:14:17PM +0800, Jason Wang wrote: On 2021/2/19 7:54 下午, Si-Wei Liu

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-24 Thread Si-Wei Liu
On 2/23/2021 9:04 PM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 11:35:57AM -0800, Si-Wei Liu wrote: On 2/23/2021 5:26 AM, Michael S. Tsirkin wrote: On Tue, Feb 23, 2021 at 10:03:57AM +0800, Jason Wang wrote: On 2021/2/23 9:12 上午, Si-Wei Liu wrote: On 2/21/2021 11:34 PM, Michael S

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-25 Thread Si-Wei Liu
;s fine, I would proceed to reverting commit fe36cbe067 and related code in question from the kernel. Thanks, -Siwei On 2/24/2021 10:24 AM, Si-Wei Liu wrote: Detecting it isn't enough though, we will need a new ioctl to notify the kernel that it's a legacy guest. Ugh :( Well, although I t

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-02-25 Thread Si-Wei Liu
;s fine, I would proceed to reverting commit fe36cbe067 and related code in question from the kernel. Thanks, -Siwei On 2/24/2021 10:24 AM, Si-Wei Liu wrote: Detecting it isn't enough though, we will need a new ioctl to notify the kernel that it's a legacy guest. Ugh :( Well, althou

Re: [PATCH] vdpa/mlx5: set_features should allow reset to zero

2021-03-01 Thread Si-Wei Liu
On 2/28/2021 1:27 PM, Michael S. Tsirkin wrote: On Thu, Feb 25, 2021 at 04:56:42PM -0800, Si-Wei Liu wrote: Hi Michael, Are you okay to live without this ioctl for now? I think QEMU is the one that needs to be fixed and will have to be made legacy guest aware. I think the kernel can just

[PATCH v3 1/1] vdpa/mlx5: fix feature negotiation across device reset

2021-04-28 Thread Si-Wei Liu
ted on the wire. The fix is to retain the features capability on reset, and get it only once from firmware on the vdpa_dev_add path. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Si-Wei Liu Acked-by: Eli Cohen Acked-by: Jason Wang --- d

[PATCH v3 0/1] mlx5_vdpa bug fix for feature negotiation

2021-04-28 Thread Si-Wei Liu
s series; repost with updated commit message v1->v2: move feature capability query to probing (Eli) Si-Wei Liu (1): vdpa/mlx5: fix feature negotiation across device reset drivers/vdpa/mlx5/net/mlx5_vnet.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-)

Re: [PATCH v2 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 9:38 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: In order to allow live migration orchestration software to export the initial set of vdpa attributes with which the device was created, it will be useful if the vdpa tool can report the config on

Re: [PATCH v2 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 10:25 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Live migration of vdpa would typically require re-instate vdpa device with an idential set of configs on the destination node, same way as how source node created the device in the first place. In

Re: [PATCH v2 2/4] vdpa: pass initial config to _vdpa_register_device()

2022-10-20 Thread Si-Wei Liu
On 10/19/2022 10:20 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Just as _vdpa_register_device taking @nvqs as the number of queues I wonder if it's better to embed nvqs in the config structure. Hmmm, the config structure is mostly for containin

[PATCH v3 1/4] vdpa: save vdpa_dev_set_config in struct vdpa_device

2022-10-21 Thread Si-Wei Liu
ation are carried over. Which will be used in subsequent commits. Signed-off-by: Si-Wei Liu --- include/linux/vdpa.h | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 6d0f5e4..9f519a3 100644 --- a/in

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

2022-10-21 Thread Si-Wei Liu
v3: - Rename vdev_cfg to init_cfg and also related function (Jason) - Change "virtio_config" to "initial_config" in command example output (Parav) v1 -> v2: - Revised example output to export all config attributes under a json object (Jason) --- Si-Wei Liu

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

2022-10-21 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 v3 2/4] vdpa: pass initial config to _vdpa_register_device()

2022-10-21 Thread Si-Wei Liu
Just as _vdpa_register_device taking @nvqs as the number of queues to feed userspace inquery via vdpa_dev_fill(), we can follow the same to stash config attributes in struct vdpa_device at the time of vdpa registration. Signed-off-by: Si-Wei Liu --- drivers/vdpa/ifcvf/ifcvf_main.c | 2

[PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-21 Thread Si-Wei Liu
", "vendor_id": , "max_vqs": 9, "max_vq_size": 256, "initial_config": { "mac": "e4:11:c6:d3:45:f0", "max_vq_pairs": 4 } }

Re: [PATCH v2 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-21 Thread Si-Wei Liu
On 10/20/2022 2:13 PM, Parav Pandit wrote: From: Si-Wei Liu Sent: Thursday, October 20, 2022 2:12 PM On 10/19/2022 10:25 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Live migration of vdpa would typically require re-instate vdpa device with an idential set of

Re: [PATCH v2 2/4] vdpa: pass initial config to _vdpa_register_device()

2022-10-21 Thread Si-Wei Liu
On 10/20/2022 7:51 PM, Jason Wang wrote: On Fri, Oct 21, 2022 at 2:45 AM Si-Wei Liu wrote: On 10/19/2022 10:20 PM, Jason Wang wrote: On Wed, Oct 19, 2022 at 8:56 AM Si-Wei Liu wrote: Just as _vdpa_register_device taking @nvqs as the number of queues I wonder if it's better to

Re: [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-24 Thread Si-Wei Liu
On 10/24/2022 1:40 AM, Jason Wang wrote: On Sat, Oct 22, 2022 at 7:49 AM Si-Wei Liu wrote: Live migration of vdpa would typically require re-instate vdpa device with an idential set of configs on the destination node, same way as how source node created the device in the first place. In

Re: [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-25 Thread Si-Wei Liu
On 10/24/2022 7:24 PM, Jason Wang wrote: On Tue, Oct 25, 2022 at 3:14 AM Si-Wei Liu wrote: On 10/24/2022 1:40 AM, Jason Wang wrote: On Sat, Oct 22, 2022 at 7:49 AM Si-Wei Liu wrote: Live migration of vdpa would typically require re-instate vdpa device with an idential set of configs on

Re: [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-26 Thread Si-Wei Liu
On 10/25/2022 9:44 PM, Jason Wang wrote: 在 2022/10/26 09:10, Si-Wei Liu 写道: On 10/24/2022 7:24 PM, Jason Wang wrote: On Tue, Oct 25, 2022 at 3:14 AM Si-Wei Liu  wrote: On 10/24/2022 1:40 AM, Jason Wang wrote: On Sat, Oct 22, 2022 at 7:49 AM Si-Wei Liu  wrote: Live migration of vdpa

Re: [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-10-28 Thread Si-Wei Liu
On 10/27/2022 1:47 AM, Jason Wang wrote: On Thu, Oct 27, 2022 at 2:31 PM Si-Wei Liu wrote: On 10/25/2022 9:44 PM, Jason Wang wrote: 在 2022/10/26 09:10, Si-Wei Liu 写道: On 10/24/2022 7:24 PM, Jason Wang wrote: On Tue, Oct 25, 2022 at 3:14 AM Si-Wei Liu wrote: On 10/24/2022 1:40 AM

Re: [PATCH V2] vdpa: allow provisioning device features

2022-11-22 Thread Si-Wei Liu
On 11/16/2022 7:33 PM, Jason Wang wrote: This patch allows device features to be provisioned via vdpa. This will be useful for preserving migration compatibility between source and destination: # vdpa dev add name dev1 mgmtdev pci/:02:00.0 device_features 0x30002 Miss the actual "vdp

Re: [PATCH V2] vdpa: allow provisioning device features

2022-11-23 Thread Si-Wei Liu
On 11/22/2022 7:35 PM, Jason Wang wrote: On Wed, Nov 23, 2022 at 6:29 AM Si-Wei Liu wrote: On 11/16/2022 7:33 PM, Jason Wang wrote: This patch allows device features to be provisioned via vdpa. This will be useful for preserving migration compatibility between source and destination

Re: [PATCH] vdpa: merge functionally duplicated dev_features attributes

2022-11-23 Thread Si-Wei Liu
already hinders further vdpa tool development and iproute integration around VDPA_ATTR_DEV_FEATURES... Thanks, -Siwei On 10/11/2022 8:07 PM, Jason Wang wrote: On Tue, Oct 11, 2022 at 2:32 AM Si-Wei Liu wrote: We can merge VDPA_ATTR_VDPA_DEV_SUPPORTED_FEATURES with VDPA_ATTR_DEV_FEATURES which is

Re: [PATCH V2] vdpa: allow provisioning device features

2022-11-30 Thread Si-Wei Liu
Sorry for getting back late due to the snag of the holidays. On 11/23/2022 11:13 PM, Jason Wang wrote: On Thu, Nov 24, 2022 at 6:53 AM Si-Wei Liu wrote: On 11/22/2022 7:35 PM, Jason Wang wrote: On Wed, Nov 23, 2022 at 6:29 AM Si-Wei Liu wrote: On 11/16/2022 7:33 PM, Jason Wang wrote

Re: [PATCH V2] vdpa: allow provisioning device features

2022-12-05 Thread Si-Wei Liu
On 12/4/2022 10:46 PM, Jason Wang wrote: On Thu, Dec 1, 2022 at 8:53 AM Si-Wei Liu wrote: Sorry for getting back late due to the snag of the holidays. No worries :) On 11/23/2022 11:13 PM, Jason Wang wrote: On Thu, Nov 24, 2022 at 6:53 AM Si-Wei Liu wrote: On 11/22/2022 7:35 PM

Re: [PATCH V2] vdpa: allow provisioning device features

2022-12-06 Thread Si-Wei Liu
On 12/5/2022 7:14 PM, Jason Wang wrote: On Tue, Dec 6, 2022 at 9:43 AM Si-Wei Liu wrote: On 12/4/2022 10:46 PM, Jason Wang wrote: On Thu, Dec 1, 2022 at 8:53 AM Si-Wei Liu wrote: Sorry for getting back late due to the snag of the holidays. No worries :) On 11/23/2022 11:13 PM, Jason

Re: [PATCH v3 3/4] vdpa: show dev config as-is in "vdpa dev show" output

2022-12-20 Thread Si-Wei Liu
On 12/18/2022 10:31 PM, Michael S. Tsirkin wrote: On Fri, Oct 28, 2022 at 04:23:49PM -0700, Si-Wei Liu wrote: I can post a v3 that shows the code, it shouldn't be too hard. I take it another version of this patchset is planned? Yes, I saw you just merged "vdpa: merge fu

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

2023-01-30 Thread Si-Wei Liu
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 while this series was being developed, which

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

2023-01-30 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 2/6] vdpa: conditionally read STATUS in config space

2023-01-30 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 3/6] vdpa: validate provisioned device features against specified attribute

2023-01-30 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 4/6] virtio: VIRTIO_DEVICE_F_MASK for all per-device features

2023-01-30 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

<    1   2   3   4   5   >