[PATCH] vdpa/mlx5: Set err = -ENOMEM in case dma_map_sg_attrs fails

2021-04-11 Thread Eli Cohen
Set err = -ENOMEM if dma_map_sg_attrs() fails so the function reutrns error. Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Eli Cohen Reported-by: kernel test robot Reported-by: Dan Carpenter --- drivers/vdpa/mlx5/core/mr.c | 4 +++- 1 file

[PATCH] vdpa/mlx5: Enable user to add/delete vdpa device

2021-04-08 Thread Eli Cohen
show vdpa0: type network mgmtdev pci/:3b:00.1 vendor_id max_vqs 16 \ max_vq_size 256 Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit Acked-by: Jason Wang --- This patch is just a resend of rebased version over the previous fixes sent by me minutes ago. drivers/vdpa/mlx5/net

[PATCH 4/5] vdpa/mlx5: Fix wrong use of bit numbers

2021-04-08 Thread Eli Cohen
VIRTIO_F_VERSION_1 is a bit number. Use BIT_ULL() with mask conditionals. Also, in mlx5_vdpa_is_little_endian() use BIT_ULL for consistency with the rest of the code. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- drivers

[PATCH 5/5] vdpa/mlx5: Fix suspend/resume index restoration

2021-04-08 Thread Eli Cohen
of hardware used index. Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 21

[PATCH 3/5] vdpa/mlx5: Retrieve BAR address suitable any function

2021-04-08 Thread Eli Cohen
struct mlx5_core_dev has a bar_addr field that contains the correct bar address for the function regardless of whether it is pci function or sub function. Use it. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --

[PATCH 2/5] vdpa/mlx5: Use the correct dma device when registering memory

2021-04-08 Thread Eli Cohen
In cases where the vdpa instance uses a SF (sub function), the DMA device is the parent device. Use a function to retrieve the correct DMA device. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --- drivers/vdpa

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

2021-04-08 Thread Eli Cohen
ra lengths starting from the 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/m

[PATCH 0/5] VDPA mlx5 fixes

2021-04-08 Thread Eli Cohen
ed in Parav's series http://lists.infradead.org/pipermail/linux-mtd/2016-January/064878.html but that series will be sent again at a later time. Eli Cohen (4): vdpa/mlx5: Use the correct dma device when registering memory vdpa/mlx5: Retrieve BAR address suitable any function vdpa/mlx5: Fix

Re: [PATCH] vdpa/mlx5: Fix wrong use of bit numbers

2021-03-02 Thread Eli Cohen
On Mon, Mar 01, 2021 at 10:33:14AM -0500, Michael S. Tsirkin wrote: > On Mon, Mar 01, 2021 at 03:52:45PM +0800, Jason Wang wrote: > > > > On 2021/3/1 2:28 下午, Eli Cohen wrote: > > > VIRTIO_F_VERSION_1 is a bit number. Use BIT_ULL() with mask > > > co

[PATCH] vdpa/mlx5: Fix wrong use of bit numbers

2021-02-28 Thread Eli Cohen
VIRTIO_F_VERSION_1 is a bit number. Use BIT_ULL() with mask conditionals. Also, in mlx5_vdpa_is_little_endian() use BIT_ULL for consistency with the rest of the code. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- drivers

Not yet merged patches

2021-02-28 Thread Eli Cohen
Hi Michael, I see that you did not include these in your latest pull request. https://lkml.org/lkml/2021/2/10/1386 https://lkml.org/lkml/2021/2/10/1383 https://lkml.org/lkml/2021/2/18/124 Are you going to merge them?

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

2021-02-24 Thread Eli Cohen
On Wed, Feb 24, 2021 at 02:12:01AM -0500, Michael S. Tsirkin wrote: > On Wed, Feb 24, 2021 at 02:55:13PM +0800, Jason Wang wrote: > > > > On 2021/2/24 2:47 下午, Michael S. Tsirkin wrote: > > > On Wed, Feb 24, 2021 at 08:45:20AM +0200, Eli Cohen wrote: > > > >

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

2021-02-23 Thread Eli Cohen
On Wed, Feb 24, 2021 at 02:55:13PM +0800, Jason Wang wrote: > > On 2021/2/24 2:47 下午, Michael S. Tsirkin wrote: > > On Wed, Feb 24, 2021 at 08:45:20AM +0200, Eli Cohen wrote: > > > On Wed, Feb 24, 2021 at 12:17:58AM -0500, Michael S. Tsirkin wrote: > > > > On Wed,

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

2021-02-23 Thread Eli Cohen
On Wed, Feb 24, 2021 at 12:17:58AM -0500, Michael S. Tsirkin wrote: > On Wed, Feb 24, 2021 at 11:20:01AM +0800, Jason Wang wrote: > > > > On 2021/2/24 3:35 上午, 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, Ja

Re: [PATCH v2] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-23 Thread Eli Cohen
On Tue, Feb 23, 2021 at 07:56:16AM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 23, 2021 at 02:54:42PM +0200, Eli Cohen wrote: > > On Tue, Feb 23, 2021 at 07:52:34AM -0500, Michael S. Tsirkin wrote: > > > > > > I think I have them in the linux next branch, no? >

Re: [PATCH v2] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-23 Thread Eli Cohen
On Tue, Feb 23, 2021 at 07:52:34AM -0500, Michael S. Tsirkin wrote: > > I think I have them in the linux next branch, no? > You do.

Re: [PATCH] vdpa/mlx5: Extract correct pointer from driver data

2021-02-23 Thread Eli Cohen
On Tue, Feb 23, 2021 at 07:32:49AM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 16, 2021 at 07:50:21AM +0200, Eli Cohen wrote: > > struct mlx5_vdpa_net pointer was stored in drvdata. Extract it as well > > in mlx5v_remove(). > > > > Fixes: 74c9729dd892 ("

Re: [PATCH v2] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-23 Thread Eli Cohen
On Tue, Feb 23, 2021 at 07:29:32AM -0500, Michael S. Tsirkin wrote: > On Thu, Feb 18, 2021 at 09:41:57AM +0200, Eli Cohen wrote: > > Allow to control vdpa device creation and destruction using the vdpa > > management tool. > > > > Examples: > > 1. List the mana

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

2021-02-21 Thread Eli Cohen
On Sun, Feb 21, 2021 at 04:52:05PM -0500, Michael S. Tsirkin wrote: > On Sun, Feb 21, 2021 at 04:44:37PM +0200, Eli Cohen wrote: > > On Fri, Feb 19, 2021 at 06:54:58AM -0500, Si-Wei Liu wrote: > > > Commit 452639a64ad8 ("vdpa: make sure set_features is invoked > > >

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

2021-02-21 Thread Eli Cohen
On Fri, Feb 19, 2021 at 06:54:58AM -0500, 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 relieve the verify_min_features

[PATCH v1] vdpa/mlx5: Fix suspend/resume index restoration

2021-02-17 Thread Eli Cohen
of hardware used index. Fixes: b35ccebe3ef7 ("vdpa/mlx5: Restore the hardware used index after change map") Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- v0->v1: Fix subject prefix drivers/vdpa/ml

[PATCH v2] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-17 Thread Eli Cohen
show vdpa0: type network mgmtdev pci/:3b:00.1 vendor_id max_vqs 16 \ max_vq_size 256 Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --- v0->v1: set mgtdev->ndev NULL on dev delete v1->v2: Resend drivers/vdpa/mlx5/net/mlx5_vnet.c | 79 +++ 1 fil

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

2021-02-17 Thread Eli Cohen
On Wed, Feb 17, 2021 at 04:20:14PM -0500, 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

Re: [PATCH 2/2 v1] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-17 Thread Eli Cohen
On Wed, Feb 17, 2021 at 12:13:37PM -0500, Michael S. Tsirkin wrote: > On Wed, Feb 17, 2021 at 01:31:36PM +0200, Eli Cohen wrote: > > Allow to control vdpa device creation and destruction using the vdpa > > management tool. > > > > Examples: > > 1. List the mana

[PATCH 2/2 v1] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-17 Thread Eli Cohen
show vdpa0: type network mgmtdev pci/:3b:00.1 vendor_id max_vqs 16 \ max_vq_size 256 Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --- v0->v1: set mgtdev->ndev NULL on dev delete drivers/vdpa/mlx5/net/mlx5_vnet.c | 79 +++ 1 file chang

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

2021-02-16 Thread Eli Cohen
On Tue, Feb 16, 2021 at 04:25:20PM -0800, Si-Wei Liu wrote: > > > > The saved mvq->avail_idx will be used to recreate hardware virtq object > > > and > > > the used index in create_virtqueue(), once status DRIVER_OK is set. I > > > suspect we should pass the index to mvq->used_idx in > > > mlx5_v

[PATCH 2/2] vdpa/mlx5: Enable user to add/delete vdpa device

2021-02-16 Thread Eli Cohen
show vdpa0: type network mgmtdev pci/:3b:00.1 vendor_id max_vqs 16 \ max_vq_size 256 Signed-off-by: Eli Cohen Reviewed-by: Parav Pandit --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 76 +++ 1 file changed, 67 insertions(+), 9 deletions(-) diff --git a/drivers

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

2021-02-16 Thread Eli Cohen
of hardware used index. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c

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

2021-02-16 Thread Eli Cohen
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 device. The

Re: [PATCH] vdpa/mlx5: Extract correct pointer from driver data

2021-02-16 Thread Eli Cohen
On Tue, Feb 16, 2021 at 09:37:34AM +0200, Leon Romanovsky wrote: > On Tue, Feb 16, 2021 at 08:42:26AM +0200, Eli Cohen wrote: > > On Tue, Feb 16, 2021 at 08:35:51AM +0200, Leon Romanovsky wrote: > > > On Tue, Feb 16, 2021 at 07:50:22AM +0200, Eli Cohen wrote: > > > >

Re: [PATCH] vdpa/mlx5: Extract correct pointer from driver data

2021-02-15 Thread Eli Cohen
On Tue, Feb 16, 2021 at 08:35:51AM +0200, Leon Romanovsky wrote: > On Tue, Feb 16, 2021 at 07:50:22AM +0200, Eli Cohen wrote: > > struct mlx5_vdpa_net pointer was stored in drvdata. Extract it as well > > in mlx5v_remove(). > > > > Fixes: 74c9729dd892 ("vdpa/mlx5

[PATCH] vdpa/mlx5: Extract correct pointer from driver data

2021-02-15 Thread Eli Cohen
struct mlx5_vdpa_net pointer was stored in drvdata. Extract it as well in mlx5v_remove(). Fixes: 74c9729dd892 ("vdpa/mlx5: Connect mlx5_vdpa to auxiliary bus") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) di

[PATCH] vdpa/mlx5: Extract correct pointer from driver data

2021-02-15 Thread Eli Cohen
struct mlx5_vdpa_net pointer was stored in drvdata. Extract it as well in mlx5v_remove(). Fixes: 74c9729dd892 ("vdpa/mlx5: Connect mlx5_vdpa to auxiliary bus") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) di

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

2021-02-10 Thread Eli Cohen
> map") > Signed-off-by: Si-Wei Liu > Acked-by: Jason Wang Acked-by: Eli Cohen > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c > b/drivers/vdpa/mlx5/ne

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

2021-02-10 Thread Eli Cohen
ssume tx checksum offload > is available after reset and feature negotiation, > causing frames with bogus (incomplete) checksum > transmitted on the wire. > > 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-10 Thread Eli Cohen
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: > > > > > >

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

2021-02-08 Thread Eli Cohen
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:27PM +0800, Jason Wang wrote: > > > On 2021/2/8 下午2:37, Eli Cohen wrote: > > > > On Mon, Feb 08, 2021 at 12:27:18PM +0800, Jason

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

2021-02-08 Thread Eli Cohen
On Mon, Feb 08, 2021 at 05:04:27PM +0800, Jason Wang wrote: > > On 2021/2/8 下午2:37, Eli Cohen wrote: > > On Mon, Feb 08, 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

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

2021-02-07 Thread Eli Cohen
On Mon, Feb 08, 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

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

2021-02-07 Thread Eli Cohen
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 once device is started. Commit > b35ccebe3

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

2021-02-07 Thread Eli Cohen
s not just contain the > Ethernet payload, but includes extra lengths starting > from the Ethernet header up to the FCS altogether. > > Fix the MTU so packets won't get dropped silently. > > Signed-off-by: Si-Wei Liu Acked-by: Eli Cohen > --- > drivers/vdpa/mlx5/

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

2021-02-07 Thread Eli Cohen
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 static > and does not change across re

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

2021-02-03 Thread Eli Cohen
to reset the available and used indices upon device reset, fix this here to avoid regression caused by the fact that used index may not be zero upon device reset. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- v0 -> v1: Clear

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

2021-02-03 Thread Eli Cohen
On Wed, Feb 03, 2021 at 12:33:26PM -0800, Si-Wei Liu wrote: > On Tue, Feb 2, 2021 at 10:48 PM Eli Cohen wrote: > > > > On Tue, Feb 02, 2021 at 09:14:02AM -0800, Si-Wei Liu wrote: > > > On Tue, Feb 2, 2021 at 6:34 AM Eli Cohen wrote: > > > > > > &

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

2021-02-03 Thread Eli Cohen
On Wed, Feb 03, 2021 at 12:33:26PM -0800, Si-Wei Liu wrote: > On Tue, Feb 2, 2021 at 10:48 PM Eli Cohen wrote: > > > > On Tue, Feb 02, 2021 at 09:14:02AM -0800, Si-Wei Liu wrote: > > > On Tue, Feb 2, 2021 at 6:34 AM Eli Cohen wrote: > > > > > > &

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-03 Thread Eli Cohen
On Wed, Feb 03, 2021 at 03:19:40PM -0800, Si-Wei Liu wrote: > On Tue, Feb 2, 2021 at 9:16 PM Jason Wang wrote: > > > > > > On 2021/2/3 上午1:54, Si-Wei Liu wrote: > > > On Tue, Feb 2, 2021 at 1:23 AM Eli Cohen wrote: > > >> On Tue, Feb 02, 2021 at 12:38:51

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

2021-02-02 Thread Eli Cohen
On Tue, Feb 02, 2021 at 09:14:02AM -0800, Si-Wei Liu wrote: > On Tue, Feb 2, 2021 at 6:34 AM 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 > &

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

2021-02-02 Thread Eli Cohen
/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- This patch is being sent again a single patch the fixes hot memory addtion to a qemy process. drivers/vdpa/mlx5/net/mlx5_vnet.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/vdpa/mlx5/net/mlx5

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-02 Thread Eli Cohen
On Tue, Feb 02, 2021 at 12:38:51AM -0800, Si-Wei Liu wrote: > Thanks Eli and Jason for clarifications. See inline. > > On Mon, Feb 1, 2021 at 11:06 PM Eli Cohen wrote: > > > > On Tue, Feb 02, 2021 at 02:02:25PM +0800, Jason Wang wrote: > > > > > >

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-01 Thread Eli Cohen
Liu > > > > wrote: > > > > > On Thu, Jan 28, 2021 at 5:46 AM Eli Cohen wrote: > > > > > > suspend_vq should only suspend the VQ on not save the current > > > > > > available > > > > > > index. This is done when a ch

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-01 Thread Eli Cohen
On Mon, Feb 01, 2021 at 08:15:29PM -0800, Si-Wei Liu wrote: > On Mon, Feb 1, 2021 at 7:13 PM Jason Wang wrote: > > > > > > On 2021/2/2 上午3:17, Si-Wei Liu wrote: > > > On Mon, Feb 1, 2021 at 10:51 AM Si-Wei Liu > > > wrote: > > >&g

Re: [PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-02-01 Thread Eli Cohen
On Tue, Feb 02, 2021 at 11:12:51AM +0800, Jason Wang wrote: > > On 2021/2/2 上午3:17, Si-Wei Liu wrote: > > On Mon, Feb 1, 2021 at 10:51 AM Si-Wei Liu wrote: > > > On Thu, Jan 28, 2021 at 5:46 AM Eli Cohen wrote: > > > > suspend_vq should only suspend the VQ

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

2021-01-31 Thread Eli Cohen
On Mon, Feb 01, 2021 at 02:00:35PM +0800, Jason Wang wrote: > > On 2021/2/1 下午1:52, Eli Cohen wrote: > > On Mon, Feb 01, 2021 at 11:36:23AM +0800, Jason Wang wrote: > > > On 2021/2/1 上午2:55, Eli Cohen wrote: > > > > On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jaso

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

2021-01-31 Thread Eli Cohen
On Mon, Feb 01, 2021 at 11:36:23AM +0800, Jason Wang wrote: > > On 2021/2/1 上午2:55, Eli Cohen wrote: > > On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jason Wang wrote: > > > On 2021/1/28 下午9:41, Eli Cohen wrote: > > > > When a change of memory map occurs, the

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

2021-01-31 Thread Eli Cohen
On Fri, Jan 29, 2021 at 11:49:45AM +0800, Jason Wang wrote: > > On 2021/1/28 下午9:41, 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 th

[PATCH 0/2] Fix failure to hot add memory

2021-01-28 Thread Eli Cohen
code. The second on is the actual fix. Eli Cohen (2): vdpa/mlx5: Avoid unnecessary query virtqueue vdpa/mlx5: Restore the hardware used index after change map drivers/vdpa/mlx5/net/mlx5_vnet.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.29.2

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

2021-01-28 Thread Eli Cohen
/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c index 549ded074ff3..3fc8588cecae 100644 --- a/dr

[PATCH 1/2] vdpa/mlx5: Avoid unnecessary query virtqueue

2021-01-28 Thread Eli Cohen
suspend_vq should only suspend the VQ on not save the current available index. This is done when a change of map occurs when the driver calls save_channel_info(). Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/net/mlx5_vnet.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers

Re: [PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-20 Thread Eli Cohen
On Wed, Jan 20, 2021 at 03:52:00AM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 10:11:54AM +0200, Eli Cohen wrote: > > On Wed, Jan 20, 2021 at 02:57:05AM -0500, Michael S. Tsirkin wrote: > > > On Wed, Jan 20, 2021 at 07:36:19AM +0200, Eli Cohen wrote: > > >

Re: [PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-20 Thread Eli Cohen
On Wed, Jan 20, 2021 at 02:57:05AM -0500, Michael S. Tsirkin wrote: > On Wed, Jan 20, 2021 at 07:36:19AM +0200, Eli Cohen wrote: > > On Fri, Jan 08, 2021 at 04:38:55PM +0800, Jason Wang wrote: > > > > Hi Michael, > > this patch is a fix. Are you going to merge it?

Re: [PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-19 Thread Eli Cohen
On Fri, Jan 08, 2021 at 04:38:55PM +0800, Jason Wang wrote: Hi Michael, this patch is a fix. Are you going to merge it? > > On 2021/1/7 下午3:18, Eli Cohen wrote: > > map_direct_mr() assumed that the number of scatter/gather entries > > returned by dma_map_sg_attrs() was equa

Re: [PATCH 21/21] vdpasim: control virtqueue support

2021-01-11 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:18PM +0800, Jason Wang wrote: > This patch introduces the control virtqueue support for vDPA > simulator. This is a requirement for supporting advanced features like > multiqueue. > > A requirement for control virtqueue is to isolate its memory access > from the rx/tx

[PATCH v1] vdpa/mlx5: Fix memory key MTT population

2021-01-06 Thread Eli Cohen
f fill_sg() which effect is overwritten by populate_mtts(). Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Eli Cohen --- V0->V1: 1. Fix typos 2. Improve changelog drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 + drivers/vdpa/mlx5

Re: [PATCH] vdpa/mlx5: Fix memory key MTT population

2021-01-06 Thread Eli Cohen
On Thu, Jan 07, 2021 at 12:15:53PM +0800, Jason Wang wrote: > > On 2021/1/6 下午5:05, Eli Cohen wrote: > > map_direct_mr() assumed that the number of scatter/gather entries > > returned by dma_map_sg_attrs() was equal to the number of segments in > > the sgl list. This le

[PATCH] vdpa/mlx5: Fix memory key MTT population

2021-01-06 Thread Eli Cohen
effect is overwritten bu populate_mtts(). Fixes: 94abbccdf291 ("vdpa/mlx5: Add shared memory registration code") Signed-off-by: Eli Cohen --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 + drivers/vdpa/mlx5/core/mr.c| 28 2 files changed, 13 inserti

Re: [PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-30 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:09PM +0800, Jason Wang wrote: > Follows the vDPA support for multiple address spaces, this patch > introduce uAPI for the userspace to know the number of virtqueue > groups supported by the vDPA device. > > Signed-off-by: Jason Wang > --- > drivers/vhost/vdpa.c

Re: [PATCH 07/21] vdpa: multiple address spaces support

2020-12-30 Thread Eli Cohen
On Wed, Dec 30, 2020 at 12:04:30PM +0800, Jason Wang wrote: > > On 2020/12/29 下午3:28, Eli Cohen wrote: > > > @@ -43,6 +43,8 @@ struct vdpa_vq_state { > > >* @index: device index > > >* @features_valid: were features initialized? for legacy guests > >

Re: [PATCH 12/21] vhost-vdpa: introduce uAPI to get the number of virtqueue groups

2020-12-29 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:09PM +0800, Jason Wang wrote: > Follows the vDPA support for multiple address spaces, this patch > introduce uAPI for the userspace to know the number of virtqueue > groups supported by the vDPA device. Can you explain what exactly you mean be userspace? Is it just qe

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:08PM +0800, Jason Wang wrote: > This patch converts the vhost-vDPA device to support multiple IOTLBs > tagged via ASID via hlist. This will be used for supporting multiple > address spaces in the following patches. > > Signed-off-by: Jason Wang > --- > drivers/vhost

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:08PM +0800, Jason Wang wrote: > This patch converts the vhost-vDPA device to support multiple IOTLBs > tagged via ASID via hlist. This will be used for supporting multiple > address spaces in the following patches. > > Signed-off-by: Jason Wang > --- > drivers/vhost

Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB

2020-12-29 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:08PM +0800, Jason Wang wrote: > This patch converts the vhost-vDPA device to support multiple IOTLBs > tagged via ASID via hlist. This will be used for supporting multiple > address spaces in the following patches. > > Signed-off-by: Jason Wang > --- > drivers/vhost

Re: [PATCH 10/21] vhost: support ASID in IOTLB API

2020-12-29 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:07PM +0800, Jason Wang wrote: > This patches allows userspace to send ASID based IOTLB message to > vhost. This idea is to use the reserved u32 field in the existing V2 > IOTLB message. Vhost device should advertise this capability via > VHOST_BACKEND_F_IOTLB_ASID back

Re: [PATCH 07/21] vdpa: multiple address spaces support

2020-12-28 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:48:04PM +0800, Jason Wang wrote: > This patches introduces the multiple address spaces support for vDPA > device. This idea is to identify a specific address space via an > dedicated identifier - ASID. > > During vDPA device allocation, vDPA device driver needs to report

Re: [PATCH 00/21] Control VQ support in vDPA

2020-12-16 Thread Eli Cohen
On Wed, Dec 16, 2020 at 02:47:57PM +0800, Jason Wang wrote: Hi Jason, I saw the patchset and will start reviewing it starting Dec 27. I am out of office next week. > Hi All: > > This series tries to add the support for control virtqueue in vDPA. > > Control virtqueue is used by networking devic

Re: [PATCH mlx5-next 11/16] net/mlx5: Add VDPA priority to NIC RX namespace

2020-11-24 Thread Eli Cohen
> On Sun, 22 Nov 2020 08:41:58 +0200 Eli Cohen wrote: > > > > > On Sat, Nov 21, 2020 at 04:01:55PM -0800, Jakub Kicinski wrote: > > > > > > On Fri, 20 Nov 2020 15:03:34 -0800 Saeed Mahameed wrote: > > > > > > > From: Eli Cohen > &g

Re: [PATCH mlx5-next 11/16] net/mlx5: Add VDPA priority to NIC RX namespace

2020-11-21 Thread Eli Cohen
On Sat, Nov 21, 2020 at 04:01:55PM -0800, Jakub Kicinski wrote: > On Fri, 20 Nov 2020 15:03:34 -0800 Saeed Mahameed wrote: > > From: Eli Cohen > > > > Add a new namespace type to the NIC RX root namespace to allow for > > inserting VDPA rules before regular NIC but

Re: mlx5_vdpa problem

2020-11-01 Thread Eli Cohen
le hw-offload, So the packet don't go through rep port of VF. > But there are the same problems. I think it maybe a FW bug. Thx. I will refer you to firmware engineer to work with. > > On 10/29/2020 8:45 PM, Eli Cohen wrote: > > On Thu, Oct 22, 2020 at 06:40:56PM +080

Re: mlx5_vdpa problem

2020-10-29 Thread Eli Cohen
On Thu, Oct 22, 2020 at 06:40:56PM +0800, wenxu wrote: Please make sure your firmware is updated. https://www.mellanox.com/support/firmware/connectx6dx > > Hi mellanox team, > > > I test the mlx5 vdpa  in linux-5.9 and meet several problem. > > > # lspci | grep Ether | grep Dx > b3:00.0 Eth

Re: mlx5_vdpa problem

2020-10-29 Thread Eli Cohen
On Thu, Oct 22, 2020 at 06:40:56PM +0800, wenxu wrote: > > Hi mellanox team, > > > I test the mlx5 vdpa  in linux-5.9 and meet several problem. > > > # lspci | grep Ether | grep Dx > b3:00.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 > Dx] > b3:00.1 Ethernet controll

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Eli Cohen
On Thu, Oct 29, 2020 at 04:08:24PM +0800, Jason Wang wrote: > > On 2020/10/29 下午3:50, Eli Cohen wrote: > > On Thu, Oct 29, 2020 at 03:39:24PM +0800, Jason Wang wrote: > > > On 2020/10/29 下午3:37, Eli Cohen wrote: > > > > On Thu, Oct 29, 2020 at 03:03:24PM +0800, Ja

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Eli Cohen
On Thu, Oct 29, 2020 at 03:39:24PM +0800, Jason Wang wrote: > > On 2020/10/29 下午3:37, Eli Cohen wrote: > > On Thu, Oct 29, 2020 at 03:03:24PM +0800, Jason Wang wrote: > > > On 2020/10/28 下午10:20, Eli Cohen wrote: > > > > Both irq_bypass_register_producer() a

Re: [PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-29 Thread Eli Cohen
On Thu, Oct 29, 2020 at 03:03:24PM +0800, Jason Wang wrote: > > On 2020/10/28 下午10:20, Eli Cohen wrote: > > Both irq_bypass_register_producer() and irq_bypass_unregister_producer() > > require process context to run. Change the call context lock from > > spinlock to mu

[PATCH] vhost: Use mutex to protect vq_irq setup

2020-10-28 Thread Eli Cohen
Both irq_bypass_register_producer() and irq_bypass_unregister_producer() require process context to run. Change the call context lock from spinlock to mutex to protect the setup process to avoid deadlocks. Fixes: 265a0ad8731d ("vhost: introduce vhost_vring_call") Signed-off-by:

Re: [PATCH net] vdpa/mlx5: Fix miss to set VIRTIO_NET_S_LINK_UP for virtio_net_config

2020-10-20 Thread Eli Cohen
On Tue, Oct 20, 2020 at 10:03:00AM +0800, Jason Wang wrote: > > On 2020/10/19 下午5:07, we...@ucloud.cn wrote: > > From: wenxu > > > > Qemu get virtio_net_config from the vdpa driver. So The vdpa driver > > should set the VIRTIO_NET_S_LINK_UP flag to virtio_net_config like > > vdpa_sim. Or the lin

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-12 Thread Eli Cohen
On Mon, Oct 12, 2020 at 03:45:10PM +0800, Jason Wang wrote: > > > > > So in theory we can have several asid's (for different virtqueues), each > > one should be followed by a specific set_map call. If this is so, how do > > I know if I met all the conditions run my driver? Maybe we need another >

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-12 Thread Eli Cohen
On Fri, Oct 09, 2020 at 11:56:45AM +0800, Jason Wang wrote: > > On 2020/10/1 下午9:29, Eli Cohen wrote: > > On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote: > > > This patch introduces a new bus operation to allow the vDPA bus driver > > > to associat

[PATCH] vdpa/mlx5: Fix dependency on MLX5_CORE

2020-10-06 Thread Eli Cohen
by: kernel test robot Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 device")s Signed-off-by: Eli Cohen --- drivers/vdpa/Kconfig | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig index a8c7607fdc90.

Re: [PATCH] vdpa/mlx5: should keep avail_index despite device status

2020-10-05 Thread Eli Cohen
On Tue, Oct 06, 2020 at 02:22:15AM -0400, Michael S. Tsirkin wrote: Acked-by: Eli Cohen > On Fri, Oct 02, 2020 at 01:17:00PM -0700, Si-Wei Liu wrote: > > + Eli. > > > > On Thu, Oct 1, 2020 at 2:02 PM Si-Wei Liu wrote: > > > > > > A VM with mlx5 vD

Re: [RFC PATCH 10/24] vdpa: introduce config operations for associating ASID to a virtqueue group

2020-10-01 Thread Eli Cohen
On Thu, Sep 24, 2020 at 11:21:11AM +0800, Jason Wang wrote: > This patch introduces a new bus operation to allow the vDPA bus driver > to associate an ASID to a virtqueue group. > So in case of virtio_net, I would expect that all the data virtqueues will be associated with the same address space i

Re: [RFC PATCH 09/24] vdpa: multiple address spaces support

2020-10-01 Thread Eli Cohen
On Thu, Sep 24, 2020 at 11:21:10AM +0800, Jason Wang wrote: > This patches introduces the multiple address spaces support for vDPA > device. This idea is to identify a specific address space via an > dedicated identifier - ASID. > > During vDPA device allocation, vDPA device driver needs to report

Re: [RFC PATCH 09/24] vdpa: multiple address spaces support

2020-10-01 Thread Eli Cohen
On Thu, Sep 24, 2020 at 11:21:10AM +0800, Jason Wang wrote: > This patches introduces the multiple address spaces support for vDPA > device. This idea is to identify a specific address space via an > dedicated identifier - ASID. > > During vDPA device allocation, vDPA device driver needs to report

Re: [RFC PATCH 06/24] vhost-vdpa: switch to use vhost-vdpa specific IOTLB

2020-09-30 Thread Eli Cohen
On Thu, Sep 24, 2020 at 11:21:07AM +0800, Jason Wang wrote: > To ease the implementation of per group ASID support for vDPA > device. This patch switches to use a vhost-vdpa specific IOTLB to > avoid the unnecessary refactoring of the vhost core. > > Signed-off-by: Jason Wang > --- > drivers/vho

Re: [RFC PATCH 05/24] vhost-vdpa: passing iotlb to IOMMU mapping helpers

2020-09-30 Thread Eli Cohen
On Thu, Sep 24, 2020 at 11:21:06AM +0800, Jason Wang wrote: > To prepare for the ASID support for vhost-vdpa, try to pass IOTLB > object to dma helpers. Maybe it's worth mentioning here that this patch does not change any functionality and is presented as a preparation for passing different iotlb'

Re: [PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module

2020-09-29 Thread Eli Cohen
On Tue, Sep 29, 2020 at 03:17:05AM -0400, Michael S. Tsirkin wrote: > > > > Use "select MLX5_CORE" > > instead of "depends on MLX5_CORE" > > > > Wasn't this agreed upon? > > Hmm I don't know. I recall a similar discussion around VHOST_IOTLB. > That's different ... I see. > > I see > > [linux

Re: [PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module

2020-09-28 Thread Eli Cohen
On Tue, Sep 29, 2020 at 02:51:12AM -0400, Michael S. Tsirkin wrote: > On Tue, Sep 29, 2020 at 09:34:33AM +0300, Eli Cohen wrote: > > On Tue, Sep 29, 2020 at 02:26:44AM -0400, Michael S. Tsirkin wrote: > > > On Tue, Sep 29, 2020 at 09:20:26AM +0300, Eli Cohen wrote: > > >

Re: [PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module

2020-09-28 Thread Eli Cohen
On Tue, Sep 29, 2020 at 02:26:44AM -0400, Michael S. Tsirkin wrote: > On Tue, Sep 29, 2020 at 09:20:26AM +0300, Eli Cohen wrote: > > On Mon, Sep 28, 2020 at 03:55:09PM -0400, Michael S. Tsirkin wrote: > > > On Thu, Sep 24, 2020 at 05:32:31PM +0300, Eli Cohen wrote: > &

Re: [PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module

2020-09-28 Thread Eli Cohen
On Mon, Sep 28, 2020 at 03:55:09PM -0400, Michael S. Tsirkin wrote: > On Thu, Sep 24, 2020 at 05:32:31PM +0300, Eli Cohen wrote: > > Change core vdpa functionality into a loadbale module such that upcoming > > block implementation will be able to use it. > > > > Signed-

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-28 Thread Eli Cohen
On Fri, Sep 25, 2020 at 06:20:45AM -0400, Michael S. Tsirkin wrote: > > > > > > Hmm other drivers select VHOST_IOTLB, why not do the same? > > > > I can't see another driver doing that. > > Well grep VHOST_IOTLB and you will see some examples. $ git grep -wn VHOST_IOTLB drivers/vhost/Kconfig:2:

[PATCH V1 vhost-next] vdpa/mlx5: Make vdpa core driver a distinct module

2020-09-24 Thread Eli Cohen
Change core vdpa functionality into a loadbale module such that upcoming block implementation will be able to use it. Signed-off-by: Eli Cohen --- V0 --> V1: Removed "default n" for configu options as 'n' is the default drivers/vdpa/Kconfig | 8 +++-

Re: [PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors

2020-09-24 Thread Eli Cohen
On Thu, Sep 24, 2020 at 05:30:55AM -0400, Michael S. Tsirkin wrote: > > > --- linux-next-20200917.orig/drivers/vdpa/Kconfig > > > +++ linux-next-20200917/drivers/vdpa/Kconfig > > > @@ -31,7 +31,7 @@ config IFCVF > > > > > > config MLX5_VDPA > > > bool "MLX5 VDPA support library for ConnectX devi

  1   2   >