net/mlx5: revert setting bonding representor to first PF
authorXueming Li <xuemingl@nvidia.com>
Sun, 28 Mar 2021 13:48:09 +0000 (13:48 +0000)
committerRaslan Darawsheh <rasland@nvidia.com>
Wed, 31 Mar 2021 07:16:27 +0000 (09:16 +0200)
With kernel bonding, representors on second PF are being probed by
devargs:
<primary_bdf>,representor=pf1vf<N>
No need to save primary PF port ID and lookup when probing sibling
ports, revert patch [1]

[1]:
commit e6818853c022 ("net/mlx5: set representor to first PF in bonding mode")

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
drivers/net/mlx5/linux/mlx5_os.c
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5.h

index 2241d6a..56ab153 100644 (file)
@@ -862,13 +862,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                        rte_errno = ENOMEM;
                        return NULL;
                }
-               priv = eth_dev->data->dev_private;
-               if (priv->sh->bond_dev != UINT16_MAX)
-                       /* For bonding port, use primary PCI device. */
-                       eth_dev->device =
-                               rte_eth_devices[priv->sh->bond_dev].device;
-               else
-                       eth_dev->device = dpdk_dev;
+               eth_dev->device = dpdk_dev;
                eth_dev->dev_ops = &mlx5_dev_sec_ops;
                eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status;
                eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status;
@@ -1495,17 +1489,7 @@ err_secondary:
        eth_dev->data->dev_private = priv;
        priv->dev_data = eth_dev->data;
        eth_dev->data->mac_addrs = priv->mac;
-       if (spawn->pf_bond < 0) {
-               eth_dev->device = dpdk_dev;
-       } else {
-               /* Use primary bond PCI as device. */
-               if (sh->bond_dev == UINT16_MAX) {
-                       sh->bond_dev = eth_dev->data->port_id;
-                       eth_dev->device = dpdk_dev;
-               } else {
-                       eth_dev->device = rte_eth_devices[sh->bond_dev].device;
-               }
-       }
+       eth_dev->device = dpdk_dev;
        eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
        /* Configure the first MAC address by default. */
        if (mlx5_get_mac(eth_dev, &mac.addr_bytes)) {
index 8ce3d7d..006ab95 100644 (file)
@@ -914,7 +914,6 @@ mlx5_alloc_shared_dev_ctx(const struct mlx5_dev_spawn_data *spawn,
                goto error;
        }
        sh->refcnt = 1;
-       sh->bond_dev = UINT16_MAX;
        sh->max_port = spawn->max_port;
        strncpy(sh->ibdev_name, mlx5_os_get_ctx_device_name(sh->ctx),
                sizeof(sh->ibdev_name) - 1);
index a585c96..a0f22f9 100644 (file)
@@ -678,7 +678,6 @@ struct mlx5_flex_parser_profiles {
 struct mlx5_dev_ctx_shared {
        LIST_ENTRY(mlx5_dev_ctx_shared) next;
        uint32_t refcnt;
-       uint16_t bond_dev; /* Bond primary device id. */
        uint32_t devx:1; /* Opened with DV. */
        uint32_t flow_hit_aso_en:1; /* Flow Hit ASO is supported. */
        uint32_t rq_ts_format:2; /* RQ timestamp formats supported. */