[dpdk-dev] [PATCH v3 10/10] net/mlx5: support negative identifiers for port representors

Adrien Mazarguil adrien.mazarguil at 6wind.com
Wed Jul 4 19:27:51 CEST 2018


This patch brings support for BlueField representors.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
Cc: Shahaf Shuler <shahafs at mellanox.com>
--
v3 changes:

- This patch was not present in prior revisions.
---
 drivers/net/mlx5/mlx5.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 7e757274a..d2031c633 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1305,6 +1305,14 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 			memset(&list[i].info, 0, sizeof(list[i].info));
 			continue;
 		}
+		/*
+		 * Port representors not associated with any VFs (e.g. on
+		 * BlueField devices) report -1 as a port identifier.
+		 * Quietly set it to zero since DPDK only supports positive
+		 * values.
+		 */
+		if (list[i].info.representor && list[i].info.port_name == -1)
+			list[i].info.port_name = 0;
 	}
 	if (nl_rdma >= 0)
 		close(nl_rdma);
-- 
2.11.0


More information about the dev mailing list