common/cnxk: fix QinQ ROC item mismatch
authorSatheesh Paul <psatheesh@marvell.com>
Thu, 17 Mar 2022 03:50:36 +0000 (09:20 +0530)
committerJerin Jacob <jerinj@marvell.com>
Mon, 25 Apr 2022 05:08:21 +0000 (07:08 +0200)
ROC code is assuming presence of vlan extension headers in
case of QinQ, because of this, there is incompatibility
between the driver and ROC. Fixed this in ROC by treating
QINQ as multiple VLAN pattern items for DPDK (as opposed to
treating QINQ as separate pattern item).

Fixes: b8ac8b089ce ("common/cnxk: support matching VLAN existence")
Cc: stable@dpdk.org
Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
drivers/common/cnxk/roc_npc_parse.c

index 364a846..1ce0dad 100644 (file)
@@ -351,15 +351,10 @@ npc_parse_lb(struct npc_parse_state *pst)
                }
                info.len = pattern->size;
        } else if (pst->pattern->type == ROC_NPC_ITEM_TYPE_QINQ) {
-               vlan_item[0] = pst->pattern->spec;
                info.hw_mask = NULL;
-               info.len = sizeof(vlan_item[0]->hdr);
+               info.len = pattern->size;
                lt = NPC_LT_LB_STAG_QINQ;
                lflags = NPC_F_STAG_CTAG;
-               if (vlan_item[0] && vlan_item[0]->has_more_vlan) {
-                       lflags = NPC_F_LB_L_WITH_QINQ_CTAG &
-                                NPC_F_LB_L_WITH_QINQ_QINQ;
-               }
        } else if (pst->pattern->type == ROC_NPC_ITEM_TYPE_RAW) {
                raw_spec = pst->pattern->spec;
                if (raw_spec->relative)