X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Flinux%2Fmlx5_os.c;h=4b7fff4eff5badeb2409d25d510e0f35c2125e4c;hb=e6818853c022e3ae62d05421860063f7a6c731af;hp=ce25108b90efac5ab36cd1317277502c82ba1e05;hpb=38c6dc20394b28abd0440dbdd2f9309eb4c95ccc;p=dpdk.git diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index ce25108b90..4b7fff4eff 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -757,7 +757,13 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, rte_errno = ENOMEM; return NULL; } - eth_dev->device = dpdk_dev; + 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->dev_ops = &mlx5_os_dev_sec_ops; eth_dev->rx_descriptor_status = mlx5_rx_descriptor_status; eth_dev->tx_descriptor_status = mlx5_tx_descriptor_status; @@ -1373,7 +1379,17 @@ err_secondary: eth_dev->data->dev_private = priv; priv->dev_data = eth_dev->data; eth_dev->data->mac_addrs = priv->mac; - eth_dev->device = dpdk_dev; + 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->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)) {