DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yongseok Koh <yskoh@mellanox.com>
To: Thomas Monjalon <thomas@monjalon.net>,
	Shahaf Shuler <shahafs@mellanox.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Ori Kam <orika@mellanox.com>
Subject: [dpdk-dev] [PATCH v3 11/11] net/mlx5: add runtime parameter to enable Direct Verbs
Date: Mon, 24 Sep 2018 23:17:54 +0000	[thread overview]
Message-ID: <20180924231721.15799-12-yskoh@mellanox.com> (raw)
In-Reply-To: <20180924231721.15799-1-yskoh@mellanox.com>

From: Ori Kam <orika@mellanox.com>

DV flow API is based on new kernel API and is
missing some functionality like counter but add other functionality
like encap.

In order not to affect current users even if the kernel supports
the new DV API it should be enabled only manually.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
 doc/guides/nics/mlx5.rst     | 7 +++++++
 drivers/net/mlx5/mlx5.c      | 6 ++++++
 drivers/net/mlx5/mlx5.h      | 1 +
 drivers/net/mlx5/mlx5_flow.c | 9 +++++++--
 4 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index dbdb90b59..67696283e 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -397,6 +397,13 @@ Run-time configuration
 
   Disabled by default.
 
+- ``dv_flow_en`` parameter [int]
+
+  A nonzero value enables the DV flow steering assuming it is supported
+  by the driver.
+
+  Disabled by default.
+
 - ``representor`` parameter [list]
 
   This parameter can be used to instantiate DPDK Ethernet devices from
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index ab44864e9..9b208109b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -90,6 +90,9 @@
 /* Allow L3 VXLAN flow creation. */
 #define MLX5_L3_VXLAN_EN "l3_vxlan_en"
 
+/* Activate DV flow steering. */
+#define MLX5_DV_FLOW_EN "dv_flow_en"
+
 /* Activate Netlink support in VF mode. */
 #define MLX5_VF_NL_EN "vf_nl_en"
 
@@ -491,6 +494,8 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
 		config->l3_vxlan_en = !!tmp;
 	} else if (strcmp(MLX5_VF_NL_EN, key) == 0) {
 		config->vf_nl_en = !!tmp;
+	} else if (strcmp(MLX5_DV_FLOW_EN, key) == 0) {
+		config->dv_flow_en = !!tmp;
 	} else {
 		DRV_LOG(WARNING, "%s: unknown parameter", key);
 		rte_errno = EINVAL;
@@ -528,6 +533,7 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
 		MLX5_RX_VEC_EN,
 		MLX5_L3_VXLAN_EN,
 		MLX5_VF_NL_EN,
+		MLX5_DV_FLOW_EN,
 		MLX5_REPRESENTOR,
 		NULL,
 	};
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 8ff6d6987..8bb619d9e 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -111,6 +111,7 @@ struct mlx5_dev_config {
 	unsigned int mpw_hdr_dseg:1; /* Enable DSEGs in the title WQEBB. */
 	unsigned int l3_vxlan_en:1; /* Enable L3 VXLAN flow creation. */
 	unsigned int vf_nl_en:1; /* Enable Netlink requests in VF mode. */
+	unsigned int dv_flow_en:1; /* Enable DV flow. */
 	unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */
 	struct {
 		unsigned int enabled:1; /* Whether MPRQ is enabled. */
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index c6c145021..6a4a5d17e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2487,10 +2487,15 @@ mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,
  *   Pointer to Ethernet device structure.
  */
 void
-mlx5_flow_init_driver_ops(struct rte_eth_dev *dev __rte_unused)
+mlx5_flow_init_driver_ops(struct rte_eth_dev *dev)
 {
+	struct priv *priv __rte_unused = dev->data->dev_private;
+
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
-	mlx5_flow_dv_get_driver_ops(&nic_ops);
+	if (priv->config.dv_flow_en)
+		mlx5_flow_dv_get_driver_ops(&nic_ops);
+	else
+		mlx5_flow_verbs_get_driver_ops(&nic_ops);
 #else
 	mlx5_flow_verbs_get_driver_ops(&nic_ops);
 #endif
-- 
2.11.0

  parent reply	other threads:[~2018-09-24 23:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19  7:21 [dpdk-dev] [PATCH 0/3] migrate Linux TC flower driver to new flow engine Yongseok Koh
2018-09-19  7:21 ` [dpdk-dev] [PATCH 1/3] net/mlx5: add abstraction for multiple flow drivers Yongseok Koh
2018-09-19  7:21 ` [dpdk-dev] [PATCH 2/3] net/mlx5: remove Netlink flow driver Yongseok Koh
2018-09-19  7:21 ` [dpdk-dev] [PATCH 3/3] net/mlx5: add Linux TC flower driver for E-Switch flow Yongseok Koh
2018-09-24 19:55 ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: migrate Linux TC flower driver to new flow engine Yongseok Koh
2018-09-24 19:55   ` [dpdk-dev] [PATCH v2 1/3] net/mlx5: add abstraction for multiple flow drivers Yongseok Koh
2018-09-24 19:55   ` [dpdk-dev] [PATCH v2 2/3] net/mlx5: remove Netlink flow driver Yongseok Koh
2018-09-24 19:55   ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: add Linux TC flower driver for E-Switch flow Yongseok Koh
2018-10-04 16:16   ` [dpdk-dev] [PATCH v2 0/3] net/mlx5: migrate Linux TC flower driver to new flow engine Thomas Monjalon
2018-09-24 23:17 ` [dpdk-dev] [PATCH v3 00/11] net/mlx5: add Direct Verbs flow driver support Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 01/11] net/mlx5: split flow validation to dedicated function Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 02/11] net/mlx5: add flow prepare function Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 03/11] net/mlx5: add flow translate function Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 04/11] net/mlx5: add support for multiple flow drivers Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 05/11] net/mlx5: add Direct Verbs validation function Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 06/11] net/mlx5: add Direct Verbs prepare function Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 07/11] net/mlx5: add Direct Verbs translate items Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 08/11] net/mlx5: add Direct Verbs translate actions Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 09/11] net/mlx5: add Direct Verbs driver to glue Yongseok Koh
2018-09-24 23:17   ` [dpdk-dev] [PATCH v3 10/11] net/mlx5: add Direct Verbs final functions Yongseok Koh
2018-09-24 23:17   ` Yongseok Koh [this message]
2018-10-04 16:17   ` [dpdk-dev] [PATCH v3 00/11] net/mlx5: add Direct Verbs flow driver support Thomas Monjalon

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=20180924231721.15799-12-yskoh@mellanox.com \
    --to=yskoh@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=orika@mellanox.com \
    --cc=shahafs@mellanox.com \
    --cc=thomas@monjalon.net \
    /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).