linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH rdma-rc 0/3] irdma driver updates
@ 2022-02-24  0:58 Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shiraz Saleem @ 2022-02-24  0:58 UTC (permalink / raw)
  To: jgg, linux-rdma; +Cc: Shiraz Saleem

This series contains a set of irdma bug fixes for 5.17 cycle.

Mustafa Ismail (3):
  RDMA/irdma: Fix netdev notifications for vlan's
  RDMA/irdma: Fix Passthrough mode in VM
  RDMA/irdma: Remove incorrect masking of PD

 drivers/infiniband/hw/irdma/hw.c       |  2 +-
 drivers/infiniband/hw/irdma/i40iw_if.c |  1 +
 drivers/infiniband/hw/irdma/main.c     |  1 +
 drivers/infiniband/hw/irdma/main.h     |  1 +
 drivers/infiniband/hw/irdma/utils.c    | 10 ++++++++--
 drivers/infiniband/hw/irdma/verbs.c    |  4 ++--
 6 files changed, 14 insertions(+), 5 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's
  2022-02-24  0:58 [PATCH rdma-rc 0/3] irdma driver updates Shiraz Saleem
@ 2022-02-24  0:58 ` Shiraz Saleem
  2022-02-24 19:29   ` Leon Romanovsky
  2022-02-24  0:58 ` [PATCH rdma-rc 2/3] RDMA/irdma: Fix Passthrough mode in VM Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 3/3] RDMA/irdma: Remove incorrect masking of PD Shiraz Saleem
  2 siblings, 1 reply; 5+ messages in thread
From: Shiraz Saleem @ 2022-02-24  0:58 UTC (permalink / raw)
  To: jgg, linux-rdma; +Cc: Mustafa Ismail, Shiraz Saleem

From: Mustafa Ismail <mustafa.ismail@intel.com>

Currently, events on vlan netdevs are being ignored. Fix
this by finding the real netdev and processing the
notifications for vlan netdevs.

Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/utils.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
index 398736d..26407d8 100644
--- a/drivers/infiniband/hw/irdma/utils.c
+++ b/drivers/infiniband/hw/irdma/utils.c
@@ -155,6 +155,8 @@ int irdma_inetaddr_event(struct notifier_block *notifier, unsigned long event,
 	struct ib_device *ibdev;
 	u32 local_ipaddr;
 
+	if (is_vlan_dev(netdev))
+		netdev = vlan_dev_real_dev(netdev);
 	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
 	if (!ibdev)
 		return NOTIFY_DONE;
@@ -201,6 +203,8 @@ int irdma_inet6addr_event(struct notifier_block *notifier, unsigned long event,
 	struct ib_device *ibdev;
 	u32 local_ipaddr6[4];
 
+	if (is_vlan_dev(netdev))
+		netdev = vlan_dev_real_dev(netdev);
 	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
 	if (!ibdev)
 		return NOTIFY_DONE;
@@ -243,14 +247,16 @@ int irdma_net_event(struct notifier_block *notifier, unsigned long event,
 		    void *ptr)
 {
 	struct neighbour *neigh = ptr;
+	struct net_device *netdev = (struct net_device *)neigh->dev;
 	struct irdma_device *iwdev;
 	struct ib_device *ibdev;
 	__be32 *p;
 	u32 local_ipaddr[4] = {};
 	bool ipv4 = true;
 
-	ibdev = ib_device_get_by_netdev((struct net_device *)neigh->dev,
-					RDMA_DRIVER_IRDMA);
+	if (is_vlan_dev(netdev))
+		netdev = vlan_dev_real_dev(netdev);
+	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
 	if (!ibdev)
 		return NOTIFY_DONE;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH rdma-rc 2/3] RDMA/irdma: Fix Passthrough mode in VM
  2022-02-24  0:58 [PATCH rdma-rc 0/3] irdma driver updates Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
@ 2022-02-24  0:58 ` Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 3/3] RDMA/irdma: Remove incorrect masking of PD Shiraz Saleem
  2 siblings, 0 replies; 5+ messages in thread
From: Shiraz Saleem @ 2022-02-24  0:58 UTC (permalink / raw)
  To: jgg, linux-rdma; +Cc: Mustafa Ismail, Shiraz Saleem

From: Mustafa Ismail <mustafa.ismail@intel.com>

Using PCI_FUNC macro in a VM, when the device is in passthrough
mode does not provide the real function instance. This means that
currently, devices will not probe unless the instance in the VM
matches the instance in the host.

Fix this by getting the pf_id from the LAN during the probe.

Fixes: 8498a30e1b94 ("RDMA/irdma: Register auxiliary driver and implement private channel OPs")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/hw.c       | 2 +-
 drivers/infiniband/hw/irdma/i40iw_if.c | 1 +
 drivers/infiniband/hw/irdma/main.c     | 1 +
 drivers/infiniband/hw/irdma/main.h     | 1 +
 4 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/irdma/hw.c b/drivers/infiniband/hw/irdma/hw.c
index 89234d0..e46e324 100644
--- a/drivers/infiniband/hw/irdma/hw.c
+++ b/drivers/infiniband/hw/irdma/hw.c
@@ -1608,7 +1608,7 @@ static enum irdma_status_code irdma_initialize_dev(struct irdma_pci_f *rf)
 	info.fpm_commit_buf = mem.va;
 
 	info.bar0 = rf->hw.hw_addr;
-	info.hmc_fn_id = PCI_FUNC(rf->pcidev->devfn);
+	info.hmc_fn_id = rf->pf_id;
 	info.hw = &rf->hw;
 	status = irdma_sc_dev_init(rf->rdma_ver, &rf->sc_dev, &info);
 	if (status)
diff --git a/drivers/infiniband/hw/irdma/i40iw_if.c b/drivers/infiniband/hw/irdma/i40iw_if.c
index 43e962b..0886783 100644
--- a/drivers/infiniband/hw/irdma/i40iw_if.c
+++ b/drivers/infiniband/hw/irdma/i40iw_if.c
@@ -77,6 +77,7 @@ static void i40iw_fill_device_info(struct irdma_device *iwdev, struct i40e_info
 	rf->rdma_ver = IRDMA_GEN_1;
 	rf->gen_ops.request_reset = i40iw_request_reset;
 	rf->pcidev = cdev_info->pcidev;
+	rf->pf_id = cdev_info->fid;
 	rf->hw.hw_addr = cdev_info->hw_addr;
 	rf->cdev = cdev_info;
 	rf->msix_count = cdev_info->msix_count;
diff --git a/drivers/infiniband/hw/irdma/main.c b/drivers/infiniband/hw/irdma/main.c
index 9fab290..5e8e886 100644
--- a/drivers/infiniband/hw/irdma/main.c
+++ b/drivers/infiniband/hw/irdma/main.c
@@ -226,6 +226,7 @@ static void irdma_fill_device_info(struct irdma_device *iwdev, struct ice_pf *pf
 	rf->hw.hw_addr = pf->hw.hw_addr;
 	rf->pcidev = pf->pdev;
 	rf->msix_count =  pf->num_rdma_msix;
+	rf->pf_id = pf->hw.pf_id;
 	rf->msix_entries = &pf->msix_entries[pf->rdma_base_vector];
 	rf->default_vsi.vsi_idx = vsi->vsi_num;
 	rf->protocol_used = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ?
diff --git a/drivers/infiniband/hw/irdma/main.h b/drivers/infiniband/hw/irdma/main.h
index cb218ca..fb7faa8 100644
--- a/drivers/infiniband/hw/irdma/main.h
+++ b/drivers/infiniband/hw/irdma/main.h
@@ -257,6 +257,7 @@ struct irdma_pci_f {
 	u8 *mem_rsrc;
 	u8 rdma_ver;
 	u8 rst_to;
+	u8 pf_id;
 	enum irdma_protocol_used protocol_used;
 	u32 sd_type;
 	u32 msix_count;
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH rdma-rc 3/3] RDMA/irdma: Remove incorrect masking of PD
  2022-02-24  0:58 [PATCH rdma-rc 0/3] irdma driver updates Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
  2022-02-24  0:58 ` [PATCH rdma-rc 2/3] RDMA/irdma: Fix Passthrough mode in VM Shiraz Saleem
@ 2022-02-24  0:58 ` Shiraz Saleem
  2 siblings, 0 replies; 5+ messages in thread
From: Shiraz Saleem @ 2022-02-24  0:58 UTC (permalink / raw)
  To: jgg, linux-rdma; +Cc: Mustafa Ismail, Shiraz Saleem

From: Mustafa Ismail <mustafa.ismail@intel.com>

The PD id is masked with 0x7fff, while PD can be 18 bits for GEN2 HW.
Remove the masking as it should not be needed and can cause incorrect
PD id to be used.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 460e757..1bf6404 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -2509,7 +2509,7 @@ static int irdma_dealloc_mw(struct ib_mw *ibmw)
 	cqp_info = &cqp_request->info;
 	info = &cqp_info->in.u.dealloc_stag.info;
 	memset(info, 0, sizeof(*info));
-	info->pd_id = iwpd->sc_pd.pd_id & 0x00007fff;
+	info->pd_id = iwpd->sc_pd.pd_id;
 	info->stag_idx = ibmw->rkey >> IRDMA_CQPSQ_STAG_IDX_S;
 	info->mr = false;
 	cqp_info->cqp_cmd = IRDMA_OP_DEALLOC_STAG;
@@ -3021,7 +3021,7 @@ static int irdma_dereg_mr(struct ib_mr *ib_mr, struct ib_udata *udata)
 	cqp_info = &cqp_request->info;
 	info = &cqp_info->in.u.dealloc_stag.info;
 	memset(info, 0, sizeof(*info));
-	info->pd_id = iwpd->sc_pd.pd_id & 0x00007fff;
+	info->pd_id = iwpd->sc_pd.pd_id;
 	info->stag_idx = ib_mr->rkey >> IRDMA_CQPSQ_STAG_IDX_S;
 	info->mr = true;
 	if (iwpbl->pbl_allocated)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's
  2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
@ 2022-02-24 19:29   ` Leon Romanovsky
  0 siblings, 0 replies; 5+ messages in thread
From: Leon Romanovsky @ 2022-02-24 19:29 UTC (permalink / raw)
  To: Shiraz Saleem; +Cc: jgg, linux-rdma, Mustafa Ismail

On Wed, Feb 23, 2022 at 06:58:40PM -0600, Shiraz Saleem wrote:
> From: Mustafa Ismail <mustafa.ismail@intel.com>
> 
> Currently, events on vlan netdevs are being ignored. Fix
> this by finding the real netdev and processing the
> notifications for vlan netdevs.
> 
> Fixes: 915cc7ac0f8e ("RDMA/irdma: Add miscellaneous utility definitions")
> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/irdma/utils.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)

It is better to use the existing coding pattern.

real_dev = rdma_vlan_dev_real_dev(netdev);
if (!real_dev)
   real_dev = netdev;

> 
> diff --git a/drivers/infiniband/hw/irdma/utils.c b/drivers/infiniband/hw/irdma/utils.c
> index 398736d..26407d8 100644
> --- a/drivers/infiniband/hw/irdma/utils.c
> +++ b/drivers/infiniband/hw/irdma/utils.c
> @@ -155,6 +155,8 @@ int irdma_inetaddr_event(struct notifier_block *notifier, unsigned long event,
>  	struct ib_device *ibdev;
>  	u32 local_ipaddr;
>  
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
>  	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
> @@ -201,6 +203,8 @@ int irdma_inet6addr_event(struct notifier_block *notifier, unsigned long event,
>  	struct ib_device *ibdev;
>  	u32 local_ipaddr6[4];
>  
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
>  	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
> @@ -243,14 +247,16 @@ int irdma_net_event(struct notifier_block *notifier, unsigned long event,
>  		    void *ptr)
>  {
>  	struct neighbour *neigh = ptr;
> +	struct net_device *netdev = (struct net_device *)neigh->dev;
>  	struct irdma_device *iwdev;
>  	struct ib_device *ibdev;
>  	__be32 *p;
>  	u32 local_ipaddr[4] = {};
>  	bool ipv4 = true;
>  
> -	ibdev = ib_device_get_by_netdev((struct net_device *)neigh->dev,
> -					RDMA_DRIVER_IRDMA);
> +	if (is_vlan_dev(netdev))
> +		netdev = vlan_dev_real_dev(netdev);
> +	ibdev = ib_device_get_by_netdev(netdev, RDMA_DRIVER_IRDMA);
>  	if (!ibdev)
>  		return NOTIFY_DONE;
>  
> -- 
> 1.8.3.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-24 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  0:58 [PATCH rdma-rc 0/3] irdma driver updates Shiraz Saleem
2022-02-24  0:58 ` [PATCH rdma-rc 1/3] RDMA/irdma: Fix netdev notifications for vlan's Shiraz Saleem
2022-02-24 19:29   ` Leon Romanovsky
2022-02-24  0:58 ` [PATCH rdma-rc 2/3] RDMA/irdma: Fix Passthrough mode in VM Shiraz Saleem
2022-02-24  0:58 ` [PATCH rdma-rc 3/3] RDMA/irdma: Remove incorrect masking of PD Shiraz Saleem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).