From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>, Raslan Darawsheh <rasland@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH 2/5] net/mlx5: fix bond check
Date: Mon, 2 Mar 2026 12:34:40 +0100 [thread overview]
Message-ID: <20260302113443.16648-3-dsosnowski@nvidia.com> (raw)
In-Reply-To: <20260302113443.16648-1-dsosnowski@nvidia.com>
mlx5 networking PMD supports probing ethdev ports based
on LAG configured on Linux kernel level.
In such cases, a single IB device is created in the kernel
and mlx5 PMD configured the device through this IB device.
In order to recognize whether PMD will run over LAG device or not,
mlx5 PMD relied on IB device name.
This patch fixes mlx5 networking PMD logic to rely on
mlx5_os_is_device_bond() introduced in previous commit,
instead of relying solely on IB device name.
Fixes: 2e569a370395 ("net/mlx5: add VF LAG mode bonding device recognition")
Cc: viacheslavo@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/net/mlx5/linux/mlx5_os.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 76edd19c70..405aa9799c 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1928,8 +1928,8 @@ mlx5_dev_spawn_data_cmp(const void *a, const void *b)
/**
* Match PCI information for possible slaves of bonding device.
*
- * @param[in] ibdev_name
- * Name of Infiniband device.
+ * @param[in] ibdev
+ * Pointer to IB device.
* @param[in] pci_dev
* Pointer to primary PCI address structure to match.
* @param[in] nl_rdma
@@ -1946,7 +1946,7 @@ mlx5_dev_spawn_data_cmp(const void *a, const void *b)
* positive index of slave PF in bonding.
*/
static int
-mlx5_device_bond_pci_match(const char *ibdev_name,
+mlx5_device_bond_pci_match(const struct ibv_device *ibdev,
const struct rte_pci_addr *pci_dev,
int nl_rdma, uint16_t owner,
struct mlx5_dev_info *dev_info,
@@ -1968,9 +1968,9 @@ mlx5_device_bond_pci_match(const char *ibdev_name,
memset(bond_info, 0, sizeof(*bond_info));
if (nl_rdma < 0)
return -1;
- if (!strstr(ibdev_name, "bond"))
+ if (!mlx5_os_is_device_bond(ibdev))
return -1;
- np = mlx5_nl_portnum(nl_rdma, ibdev_name, dev_info);
+ np = mlx5_nl_portnum(nl_rdma, ibdev->name, dev_info);
if (!np)
return -1;
if (mlx5_get_device_guid(pci_dev, cur_guid, sizeof(cur_guid)) < 0)
@@ -1982,7 +1982,7 @@ mlx5_device_bond_pci_match(const char *ibdev_name,
*/
for (i = 1; i <= np; ++i) {
/* Check whether Infiniband port is populated. */
- ifindex = mlx5_nl_ifindex(nl_rdma, ibdev_name, i, dev_info);
+ ifindex = mlx5_nl_ifindex(nl_rdma, ibdev->name, i, dev_info);
if (!ifindex)
continue;
if (!if_indextoname(ifindex, ifname))
@@ -2396,7 +2396,7 @@ mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev,
info = &tmp_info[ret];
}
DRV_LOG(DEBUG, "Checking device \"%s\"", ibv_list[ret]->name);
- bd = mlx5_device_bond_pci_match(ibv_list[ret]->name, &owner_pci,
+ bd = mlx5_device_bond_pci_match(ibv_list[ret], &owner_pci,
nl_rdma, owner_id,
info,
&bond_info);
--
2.47.3
next prev parent reply other threads:[~2026-03-02 11:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 11:34 [PATCH 0/5] net/mlx5: add BlueField socket direct support Dariusz Sosnowski
2026-03-02 11:34 ` [PATCH 1/5] common/mlx5: fix bond check Dariusz Sosnowski
2026-03-02 11:34 ` Dariusz Sosnowski [this message]
2026-03-02 11:34 ` [PATCH 3/5] net/mlx5: calculate number of uplinks and host PFs Dariusz Sosnowski
2026-03-02 11:34 ` [PATCH 4/5] net/mlx5: compare representors explicitly Dariusz Sosnowski
2026-03-02 11:34 ` [PATCH 5/5] net/mlx5: build port name dynamically Dariusz Sosnowski
2026-03-04 7:26 ` [PATCH 0/5] net/mlx5: add BlueField socket direct support Bing Zhao
2026-03-04 10:57 ` [PATCH v2 0/3] net/mlx5: net/mlx5: fix probing to allow BlueField Socket Direct Dariusz Sosnowski
2026-03-04 10:57 ` [PATCH v2 1/3] common/mlx5: fix bond check Dariusz Sosnowski
2026-03-04 10:57 ` [PATCH v2 2/3] net/mlx5: " Dariusz Sosnowski
2026-03-04 10:57 ` [PATCH v2 3/3] net/mlx5: fix probing to allow BlueField Socket Direct Dariusz Sosnowski
2026-03-10 8:16 ` [PATCH v2 0/3] net/mlx5: " Raslan Darawsheh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260302113443.16648-3-dsosnowski@nvidia.com \
--to=dsosnowski@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox