[dpdk-dev] [PATCH v4 1/4] net/mlx5: add flow action functions to glue

Yongseok Koh yskoh at mellanox.com
Wed Oct 10 23:22:45 CEST 2018


On Wed, Oct 10, 2018 at 11:35:28AM +0300, Dekel Peled wrote:
> This patch adds glue functions for operations:
> - Create packet reformat (encap/decap) flow action.
> - Destroy flow action.
> 
> The new operations depend on HAVE_IBV_FLOW_ACTION_DV_SUPPORT.
> 
> Signed-off-by: Dekel Peled <dekelp at mellanox.com>
> ---
>  drivers/net/mlx5/Makefile    |  5 +++++
>  drivers/net/mlx5/meson.build |  2 ++
>  drivers/net/mlx5/mlx5_glue.c | 38 ++++++++++++++++++++++++++++++++++++++
>  drivers/net/mlx5/mlx5_glue.h | 13 +++++++++++++
>  4 files changed, 58 insertions(+)
> 
> diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
> index 92bae9d..474ad42 100644
> --- a/drivers/net/mlx5/Makefile
> +++ b/drivers/net/mlx5/Makefile
> @@ -142,6 +142,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
>  		enum MLX5DV_FLOW_ACTION_TAG \
>  		$(AUTOCONF_OUTPUT)
>  	$Q sh -- '$<' '$@' \
> +		HAVE_IBV_FLOW_ACTION_DV_SUPPORT \
> +		infiniband/mlx5dv.h \
> +		func mlx5dv_create_flow_action_packet_reformat \
> +		$(AUTOCONF_OUTPUT)

I thought you also added this macro to the code in mlx5_flow_dv.c but you
didn't. My original concern was about a case where DV is supported
(HAVE_IBV_FLOW_DV_SUPPORT) but the new flow action
(HAVE_IBV_FLOW_ACTION_DV_SUPPORT) isn't supported. Your code won't be compiled
in such a chase.

There's one more option to consider, which is much simpler. You can change the
HAVE_IBV_FLOW_DV_SUPPORT to check the new function.

	$Q sh -- '$<' '$@' \
		HAVE_IBV_FLOW_DV_SUPPORT \
		infiniband/mlx5dv.h \
		func mlx5dv_create_flow_action_packet_reformat \
		$(AUTOCONF_OUTPUT)

If we don't need to support two different versions of library, (or there could
be only one version supporting both), it isn't necessary to have two separate
macros. Let's take it offline to talk to lib/ker team.


Thanks,
Yongseok

> +	$Q sh -- '$<' '$@' \
>  		HAVE_ETHTOOL_LINK_MODE_25G \
>  		/usr/include/linux/ethtool.h \
>  		enum ETHTOOL_LINK_MODE_25000baseCR_Full_BIT \
> diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build
> index 6966248..d555c3c 100644
> --- a/drivers/net/mlx5/meson.build
> +++ b/drivers/net/mlx5/meson.build
> @@ -96,6 +96,8 @@ if build
>  		'MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP' ],
>  		[ 'HAVE_IBV_FLOW_DV_SUPPORT', 'infiniband/mlx5dv.h',
>  		'MLX5DV_FLOW_ACTION_TAG' ],
> +		[ 'HAVE_IBV_FLOW_ACTION_DV_SUPPORT', 'infiniband/mlx5dv.h',
> +		'mlx5dv_create_flow_action_packet_reformat' ],
>  		[ 'HAVE_IBV_DEVICE_MPLS_SUPPORT', 'infiniband/verbs.h',
>  		'IBV_FLOW_SPEC_MPLS' ],
>  		[ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h',


More information about the dev mailing list