DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mesut Ali Ergin <mesut.a.ergin@intel.com>
To: beilei.xing@intel.com, qi.z.zhang@intel.com
Cc: dev@dpdk.org, Mesut Ali Ergin <mesut.a.ergin@intel.com>
Subject: [dpdk-dev] [PATCH 1/3] net/i40e: add support for MARK + RSS action in rte_flow
Date: Wed, 15 May 2019 21:28:03 -0700	[thread overview]
Message-ID: <1557980885-183777-2-git-send-email-mesut.a.ergin@intel.com> (raw)
In-Reply-To: <1557980885-183777-1-git-send-email-mesut.a.ergin@intel.com>

Currently, i40e Flow Director action parser only allows following nine
action combinations: (QUEUE, PASSTHRU, DROP, QUEUE + MARK, PASSTHRU +
MARK, DROP + MARK, QUEUE + FLAG, PASSTHRU + FLAG, DROP + FLAG)

Using the existing Cloud Filter profile on the NIC, it is possible to
add support for two more combinations as: (MARK + RSS, MARK + FLAG +
RSS)

Addition of these new combinations would allow more applications to
utilize DPDK rte_flow to implement hardware flow offloads with Intel
Ethernet 700 series network adapters, including but not limited to the
existing OVS DPDK partial hardware flow offload feature.

Signed-off-by: Mesut Ali Ergin <mesut.a.ergin@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 5447e4e..d4d564f 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -3078,6 +3078,12 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
 	case RTE_FLOW_ACTION_TYPE_PASSTHRU:
 		filter->action.behavior = I40E_FDIR_PASSTHRU;
 		break;
+	case RTE_FLOW_ACTION_TYPE_MARK:
+		filter->action.behavior = I40E_FDIR_PASSTHRU;
+		mark_spec = act->conf;
+		filter->action.report_status = I40E_FDIR_REPORT_ID;
+		filter->soft_id = mark_spec->id;
+	break;
 	default:
 		rte_flow_error_set(error, EINVAL,
 				   RTE_FLOW_ERROR_TYPE_ACTION, act,
@@ -3090,13 +3096,36 @@ i40e_flow_parse_fdir_action(struct rte_eth_dev *dev,
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	switch (act->type) {
 	case RTE_FLOW_ACTION_TYPE_MARK:
+		if (!mark_spec) {
+			/* Double MARK actions requested */
+			rte_flow_error_set(error, EINVAL,
+			   RTE_FLOW_ERROR_TYPE_ACTION, act,
+			   "Invalid action.");
+			return -rte_errno;
+		}
 		mark_spec = act->conf;
 		filter->action.report_status = I40E_FDIR_REPORT_ID;
 		filter->soft_id = mark_spec->id;
 		break;
 	case RTE_FLOW_ACTION_TYPE_FLAG:
+		if (!mark_spec) {
+			/* MARK + FLAG not supported */
+			rte_flow_error_set(error, EINVAL,
+					   RTE_FLOW_ERROR_TYPE_ACTION, act,
+					   "Invalid action.");
+			return -rte_errno;
+		}
 		filter->action.report_status = I40E_FDIR_NO_REPORT_STATUS;
 		break;
+	case RTE_FLOW_ACTION_TYPE_RSS:
+		if (filter->action.behavior != I40E_FDIR_PASSTHRU) {
+			/* RSS filter won't be next if FDIR did not pass thru */
+			rte_flow_error_set(error, EINVAL,
+					   RTE_FLOW_ERROR_TYPE_ACTION, act,
+					   "Invalid action.");
+			return -rte_errno;
+		}
+		break;
 	case RTE_FLOW_ACTION_TYPE_END:
 		return 0;
 	default:
-- 
2.7.4

  parent reply	other threads:[~2019-05-16  4:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16  4:28 [dpdk-dev] [PATCH 0/3] net/i40e: improve rte_flow offload with MARK + RSS Mesut Ali Ergin
2019-05-16  4:28 ` Mesut Ali Ergin
2019-05-16  4:28 ` Mesut Ali Ergin [this message]
2019-05-16  4:28   ` [dpdk-dev] [PATCH 1/3] net/i40e: add support for MARK + RSS action in rte_flow Mesut Ali Ergin
2019-05-22 12:30   ` Zhang, Qi Z
2019-05-16  4:28 ` [dpdk-dev] [PATCH 2/3] net/i40e: add runtime option to disable vector rx Mesut Ali Ergin
2019-05-16  4:28   ` Mesut Ali Ergin
2019-05-16  8:17   ` Maxime Coquelin
2019-05-16  8:17     ` Maxime Coquelin
2019-05-16 21:26     ` Ergin, Mesut A
2019-05-20  8:29   ` Ananyev, Konstantin
2019-05-20 17:53     ` Ergin, Mesut A
2019-05-20 23:11       ` Ananyev, Konstantin
2019-05-21 16:33         ` Ergin, Mesut A
2019-05-21 17:20           ` Ananyev, Konstantin
2019-05-21 20:55             ` Ergin, Mesut A
2019-05-22 11:01               ` Ananyev, Konstantin
2019-05-22 14:05                 ` Thomas Monjalon
2019-05-22 14:32                   ` Zhang, Qi Z
2019-05-23 13:10                     ` Jerin Jacob Kollanukkaran
2019-05-23 17:54                 ` Ergin, Mesut A
2019-05-16  4:28 ` [dpdk-dev] [PATCH 3/3] net/i40e: fix inadvertent override of vector RX allowance Mesut Ali Ergin
2019-05-16  4:28   ` Mesut Ali Ergin
2019-05-16  8:17   ` Maxime Coquelin
2019-05-16  8:17     ` Maxime Coquelin
2019-05-16 20:57     ` Ergin, Mesut A
2019-05-22 12:42   ` Zhang, Qi Z
2019-05-23 18:25     ` Ergin, Mesut A
2019-05-24  2:39       ` Zhang, Qi Z
2019-05-24 18:08         ` Ergin, Mesut A
2019-05-25 11:29           ` Zhang, Qi Z

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=1557980885-183777-2-git-send-email-mesut.a.ergin@intel.com \
    --to=mesut.a.ergin@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@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).