From: Viacheslav Ovsiienko Date: Wed, 25 Sep 2019 07:53:29 +0000 (+0000) Subject: net/mlx5: check kernel support for VF LAG bonding X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=790164ce1d2d9cd17222ee7353912da4e3b6c0f1;p=dpdk.git net/mlx5: check kernel support for VF LAG bonding If bonding Infiniband device is found the unified E-Switch is supposed and the extra rdma-core/kernel support is needed to retrieve vport indices. The patch introduces this feature defines, bonding support check is added to probe routine. Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index d11ad4b5f4..88515c0de0 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -168,6 +168,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh infiniband/mlx5dv.h \ func mlx5dv_dr_action_create_push_vlan \ $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ + HAVE_MLX5DV_DR_DEVX_PORT \ + infiniband/mlx5dv.h \ + func mlx5dv_query_devx_port \ + $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ HAVE_IBV_DEVX_OBJ \ infiniband/mlx5dv.h \ diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index 1cd7fbbd45..142240ae59 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -118,6 +118,8 @@ if build 'IBV_WQ_FLAGS_PCI_WRITE_END_PADDING' ], [ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h', 'IBV_WQ_FLAG_RX_END_PADDING' ], + [ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h', + 'mlx5dv_query_devx_port' ], [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h', 'mlx5dv_devx_obj_create' ], [ 'HAVE_IBV_FLOW_DEVX_COUNTERS', 'infiniband/mlx5dv.h', diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 1fe71505ad..7f1913340a 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -2369,6 +2369,19 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, goto exit; } } +#ifndef HAVE_MLX5DV_DR_DEVX_PORT + if (bd >= 0) { + /* + * This may happen if there is VF LAG kernel support and + * application is compiled with older rdma_core library. + */ + DRV_LOG(ERR, + "No kernel/verbs support for VF LAG bonding found."); + rte_errno = ENOTSUP; + ret = -rte_errno; + goto exit; + } +#endif /* * Now we can determine the maximal * amount of devices to be spawned.