From: Shiri Kuzin <shirik@mellanox.com>
To: dev@dpdk.org
Cc: matan@mellanox.com, rasland@mellanox.com, viacheslavo@mellanox.com
Subject: [dpdk-dev] [RFC 3/3] net/mlx5: add new devarg dv_lacp_by_user
Date: Tue, 2 Jun 2020 12:38:11 +0300 [thread overview]
Message-ID: <e392b00e68422842473b84dd67f785b44ccc56df.1591088325.git.shirik@mellanox.com> (raw)
In-Reply-To: <cover.1591088325.git.shirik@mellanox.com>
The new devarg will control the steering of the lacp traffic.
when setting dv_lacp_by_user = 0 the lacp traffic will be
steered to kernel and managed there.
When setting dv_lacp_by_user = 1 the lacp traffic will
not be steered and the user will need to manage it.
Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
---
drivers/net/mlx5/mlx5.c | 6 ++++++
drivers/net/mlx5/mlx5.h | 2 ++
drivers/net/mlx5/mlx5_trigger.c | 9 +++++++++
3 files changed, 17 insertions(+)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 469ff73..f015050 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -140,6 +140,9 @@
/* Enable extensive flow metadata support. */
#define MLX5_DV_XMETA_EN "dv_xmeta_en"
+/* Device parameter to let the user manage the lacp traffic of bonded device */
+#define MLX5_DV_LACP_BY_USER "dv_lacp_by_user"
+
/* Activate Netlink support in VF mode. */
#define MLX5_VF_NL_EN "vf_nl_en"
@@ -1852,6 +1855,8 @@ struct mlx5_flow_id_pool *
return -rte_errno;
}
config->dv_xmeta_en = tmp;
+ } else if (strcmp(MLX5_DV_LACP_BY_USER, key) == 0) {
+ config->dv_lacp_by_user = !!tmp;
} else if (strcmp(MLX5_MR_EXT_MEMSEG_EN, key) == 0) {
config->mr_ext_memseg_en = !!tmp;
} else if (strcmp(MLX5_MAX_DUMP_FILES_NUM, key) == 0) {
@@ -1910,6 +1915,7 @@ struct mlx5_flow_id_pool *
MLX5_DV_ESW_EN,
MLX5_DV_FLOW_EN,
MLX5_DV_XMETA_EN,
+ MLX5_DV_LACP_BY_USER,
MLX5_MR_EXT_MEMSEG_EN,
MLX5_REPRESENTOR,
MLX5_MAX_DUMP_FILES_NUM,
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index bc57fb5..ff6bd83 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -157,6 +157,8 @@ struct mlx5_dev_config {
unsigned int dv_esw_en:1; /* Enable E-Switch DV flow. */
unsigned int dv_flow_en:1; /* Enable DV flow. */
unsigned int dv_xmeta_en:2; /* Enable extensive flow metadata. */
+ unsigned int dv_lacp_by_user:1;
+ /* Enable user to manage LACP traffic. */
unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */
unsigned int devx:1; /* Whether devx interface is available or not. */
unsigned int dest_tir:1; /* Whether advanced DR API is available. */
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index f123193..ef5c8f2 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -434,6 +434,10 @@
const struct rte_ether_addr cmp = {
.addr_bytes = "\x00\x00\x00\x00\x00\x00",
};
+ struct rte_flow_item_eth lacp_spec = {
+ .type = 0x8809,
+ .dst.addr_bytes = "\x01\x80\xc2\x00\x00\x02",
+ };
unsigned int i;
unsigned int j;
int ret;
@@ -464,6 +468,11 @@
" configured - only Eswitch group 0 flows are"
" supported.", dev->data->port_id);
}
+ if (!priv->config.dv_lacp_by_user && priv->pf_bond) {
+ ret = mlx5_flow_default_miss(dev,&lacp_spec);
+ if (ret)
+ goto error;
+ }
if (priv->isolated)
return 0;
if (dev->data->promiscuous) {
--
1.8.3.1
prev parent reply other threads:[~2020-06-02 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 9:38 [dpdk-dev] [RFC 0/3] mlx5: LACP handling for bonded devices Shiri Kuzin
2020-06-02 9:38 ` [dpdk-dev] [RFC 1/3] common/mlx5: add default miss action Shiri Kuzin
2020-06-02 9:38 ` [dpdk-dev] [RFC 2/3] net/mlx5: add default miss action to flow engine Shiri Kuzin
2020-06-02 9:38 ` Shiri Kuzin [this message]
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=e392b00e68422842473b84dd67f785b44ccc56df.1591088325.git.shirik@mellanox.com \
--to=shirik@mellanox.com \
--cc=dev@dpdk.org \
--cc=matan@mellanox.com \
--cc=rasland@mellanox.com \
--cc=viacheslavo@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).