net/octeontx2: support GRE key parsing

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>
Acked-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Kiran Kumar K 2019-07-26 14:33:03 +05:30 committed by Ferruh Yigit
parent 122135e73c
commit e0e5d23b3c
2 changed files with 14 additions and 0 deletions

View File

@ -268,6 +268,13 @@ Patterns:
+----+--------------------------------+
| 22 | RTE_FLOW_ITEM_TYPE_ANY |
+----+--------------------------------+
| 23 | RTE_FLOW_ITEM_TYPE_GRE_KEY |
+----+--------------------------------+
.. note::
``RTE_FLOW_ITEM_TYPE_GRE_KEY`` works only when checksum and routing
bits in the GRE header are equal to 0.
Actions:

View File

@ -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;