[dpdk-dev] net/bonding: support bifurcated driver in eal cli using --vdev
Checks
Commit Message
From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
At present, creating bonding devices using --vdev is broken for PMD like
mlx5 as it is neither UIO nor VFIO based and hence PMD driver is unknown
to find_port_id_by_pci_addr(), as below.
testpmd <EAL args> --vdev 'net_bonding0,mode=1,slave=<PCI>,socket_id=0'
PMD: bond_ethdev_parse_slave_port_kvarg(150) - Invalid slave port value
(<PCI ID>) specified
EAL: Failed to parse slave ports for bonded device net_bonding0
This patch adds RTE_KDRV_BIFURCATED in rte_kernel_driver for the PMD
driver like mlx5 to be a known one.
Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
---
lib/librte_eal/common/include/rte_pci.h | 1 +
lib/librte_eal/linuxapp/eal/eal_pci.c | 2 ++
2 files changed, 3 insertions(+)
Comments
On 6/14/2017 11:49 AM, Gowrishankar wrote:
> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>
> At present, creating bonding devices using --vdev is broken for PMD like
> mlx5 as it is neither UIO nor VFIO based and hence PMD driver is unknown
> to find_port_id_by_pci_addr(), as below.
>
> testpmd <EAL args> --vdev 'net_bonding0,mode=1,slave=<PCI>,socket_id=0'
>
> PMD: bond_ethdev_parse_slave_port_kvarg(150) - Invalid slave port value
> (<PCI ID>) specified
> EAL: Failed to parse slave ports for bonded device net_bonding0
>
> This patch adds RTE_KDRV_BIFURCATED in rte_kernel_driver for the PMD
> driver like mlx5 to be a known one.
>
> Signed-off-by: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
Patch is for bonding but changes are in eal and related to mlx support,
so adding more developers may be interested.
14/06/2017 12:49, Gowrishankar:
> At present, creating bonding devices using --vdev is broken for PMD like
> mlx5 as it is neither UIO nor VFIO based and hence PMD driver is unknown
> to find_port_id_by_pci_addr(), as below.
>
> testpmd <EAL args> --vdev 'net_bonding0,mode=1,slave=<PCI>,socket_id=0'
>
> PMD: bond_ethdev_parse_slave_port_kvarg(150) - Invalid slave port value
> (<PCI ID>) specified
> EAL: Failed to parse slave ports for bonded device net_bonding0
Thanks for reporting.
> This patch adds RTE_KDRV_BIFURCATED in rte_kernel_driver for the PMD
> driver like mlx5 to be a known one.
The current kdrv value should be RTE_KDRV_UNKNOWN for Mellanox devices.
I do not see the value of creating a new type.
I think the issue is in the bonding code (find_port_id_by_pci_addr):
* TODO: Once the PCI bus has arrived we should have a better
* way to test for being a PCI device or not.
*/
if (rte_eth_devices[i].data->kdrv == RTE_KDRV_UNKNOWN ||
rte_eth_devices[i].data->kdrv == RTE_KDRV_NONE)
continue;
@@ -126,6 +126,7 @@ enum rte_kernel_driver {
RTE_KDRV_VFIO,
RTE_KDRV_UIO_GENERIC,
RTE_KDRV_NIC_UIO,
+ RTE_KDRV_BIFURCATED,
RTE_KDRV_NONE,
};
@@ -351,6 +351,8 @@
dev->kdrv = RTE_KDRV_IGB_UIO;
else if (!strcmp(driver, "uio_pci_generic"))
dev->kdrv = RTE_KDRV_UIO_GENERIC;
+ else if (!strcmp(driver, "mlx5_core"))
+ dev->kdrv = RTE_KDRV_BIFURCATED;
else
dev->kdrv = RTE_KDRV_UNKNOWN;
} else