Skip to contentSkip to conversation

net/mlx5: probe LAG representor with PF1 PCI address

PATCH Superseded Xueming Li 3 participants 5 messages Apr 22, 2021 – May 12, 2021 Network drivers

lore
Share & tools
lore

Xueming Li

author
#0 lore raw

PATCH 1/1 net/mlx5: probe LAG representor with PF1 PCI address

In case of bonding, orchestrator wants to use same devargs for LAG and non-LAG scenario, to probe representor on PF1 using PF1 PCI address like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1.

Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs.

---
 drivers/net/mlx5/linux/mlx5_os.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/mlx5/linux/mlx5_os.c +5 -2
index 76c72d0e38..22271e289a 100644
@@ -1875,11 +1875,14 @@ mlx5_device_bond_pci_match(const struct ibv_device *ibv_dev,
 				tmp_str);
 			break;
 		}
-		/* Match PCI address. */
+		/* Match PCI address, allows BDF0+pfx or BDFx+pfx. */
 		if (pci_dev->domain == pci_addr.domain &&
 		    pci_dev->bus == pci_addr.bus &&
 		    pci_dev->devid == pci_addr.devid &&
-		    pci_dev->function + owner == pci_addr.function)
+		    ((pci_dev->function == 0 &&
+		      pci_dev->function + owner == pci_addr.function) ||
+		     (pci_dev->function == owner &&
+		      pci_addr.function == owner)))
 			pf = info.port_name;
 		/* Get ifindex. */
 		snprintf(tmp_str, sizeof(tmp_str),
Signature · 1 line
2.25.1
#1 lore raw

Hi, Xuemig

This patch looks like a fix - could you, please add the "Fixes:" tag and modify the headline?

With best regards,
Slava

Quoted 49 lines

-----Original Message-----
From: Xueming Li <[email protected]>
Sent: Thursday, April 22, 2021 10:25
Cc: [email protected]; Xueming(Steven) Li <[email protected]>; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Slava Ovsiienko <[email protected]>
Subject: [PATCH] net/mlx5: probe LAG representor with PF1 PCI address

In case of bonding, orchestrator wants to use same devargs for LAG and non- LAG scenario, to probe representor on PF1 using PF1 PCI address like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1.

Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs.

---
 drivers/net/mlx5/linux/mlx5_os.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/mlx5/linux/mlx5_os.c +5 -2
index 76c72d0e38..22271e289a 100644
@@ -1875,11 +1875,14 @@ mlx5_device_bond_pci_match(const struct
 ibv_device *ibv_dev,
 				tmp_str);
 			break;
 		}
-		/* Match PCI address. */
+		/* Match PCI address, allows BDF0+pfx or BDFx+pfx. */
 		if (pci_dev->domain == pci_addr.domain &&
 		    pci_dev->bus == pci_addr.bus &&
 		    pci_dev->devid == pci_addr.devid &&
-		    pci_dev->function + owner == pci_addr.function)
+		    ((pci_dev->function == 0 &&
+		      pci_dev->function + owner == pci_addr.function) ||
+		     (pci_dev->function == owner &&
+		      pci_addr.function == owner)))
 			pf = info.port_name;
 		/* Get ifindex. */

snprintf(tmp_str, sizeof(tmp_str),
--
2.25.1

author
#2 lore raw

PATCH v2 1/1 net/mlx5: fix LAG representor probe on PF1 PCI

In reply to Xueming Li

In case of bonding, orchestrator wants to use same devargs for LAG and non-LAG scenario to probe representor on PF1 using PF1 PCI address like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1.

Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs.

Fixes f926cce3fa94 ("net/mlx5: refactor bonding representor probing")
---
 drivers/net/mlx5/linux/mlx5_os.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/mlx5/linux/mlx5_os.c +5 -2
index 5ac787106d..47606d292a 100644
@@ -1877,11 +1877,14 @@ mlx5_device_bond_pci_match(const struct ibv_device *ibv_dev,
 				tmp_str);
 			break;
 		}
-		/* Match PCI address. */
+		/* Match PCI address, allows BDF0+pfx or BDFx+pfx. */
 		if (pci_dev->domain == pci_addr.domain &&
 		    pci_dev->bus == pci_addr.bus &&
 		    pci_dev->devid == pci_addr.devid &&
-		    pci_dev->function + owner == pci_addr.function)
+		    ((pci_dev->function == 0 &&
+		      pci_dev->function + owner == pci_addr.function) ||
+		     (pci_dev->function == owner &&
+		      pci_addr.function == owner)))
 			pf = info.port_name;
 		/* Get ifindex. */
 		snprintf(tmp_str, sizeof(tmp_str),
Signature · 1 line
2.25.1
Acked-by on v2 1/1
#3 lore raw

Re: [dpdk-dev] [PATCH v2] net/mlx5: fix LAG representor probe on PF1 PCI

Quoted 15 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Xueming Li
Sent: Monday, May 10, 2021 16:14
Cc: [email protected]; Xueming(Steven) Li <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix LAG representor probe on PF1 PCI

In case of bonding, orchestrator wants to use same devargs for LAG and non- LAG scenario to probe representor on PF1 using PF1 PCI address like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1.

Quoted 8 lines

Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs.

Fixes f926cce3fa94 ("net/mlx5: refactor bonding representor probing")
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/mlx5: fix LAG representor probe on PF1 PCI

Quoted 11 lines
Quoted 11 lines

In case of bonding, orchestrator wants to use same devargs for LAG and non- LAG scenario to probe representor on PF1 using PF1 PCI address like "<DBDF_PF1>,representor=pf1vf[0-3]".

This patch changes PCI address check policy to allow PF1 PCI address for representors on PF1.

Note: detaching PF0 device can't remove representors on PF1. It's recommended to use primary(PF0) PCI address to probe representors on both PFs.

Quoted 5 lines
Quoted 4 lines
Fixes f926cce3fa94 ("net/mlx5: refactor bonding representor probing")

Applied to next-net-mlx, thanks.