patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Bing Zhao <bingz@nvidia.com>
To: <stable@dpdk.org>, <christian.ehrhardt@canonical.com>
Cc: <viacheslavo@nvidia.com>, <matan@nvidia.com>
Subject: [dpdk-stable] [PATCH 19.11 2/6] common/mlx5: fix compatibility with OFED port query API
Date: Mon, 16 Aug 2021 19:29:48 +0300	[thread overview]
Message-ID: <20210816162952.1931473-3-bingz@nvidia.com> (raw)
In-Reply-To: <20210816162952.1931473-1-bingz@nvidia.com>

From: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

[ upstream commit 0fd928bbbae5e6f89376f9996d5340a861fc14e3 ]

The compilation flag HAVE_MLX5DV_DR_DEVX_PORT depends on presence
of mlx5dv_query_devx_port routine in rdma-core library.

The mlx5dv_query_devx_port routine exists only in OFED versions
of rdma-core library and is being planned to be removed and replaced
with Upstream compatible mlx5dv_query_port.

As mlx5dv_query_devx_port is being removed all the dependencies on
the HAVE_MLX5DV_DR_DEVX_PORT compilation flag are reconsidered.

The new compilation flag HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT is for
backward compatibility with older OFED versions.

Fixes: 6cfe84fbe7b1 ("net/mlx5: fix port action for LAG")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Signed-off-by: Matan Azrad <matan@nvidia.com>
Signed-off-by: Bing Zhao <bingz@nvidia.com>
---
 drivers/net/mlx5/Makefile       | 5 +++++
 drivers/net/mlx5/meson.build    | 2 ++
 drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
 drivers/net/mlx5/mlx5_glue.c    | 2 +-
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 605975c245..3719f0f11e 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -178,6 +178,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 		infiniband/mlx5dv.h \
 		func mlx5dv_query_devx_port \
 		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
+		HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT \
+		infiniband/mlx5dv.h \
+		func mlx5dv_dr_action_create_dest_ib_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 139056cbe8..3336c58ce5 100644
--- a/drivers/net/mlx5/meson.build
+++ b/drivers/net/mlx5/meson.build
@@ -138,6 +138,8 @@ if build
 		'IBV_WQ_FLAG_RX_END_PADDING' ],
 		[ 'HAVE_MLX5DV_DR_DEVX_PORT', 'infiniband/mlx5dv.h',
 		'mlx5dv_query_devx_port' ],
+		[ 'HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT', 'infiniband/mlx5dv.h',
+		'mlx5dv_dr_action_create_dest_ib_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_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 42ae1bbe2c..44c47ce8e4 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -7117,7 +7117,7 @@ flow_dv_translate_action_port_id(struct rte_eth_dev *dev,
 					  RTE_FLOW_ERROR_TYPE_ACTION,
 					  NULL,
 					  "No eswitch info was found for port");
-#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT
 	/*
 	 * This parameter is transferred to
 	 * mlx5dv_dr_action_create_dest_ib_port().
diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index 65b63bd607..1553a9b41c 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -393,7 +393,7 @@ mlx5_glue_dr_create_flow_action_dest_flow_tbl(void *tbl)
 static void *
 mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port)
 {
-#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+#ifdef HAVE_MLX5DV_DR_CREATE_DEST_IB_PORT
 	return mlx5dv_dr_action_create_dest_ib_port(domain, port);
 #else
 #ifdef HAVE_MLX5DV_DR_ESWITCH
-- 
2.21.0


  parent reply	other threads:[~2021-08-16 16:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 16:29 [dpdk-stable] [PATCH 19.11 0/6] Cumulative fixes for stable 19.11 Bing Zhao
2021-08-16 16:29 ` [dpdk-stable] [PATCH 19.11 1/6] app/testpmd: fix offloads for newly attached port Bing Zhao
2021-08-16 16:29 ` Bing Zhao [this message]
2021-08-16 16:29 ` [dpdk-stable] [PATCH 19.11 3/6] net/mlx5: fix switchdev mode recognition Bing Zhao
2021-08-16 16:29 ` [dpdk-stable] [PATCH 19.11 4/6] net/mlx5: fix RoCE LAG bond device probing Bing Zhao
2021-08-16 16:29 ` [dpdk-stable] [PATCH 19.11 5/6] common/mlx5: use new port query API if available Bing Zhao
2021-08-16 16:29 ` [dpdk-stable] [PATCH 19.11 6/6] net/mlx5: fix multi-segment inline for the first segments Bing Zhao
2021-08-17 11:55   ` Christian Ehrhardt
2021-08-17 13:55     ` Bing Zhao
2021-08-17  9:42 ` [dpdk-stable] [PATCH 19.11 0/6] Cumulative fixes for stable 19.11 Christian Ehrhardt
2021-08-17 13:54 ` [dpdk-stable] [PATCH 19.11 v2] net/mlx5: fix multi-segment inline for the first segments Bing Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210816162952.1931473-3-bingz@nvidia.com \
    --to=bingz@nvidia.com \
    --cc=christian.ehrhardt@canonical.com \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).