DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com
Subject: [dpdk-dev] [PATCH] net/mlx5: fix port action create routine
Date: Tue, 19 Nov 2019 09:16:04 +0000	[thread overview]
Message-ID: <1574154964-24045-1-git-send-email-viacheslavo@mellanox.com> (raw)

To support LAG configurations the mlx5dv_dr_action_create_dest_ib_port()
should be called instead of mlx5dv_dr_action_create_dest_vport().

Fixes: f07341e7aed3 ("net/mlx5: update source and destination vport translations")

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow_dv.c | 20 +++++++++++++++++++-
 drivers/net/mlx5/mlx5_glue.c    | 14 +++++++++-----
 drivers/net/mlx5/mlx5_glue.h    |  3 ++-
 3 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index c9dbd89..4dcd640 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2380,8 +2380,13 @@ struct field_modify_info modify_tcp[] = {
 					  RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
 					  "cannot allocate resource memory");
 	*cache_resource = *resource;
+	/*
+	 * Depending on rdma_core version the glue routine calls
+	 * either mlx5dv_dr_action_create_dest_ib_port(domain, ibv_port)
+	 * or mlx5dv_dr_action_create_dest_vport(domain, vport_id).
+	 */
 	cache_resource->action =
-		mlx5_glue->dr_create_flow_action_dest_vport
+		mlx5_glue->dr_create_flow_action_dest_port
 			(priv->sh->fdb_domain, resource->port_id);
 	if (!cache_resource->action) {
 		rte_free(cache_resource);
@@ -6501,7 +6506,20 @@ struct field_modify_info modify_tcp[] = {
 					  RTE_FLOW_ERROR_TYPE_ACTION,
 					  NULL,
 					  "No eswitch info was found for port");
+#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+	/*
+	 * This parameter is transferred to
+	 * mlx5dv_dr_action_create_dest_ib_port().
+	 */
+	*dst_port_id = priv->ibv_port;
+#else
+	/*
+	 * Legacy mode, no LAG configurations is supported.
+	 * This parameter is transferred to
+	 * mlx5dv_dr_action_create_dest_vport().
+	 */
 	*dst_port_id = priv->vport_id;
+#endif
 	return 0;
 }
 
diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c
index 15197cf..0917bf2 100644
--- a/drivers/net/mlx5/mlx5_glue.c
+++ b/drivers/net/mlx5/mlx5_glue.c
@@ -391,16 +391,20 @@
 }
 
 static void *
-mlx5_glue_dr_create_flow_action_dest_vport(void *domain, uint32_t vport)
+mlx5_glue_dr_create_flow_action_dest_port(void *domain, uint32_t port)
 {
+#ifdef HAVE_MLX5DV_DR_DEVX_PORT
+	return mlx5dv_dr_action_create_dest_ib_port(domain, port);
+#else
 #ifdef HAVE_MLX5DV_DR_ESWITCH
-	return mlx5dv_dr_action_create_dest_vport(domain, vport);
+	return mlx5dv_dr_action_create_dest_vport(domain, port);
 #else
 	(void)domain;
-	(void)vport;
+	(void)port;
 	errno = ENOTSUP;
 	return NULL;
 #endif
+#endif
 }
 
 static void *
@@ -1081,8 +1085,8 @@
 	.cq_ex_to_cq = mlx5_glue_cq_ex_to_cq,
 	.dr_create_flow_action_dest_flow_tbl =
 		mlx5_glue_dr_create_flow_action_dest_flow_tbl,
-	.dr_create_flow_action_dest_vport =
-		mlx5_glue_dr_create_flow_action_dest_vport,
+	.dr_create_flow_action_dest_port =
+		mlx5_glue_dr_create_flow_action_dest_port,
 	.dr_create_flow_action_drop =
 		mlx5_glue_dr_create_flow_action_drop,
 	.dr_create_flow_action_push_vlan =
diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h
index 7ad6379..6442f1e 100644
--- a/drivers/net/mlx5/mlx5_glue.h
+++ b/drivers/net/mlx5/mlx5_glue.h
@@ -165,7 +165,8 @@ struct mlx5_glue {
 	const char *(*port_state_str)(enum ibv_port_state port_state);
 	struct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq);
 	void *(*dr_create_flow_action_dest_flow_tbl)(void *tbl);
-	void *(*dr_create_flow_action_dest_vport)(void *domain, uint32_t vport);
+	void *(*dr_create_flow_action_dest_port)(void *domain,
+						 uint32_t port);
 	void *(*dr_create_flow_action_drop)();
 	void *(*dr_create_flow_action_push_vlan)
 					(struct mlx5dv_dr_domain *domain,
-- 
1.8.3.1


             reply	other threads:[~2019-11-19  9:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  9:16 Viacheslav Ovsiienko [this message]
2019-11-19 15:59 ` Raslan Darawsheh

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=1574154964-24045-1-git-send-email-viacheslavo@mellanox.com \
    --to=viacheslavo@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=matan@mellanox.com \
    --cc=orika@mellanox.com \
    --cc=rasland@mellanox.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).