From: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
To: dev@dpdk.org
Cc: Yongseok Koh <yskoh@mellanox.com>,
Adrien Mazarguil <adrien.mazarguil@6wind.com>
Subject: [dpdk-dev] [PATCH] net/mlx5: fix flow director matching rules
Date: Fri, 27 Oct 2017 08:50:00 +0200 [thread overview]
Message-ID: <f2bec253721344d85a2d510019aeff78aa55bdc4.1509086974.git.nelio.laranjeiro@6wind.com> (raw)
Flow director API does not provide a layer 2 configuration when the filter
is for layer 3 and 4 causing the translation to generic flow API to be
wrong, as not providing a mask for layer ends by using the default one. In
this case, the Ethernet mask layer is full whereas it must be empty.
Fixes: 4c3e9bcdd52e ("net/mlx5: support flow director")
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
drivers/net/mlx5/mlx5_flow.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index f392f1f65..567c7f675 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -479,6 +479,7 @@ struct mlx5_fdir {
struct rte_flow_action actions[2];
struct rte_flow_item items[4];
struct rte_flow_item_eth l2;
+ struct rte_flow_item_eth l2_mask;
union {
struct rte_flow_item_ipv4 ipv4;
struct rte_flow_item_ipv6 ipv6;
@@ -2615,6 +2616,7 @@ priv_fdir_filter_convert(struct priv *priv,
attributes->items[0] = (struct rte_flow_item) {
.type = RTE_FLOW_ITEM_TYPE_ETH,
.spec = &attributes->l2,
+ .mask = &attributes->l2_mask,
};
switch (fdir_filter->action.behavior) {
case RTE_ETH_FDIR_ACCEPT:
@@ -2778,6 +2780,11 @@ priv_fdir_filter_add(struct priv *priv,
{
struct mlx5_fdir attributes = {
.attr.group = 0,
+ .l2_mask = {
+ .dst.addr_bytes = "\x00\x00\x00\x00\x00\x00",
+ .src.addr_bytes = "\x00\x00\x00\x00\x00\x00",
+ .type = 0,
+ },
};
struct mlx5_flow_parse parser = {
.layer = HASH_RXQ_ETH,
--
2.11.0
next reply other threads:[~2017-10-27 6:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-27 6:50 Nelio Laranjeiro [this message]
2017-10-31 0:53 ` Ferruh Yigit
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=f2bec253721344d85a2d510019aeff78aa55bdc4.1509086974.git.nelio.laranjeiro@6wind.com \
--to=nelio.laranjeiro@6wind.com \
--cc=adrien.mazarguil@6wind.com \
--cc=dev@dpdk.org \
--cc=yskoh@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).