@@ -938,7 +938,7 @@ mlx5_representor_match(struct mlx5_dev_spawn_data *spawn,
* Verbs device parameters (name, port, switch_info) to spawn.
* @param config
* Device configuration parameters.
- * @param config
+ * @param eth_da
* Device arguments.
*
* @return
@@ -997,12 +997,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
/* Bonding device. */
if (!switch_info->representor) {
err = snprintf(name, sizeof(name), "%s_%s",
- dpdk_dev->name,
- mlx5_os_get_dev_device_name(spawn->phys_dev));
+ dpdk_dev->name, spawn->phys_dev_name);
} else {
err = snprintf(name, sizeof(name), "%s_%s_representor_c%dpf%d%s%u",
dpdk_dev->name,
- mlx5_os_get_dev_device_name(spawn->phys_dev),
+ spawn->phys_dev_name,
switch_info->ctrl_num,
switch_info->pf_num,
switch_info->name_type ==
@@ -1227,8 +1226,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
if (err) {
DRV_LOG(WARNING,
"can't query devx port %d on device %s",
- spawn->phys_port,
- mlx5_os_get_dev_device_name(spawn->phys_dev));
+ spawn->phys_port, spawn->phys_dev_name);
vport_info.query_flags = 0;
}
}
@@ -1238,18 +1236,14 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
if (!priv->vport_meta_mask) {
DRV_LOG(ERR, "vport zero mask for port %d"
" on bonding device %s",
- spawn->phys_port,
- mlx5_os_get_dev_device_name
- (spawn->phys_dev));
+ spawn->phys_port, spawn->phys_dev_name);
err = ENOTSUP;
goto error;
}
if (priv->vport_meta_tag & ~priv->vport_meta_mask) {
DRV_LOG(ERR, "invalid vport tag for port %d"
" on bonding device %s",
- spawn->phys_port,
- mlx5_os_get_dev_device_name
- (spawn->phys_dev));
+ spawn->phys_port, spawn->phys_dev_name);
err = ENOTSUP;
goto error;
}
@@ -1260,8 +1254,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
(switch_info->representor || switch_info->master)) {
DRV_LOG(ERR, "can't deduce vport index for port %d"
" on bonding device %s",
- spawn->phys_port,
- mlx5_os_get_dev_device_name(spawn->phys_dev));
+ spawn->phys_port, spawn->phys_dev_name);
err = ENOTSUP;
goto error;
} else {
@@ -2314,6 +2307,7 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev,
list[ns].max_port = np;
list[ns].phys_port = i;
list[ns].phys_dev = ibv_match[0];
+ list[ns].phys_dev_name = ibv_match[0]->name;
list[ns].eth_dev = NULL;
list[ns].pci_dev = pci_dev;
list[ns].pf_bond = bd;
@@ -2410,6 +2404,7 @@ mlx5_os_pci_probe_pf(struct rte_pci_device *pci_dev,
list[ns].max_port = 1;
list[ns].phys_port = 1;
list[ns].phys_dev = ibv_match[i];
+ list[ns].phys_dev_name = ibv_match[i]->name;
list[ns].eth_dev = NULL;
list[ns].pci_dev = pci_dev;
list[ns].pf_bond = -1;
@@ -2732,6 +2727,7 @@ mlx5_os_auxiliary_probe(struct rte_device *dev)
spawn.phys_dev = mlx5_os_get_ibv_dev(dev);
if (spawn.phys_dev == NULL)
return -rte_errno;
+ spawn.phys_dev_name = mlx5_os_get_dev_device_name(spawn.phys_dev);
ret = mlx5_auxiliary_get_ifindex(dev->name);
if (ret < 0) {
DRV_LOG(ERR, "failed to get ethdev ifindex: %s", dev->name);
@@ -1107,7 +1107,7 @@ mlx5_alloc_rxtx_uars(struct mlx5_dev_ctx_shared *sh,
*/
struct mlx5_dev_ctx_shared *
mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
- const struct mlx5_dev_config *config)
+ const struct mlx5_dev_config *config)
{
struct mlx5_dev_ctx_shared *sh;
int err = 0;
@@ -1120,8 +1120,7 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
pthread_mutex_lock(&mlx5_dev_ctx_list_mutex);
/* Search for IB context by device name. */
LIST_FOREACH(sh, &mlx5_dev_ctx_list, next) {
- if (!strcmp(sh->ibdev_name,
- mlx5_os_get_dev_device_name(spawn->phys_dev))) {
+ if (!strcmp(sh->ibdev_name, spawn->phys_dev_name)) {
sh->refcnt++;
goto exit;
}
@@ -137,6 +137,7 @@ struct mlx5_dev_spawn_data {
int numa_node; /**< Device numa node. */
struct mlx5_switch_info info; /**< Switch information. */
void *phys_dev; /**< Associated physical device. */
+ const char *phys_dev_name; /**< Name of physical device. */
struct rte_eth_dev *eth_dev; /**< Associated Ethernet device. */
struct rte_pci_device *pci_dev; /**< Backend PCI device. */
struct mlx5_bond_info *bond_info;
@@ -942,6 +942,7 @@ mlx5_os_net_probe(struct rte_device *dev)
spawn.max_port = 1;
spawn.phys_port = 1;
spawn.phys_dev = devx_bdf_match;
+ spawn.phys_dev_name = mlx5_os_get_dev_device_name(devx_bdf_match);
spawn.eth_dev = NULL;
spawn.pci_dev = pci_dev;
spawn.ifindex = -1; /* Spawn will assign */