DPDK patches and discussions
 help / color / mirror / Atom feed
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 4/6] net/mlx5: fix flow director drop action
Date: Thu, 19 Oct 2017 14:51:32 +0200	[thread overview]
Message-ID: <3ea64d71e26f882df268a42a16beb2af339b5e05.1508417257.git.nelio.laranjeiro@6wind.com> (raw)
In-Reply-To: <cover.1508417257.git.nelio.laranjeiro@6wind.com>
In-Reply-To: <cover.1508417257.git.nelio.laranjeiro@6wind.com>

Flow director drop action as not been brought back with the new
implementation on top of rte flow.

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 | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 6f458f44a..96a753e8d 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2601,20 +2601,27 @@ priv_fdir_filter_convert(struct priv *priv,
 		ERROR("invalid queue number %d", fdir_filter->action.rx_queue);
 		return EINVAL;
 	}
-	/* Validate the behavior. */
-	if (fdir_filter->action.behavior != RTE_ETH_FDIR_ACCEPT) {
-		ERROR("invalid behavior %d", fdir_filter->action.behavior);
-		return ENOTSUP;
-	}
 	attributes->attr.ingress = 1;
 	attributes->items[0] = (struct rte_flow_item) {
 		.type = RTE_FLOW_ITEM_TYPE_ETH,
 		.spec = &attributes->l2,
 	};
-	attributes->actions[0] = (struct rte_flow_action){
-		.type = RTE_FLOW_ACTION_TYPE_QUEUE,
-		.conf = &attributes->queue,
-	};
+	switch (fdir_filter->action.behavior) {
+	case RTE_ETH_FDIR_ACCEPT:
+		attributes->actions[0] = (struct rte_flow_action){
+			.type = RTE_FLOW_ACTION_TYPE_QUEUE,
+			.conf = &attributes->queue,
+		};
+		break;
+	case RTE_ETH_FDIR_REJECT:
+		attributes->actions[0] = (struct rte_flow_action){
+			.type = RTE_FLOW_ACTION_TYPE_DROP,
+		};
+		break;
+	default:
+		ERROR("invalid behavior %d", fdir_filter->action.behavior);
+		return ENOTSUP;
+	}
 	attributes->queue.index = fdir_filter->action.rx_queue;
 	switch (fdir_filter->input.flow_type) {
 	case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
-- 
2.11.0

  parent reply	other threads:[~2017-10-19 12:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 12:51 [dpdk-dev] [PATCH 0/6] net/mlx5: fixes Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 1/6] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 2/6] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 3/6] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-19 12:51 ` Nelio Laranjeiro [this message]
2017-10-19 12:51 ` [dpdk-dev] [PATCH 5/6] net/mlx5: fix mark action with drop action Nelio Laranjeiro
2017-10-19 12:51 ` [dpdk-dev] [PATCH 6/6] net/mlx5: fix allmulti mode Nelio Laranjeiro
2017-10-19 19:36 ` [dpdk-dev] [PATCH 0/6] net/mlx5: fixes Yongseok Koh
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 0/7] " Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 " Nelio Laranjeiro
2017-10-24 19:07     ` Ferruh Yigit
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 1/7] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 2/7] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 3/7] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 4/7] net/mlx5: fix flow director drop action Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 5/7] net/mlx5: fix mark action with " Nelio Laranjeiro
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 6/7] net/mlx5: fix reception when VLAN is added Nelio Laranjeiro
2017-10-24 17:34     ` Yongseok Koh
2017-10-24 15:18   ` [dpdk-dev] [PATCH v3 7/7] net/mlx5: fix flow director flow add Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 1/7] net/mlx5: fix segfault on flow creation Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 2/7] net/mlx5: fix work queue array size Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 3/7] net/mlx5: fix drop flows when port is stopped Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 4/7] net/mlx5: fix flow director drop action Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 5/7] net/mlx5: fix mark action with " Nelio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 6/7] net/mlx5: fix reception when VLAN is added Nelio Laranjeiro
2017-10-23 19:25   ` Yongseok Koh
2017-10-24  7:11     ` Nélio Laranjeiro
2017-10-24  7:34       ` Nélio Laranjeiro
2017-10-24 13:41         ` Yongseok Koh
2017-10-24 14:19           ` Nélio Laranjeiro
2017-10-23 14:49 ` [dpdk-dev] [PATCH v2 7/7] net/mlx5: fix flow director flow add Nelio Laranjeiro
2017-10-23 20:48   ` Yongseok Koh

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=3ea64d71e26f882df268a42a16beb2af339b5e05.1508417257.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).