ethdev: improve xstats names by IDs get prototype
[dpdk.git] / drivers / net / octeontx2 / otx2_lookup.c
index 89365ff..4764608 100644 (file)
@@ -169,15 +169,15 @@ nix_create_non_tunnel_ptype_array(uint16_t *ptype)
                case NPC_LT_LD_NVGRE:
                        val |= RTE_PTYPE_TUNNEL_NVGRE;
                        break;
-               case NPC_LT_LD_ESP:
-                       val |= RTE_PTYPE_TUNNEL_ESP;
-                       break;
                }
 
                switch (le) {
                case NPC_LT_LE_VXLAN:
                        val |= RTE_PTYPE_TUNNEL_VXLAN;
                        break;
+               case NPC_LT_LE_ESP:
+                       val |= RTE_PTYPE_TUNNEL_ESP;
+                       break;
                case NPC_LT_LE_VXLANGPE:
                        val |= RTE_PTYPE_TUNNEL_VXLAN_GPE;
                        break;
@@ -270,7 +270,9 @@ nix_create_rx_ol_flags_array(void *mem)
 
                switch (errlev) {
                case NPC_ERRLEV_RE:
-                       /* Mark all errors as BAD checksum errors */
+                       /* Mark all errors as BAD checksum errors
+                        * including Outer L2 length mismatch error
+                        */
                        if (errcode) {
                                val |= PKT_RX_IP_CKSUM_BAD;
                                val |= PKT_RX_L4_CKSUM_BAD;
@@ -283,7 +285,7 @@ nix_create_rx_ol_flags_array(void *mem)
                        if (errcode == NPC_EC_OIP4_CSUM ||
                            errcode == NPC_EC_IP_FRAG_OFFSET_1) {
                                val |= PKT_RX_IP_CKSUM_BAD;
-                               val |= PKT_RX_EIP_CKSUM_BAD;
+                               val |= PKT_RX_OUTER_IP_CKSUM_BAD;
                        } else {
                                val |= PKT_RX_IP_CKSUM_GOOD;
                        }
@@ -295,18 +297,26 @@ nix_create_rx_ol_flags_array(void *mem)
                                val |= PKT_RX_IP_CKSUM_GOOD;
                        break;
                case NPC_ERRLEV_NIX:
-                       val |= PKT_RX_IP_CKSUM_GOOD;
-                       if (errcode == NIX_RX_PERRCODE_OL4_CHK) {
-                               val |= PKT_RX_OUTER_L4_CKSUM_BAD;
+                       if (errcode == NIX_RX_PERRCODE_OL4_CHK ||
+                           errcode == NIX_RX_PERRCODE_OL4_LEN ||
+                           errcode == NIX_RX_PERRCODE_OL4_PORT) {
+                               val |= PKT_RX_IP_CKSUM_GOOD;
                                val |= PKT_RX_L4_CKSUM_BAD;
-                       } else if (errcode == NIX_RX_PERRCODE_IL4_CHK) {
+                               val |= PKT_RX_OUTER_L4_CKSUM_BAD;
+                       } else if (errcode == NIX_RX_PERRCODE_IL4_CHK ||
+                                  errcode == NIX_RX_PERRCODE_IL4_LEN ||
+                                  errcode == NIX_RX_PERRCODE_IL4_PORT) {
+                               val |= PKT_RX_IP_CKSUM_GOOD;
                                val |= PKT_RX_L4_CKSUM_BAD;
+                       } else if (errcode == NIX_RX_PERRCODE_IL3_LEN ||
+                                  errcode == NIX_RX_PERRCODE_OL3_LEN) {
+                               val |= PKT_RX_IP_CKSUM_BAD;
                        } else {
+                               val |= PKT_RX_IP_CKSUM_GOOD;
                                val |= PKT_RX_L4_CKSUM_GOOD;
                        }
                        break;
                }
-
                ol_flags[idx] = val;
        }
 }