DPDK patches and discussions
 help / color / mirror / Atom feed
From: Beilei Xing <beilei.xing@intel.com>
To: jingjing.wu@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/i40e: implement flag action for FDIR
Date: Sat, 27 May 2017 10:46:00 +0800	[thread overview]
Message-ID: <1495853160-36691-1-git-send-email-beilei.xing@intel.com> (raw)

This commit adds flag action support for flow director.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 218ece1..2af88c6 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2813,7 +2813,6 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
 	else
 		filter->action.behavior = RTE_ETH_FDIR_REJECT;
 
-	filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
 	filter->action.rx_queue = act_q->index;
 
 	if (filter->action.rx_queue >= pf->dev_data->nb_rx_queues) {
@@ -2823,10 +2822,11 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
 		return -rte_errno;
 	}
 
-	/* Check if the next non-void item is MARK or END. */
+	/* Check if the next non-void item is MARK or FLAG or END. */
 	index++;
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	if (act->type != RTE_FLOW_ACTION_TYPE_MARK &&
+	    act->type != RTE_FLOW_ACTION_TYPE_FLAG &&
 	    act->type != RTE_FLOW_ACTION_TYPE_END) {
 		rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
 				   act, "Invalid action.");
@@ -2835,17 +2835,21 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
 
 	if (act->type == RTE_FLOW_ACTION_TYPE_MARK) {
 		mark_spec = (const struct rte_flow_action_mark *)act->conf;
+		filter->action.report_status = RTE_ETH_FDIR_REPORT_ID;
 		filter->soft_id = mark_spec->id;
+	} else if (act->type == RTE_FLOW_ACTION_TYPE_FLAG)
+		filter->action.report_status = RTE_ETH_FDIR_NO_REPORT_STATUS;
+	else if (act->type == RTE_FLOW_ACTION_TYPE_END)
+		return 0;
 
-		/* Check if the next non-void item is END */
-		index++;
-		NEXT_ITEM_OF_ACTION(act, actions, index);
-		if (act->type != RTE_FLOW_ACTION_TYPE_END) {
-			rte_flow_error_set(error, EINVAL,
-					   RTE_FLOW_ERROR_TYPE_ACTION,
-					   act, "Invalid action.");
-			return -rte_errno;
-		}
+	/* Check if the next non-void item is END */
+	index++;
+	NEXT_ITEM_OF_ACTION(act, actions, index);
+	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
+		rte_flow_error_set(error, EINVAL,
+				   RTE_FLOW_ERROR_TYPE_ACTION,
+				   act, "Invalid action.");
+		return -rte_errno;
 	}
 
 	return 0;
-- 
2.5.5

             reply	other threads:[~2017-05-27  2:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27  2:46 Beilei Xing [this message]
2017-05-31 23:47 ` [dpdk-dev] [PATCH v2] net/i40e: update actions " Beilei Xing
2017-06-02  2:22   ` Wu, Jingjing
2017-06-06 10:16     ` 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=1495853160-36691-1-git-send-email-beilei.xing@intel.com \
    --to=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.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).