net/octeontx2: add gre key parsing support
PATCH 1/1 net/octeontx2: add gre key parsing support
From: Kiran Kumar K <[email protected]>
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.
--- doc/guides/nics/octeontx2.rst | 96 +++++++++++++------------ drivers/net/octeontx2/otx2_flow_parse.c | 7 ++ 2 files changed, 56 insertions(+), 47 deletions(-)
doc/guides/nics/octeontx2.rst +49 -47
@@ -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:
drivers/net/octeontx2/otx2_flow_parse.c +7 -0
@@ -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 ;
Signature · 1 line
2.17.1
Quoted 11 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, July 26, 2019 2:33 PM
To: Jerin Jacob Kollanukkaran <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; John McNamara <[email protected]>; Marko Kovacevic <[email protected]>
Cc: [email protected]
Subject: [dpdk-dev] [PATCH] net/octeontx2: add gre key parsing support
Quoted 7 lines
From: Kiran Kumar K <[email protected]>
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 <[email protected]>
Instead of introducing a new colum for RTE_FLOW_ITEM_TYPE_GRE_KEY comment, add the comment as NOTE
Applied to dpdk-next-net-mrvl/master. Thanks