DPDK patches and discussions
 help / color / mirror / Atom feed
From: <kirankumark@marvell.com>
To: Jerin Jacob <jerinj@marvell.com>,
	Nithin Dabilpuram <ndabilpuram@marvell.com>,
	Kiran Kumar K <kirankumark@marvell.com>,
	"John McNamara" <john.mcnamara@intel.com>,
	Marko Kovacevic <marko.kovacevic@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev]  [PATCH] net/octeontx2: add gre key parsing support
Date: Fri, 26 Jul 2019 14:33:03 +0530	[thread overview]
Message-ID: <20190726090303.7809-1-kirankumark@marvell.com> (raw)

From: Kiran Kumar K <kirankumark@marvell.com>

Adding support to parse GRE KEY for octeontx2 Flow.
Matching on GRE Key will only work, if checksum and routing
bits in the GRE header are equal to 0.

Signed-off-by: Kiran Kumar K <kirankumark@marvell.com>
---
 doc/guides/nics/octeontx2.rst           | 96 +++++++++++++------------
 drivers/net/octeontx2/otx2_flow_parse.c |  7 ++
 2 files changed, 56 insertions(+), 47 deletions(-)

diff --git a/doc/guides/nics/octeontx2.rst b/doc/guides/nics/octeontx2.rst
index 5f511feb7..ce54de478 100644
--- a/doc/guides/nics/octeontx2.rst
+++ b/doc/guides/nics/octeontx2.rst
@@ -221,53 +221,55 @@ Patterns:
 
 .. table:: Item types
 
-   +----+--------------------------------+
-   | #  | Pattern Type                   |
-   +====+================================+
-   | 1  | RTE_FLOW_ITEM_TYPE_ETH         |
-   +----+--------------------------------+
-   | 2  | RTE_FLOW_ITEM_TYPE_VLAN        |
-   +----+--------------------------------+
-   | 3  | RTE_FLOW_ITEM_TYPE_E_TAG       |
-   +----+--------------------------------+
-   | 4  | RTE_FLOW_ITEM_TYPE_IPV4        |
-   +----+--------------------------------+
-   | 5  | RTE_FLOW_ITEM_TYPE_IPV6        |
-   +----+--------------------------------+
-   | 6  | RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4|
-   +----+--------------------------------+
-   | 7  | RTE_FLOW_ITEM_TYPE_MPLS        |
-   +----+--------------------------------+
-   | 8  | RTE_FLOW_ITEM_TYPE_ICMP        |
-   +----+--------------------------------+
-   | 9  | RTE_FLOW_ITEM_TYPE_UDP         |
-   +----+--------------------------------+
-   | 10 | RTE_FLOW_ITEM_TYPE_TCP         |
-   +----+--------------------------------+
-   | 11 | RTE_FLOW_ITEM_TYPE_SCTP        |
-   +----+--------------------------------+
-   | 12 | RTE_FLOW_ITEM_TYPE_ESP         |
-   +----+--------------------------------+
-   | 13 | RTE_FLOW_ITEM_TYPE_GRE         |
-   +----+--------------------------------+
-   | 14 | RTE_FLOW_ITEM_TYPE_NVGRE       |
-   +----+--------------------------------+
-   | 15 | RTE_FLOW_ITEM_TYPE_VXLAN       |
-   +----+--------------------------------+
-   | 16 | RTE_FLOW_ITEM_TYPE_GTPC        |
-   +----+--------------------------------+
-   | 17 | RTE_FLOW_ITEM_TYPE_GTPU        |
-   +----+--------------------------------+
-   | 18 | RTE_FLOW_ITEM_TYPE_GENEVE      |
-   +----+--------------------------------+
-   | 19 | RTE_FLOW_ITEM_TYPE_VXLAN_GPE   |
-   +----+--------------------------------+
-   | 20 | RTE_FLOW_ITEM_TYPE_IPV6_EXT    |
-   +----+--------------------------------+
-   | 21 | RTE_FLOW_ITEM_TYPE_VOID        |
-   +----+--------------------------------+
-   | 22 | RTE_FLOW_ITEM_TYPE_ANY         |
-   +----+--------------------------------+
+   +----+--------------------------------+-----------------------------------+
+   | #  | Pattern Type                   |         Comment                   |
+   +====+================================+===================================+
+   | 1  | RTE_FLOW_ITEM_TYPE_ETH         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 2  | RTE_FLOW_ITEM_TYPE_VLAN        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 3  | RTE_FLOW_ITEM_TYPE_E_TAG       |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 4  | RTE_FLOW_ITEM_TYPE_IPV4        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 5  | RTE_FLOW_ITEM_TYPE_IPV6        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 6  | RTE_FLOW_ITEM_TYPE_ARP_ETH_IPV4|                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 7  | RTE_FLOW_ITEM_TYPE_MPLS        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 8  | RTE_FLOW_ITEM_TYPE_ICMP        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 9  | RTE_FLOW_ITEM_TYPE_UDP         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 10 | RTE_FLOW_ITEM_TYPE_TCP         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 11 | RTE_FLOW_ITEM_TYPE_SCTP        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 12 | RTE_FLOW_ITEM_TYPE_ESP         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 13 | RTE_FLOW_ITEM_TYPE_GRE         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 14 | RTE_FLOW_ITEM_TYPE_NVGRE       |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 15 | RTE_FLOW_ITEM_TYPE_VXLAN       |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 16 | RTE_FLOW_ITEM_TYPE_GTPC        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 17 | RTE_FLOW_ITEM_TYPE_GTPU        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 18 | RTE_FLOW_ITEM_TYPE_GENEVE      |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 19 | RTE_FLOW_ITEM_TYPE_VXLAN_GPE   |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 20 | RTE_FLOW_ITEM_TYPE_IPV6_EXT    |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 21 | RTE_FLOW_ITEM_TYPE_VOID        |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 22 | RTE_FLOW_ITEM_TYPE_ANY         |                                   |
+   +----+--------------------------------+-----------------------------------+
+   | 23 | RTE_FLOW_ITEM_TYPE_GRE_KEY     | chksum & routing should be 0      |
+   +----+--------------------------------+-----------------------------------+
 
 Actions:
 
diff --git a/drivers/net/octeontx2/otx2_flow_parse.c b/drivers/net/octeontx2/otx2_flow_parse.c
index 6e65db8e4..6670c1a70 100644
--- a/drivers/net/octeontx2/otx2_flow_parse.c
+++ b/drivers/net/octeontx2/otx2_flow_parse.c
@@ -389,6 +389,7 @@ int
 otx2_flow_parse_ld(struct otx2_parse_state *pst)
 {
 	char hw_mask[NPC_MAX_EXTRACT_DATA_LEN];
+	uint32_t gre_key_mask = 0xffffffff;
 	struct otx2_flow_item_info info;
 	int lid, lt, lflags;
 	int rc;
@@ -450,6 +451,12 @@ otx2_flow_parse_ld(struct otx2_parse_state *pst)
 		info.def_mask = &rte_flow_item_gre_mask;
 		info.len = sizeof(struct rte_flow_item_gre);
 		break;
+	case RTE_FLOW_ITEM_TYPE_GRE_KEY:
+		lt = NPC_LT_LD_GRE;
+		info.def_mask = &gre_key_mask;
+		info.len = sizeof(gre_key_mask);
+		info.hw_hdr_len = 4;
+		break;
 	case RTE_FLOW_ITEM_TYPE_NVGRE:
 		lt = NPC_LT_LD_GRE;
 		lflags = NPC_F_GRE_NVGRE;
-- 
2.17.1


             reply	other threads:[~2019-07-26  9:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-26  9:03 kirankumark [this message]
2019-07-28 17:22 ` Jerin Jacob Kollanukkaran

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=20190726090303.7809-1-kirankumark@marvell.com \
    --to=kirankumark@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=john.mcnamara@intel.com \
    --cc=marko.kovacevic@intel.com \
    --cc=ndabilpuram@marvell.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).