Skip to contentSkip to conversation

drivers/octeontx2: fix parser error to ol_flags translation

PATCH Applied Sunil Kumar Kori 2 participants 2 messages Oct 3, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/octeontx2: fix parser error to ol_flags translation

NPC errors were incorrectly translated to ol_flag as error code enum was not in sync with NPC profile.

Fixes 371d3212cbed ("common/octeontx2: add build infrastructure and HW definition")
---
 drivers/common/octeontx2/hw/otx2_npc.h | 7 ++++---
 drivers/net/octeontx2/otx2_lookup.c    | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/common/octeontx2/hw/otx2_npc.h +4 -3
index 0f85d7fdb..8045bed11 100644
@@ -132,6 +132,7 @@ enum npc_kpu_err_code {
 	NPC_EC_NOERR = 0, /* has to be zero */
 	NPC_EC_UNK,
 	NPC_EC_IH_LENGTH,
+	NPC_EC_EDSA_UNK,
 	NPC_EC_L2_K1,
 	NPC_EC_L2_K2,
 	NPC_EC_L2_K3,
@@ -245,9 +246,6 @@ enum npc_kpu_lf_ltype {
 	NPC_LT_LF_TU_3RD_NSH,
 };
 
-/* Don't modify Ltypes upto SCTP, otherwise it will
- * effect flow tag calculation and thus RSS.
- */
 enum npc_kpu_lg_ltype {
 	NPC_LT_LG_TU_IP = 1,
 	NPC_LT_LG_TU_IP6,
@@ -255,6 +253,9 @@ enum npc_kpu_lg_ltype {
 	NPC_LT_LG_TU_ETHER_IN_NSH,
 };
 
+/* Don't modify Ltypes upto SCTP, otherwise it will
+ * effect flow tag calculation and thus RSS.
+ */
 enum npc_kpu_lh_ltype {
 	NPC_LT_LH_TU_TCP = 1,
 	NPC_LT_LH_TU_UDP,
drivers/net/octeontx2/otx2_lookup.c +1 -1
index 99199d08a..6cdca9b33 100644
@@ -272,13 +272,13 @@ 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;
 				val |= PKT_RX_L4_CKSUM_BAD;
 			} else if (errcode == NIX_RX_PERRCODE_IL4_CHK) {
 				val |= PKT_RX_L4_CKSUM_BAD;
 			} else {
-				val |= PKT_RX_IP_CKSUM_GOOD;
 				val |= PKT_RX_L4_CKSUM_GOOD;
 			}
 			break;
Signature · 1 line
2.17.2
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 7 lines · Sunil Kumar Kori

NPC errors were incorrectly translated to ol_flag as error code enum was not in sync with NPC profile.

Fixes 371d3212cbed ("common/octeontx2: add build infrastructure and HW definition")

Changed subject to drivers/octeontx2: fix checksum flag translation

Applied to dpdk-next-net-mrvl/master. Thanks

Quoted 59 lines
---
 drivers/common/octeontx2/hw/otx2_npc.h | 7 ++++---
 drivers/net/octeontx2/otx2_lookup.c    | 2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/common/octeontx2/hw/otx2_npc.h +4 -3
index 0f85d7fdb..8045bed11 100644
@@ -132,6 +132,7 @@ enum npc_kpu_err_code {
        NPC_EC_NOERR = 0, /* has to be zero */
        NPC_EC_UNK,
        NPC_EC_IH_LENGTH,
+       NPC_EC_EDSA_UNK,
        NPC_EC_L2_K1,
        NPC_EC_L2_K2,
        NPC_EC_L2_K3,
@@ -245,9 +246,6 @@ enum npc_kpu_lf_ltype {
        NPC_LT_LF_TU_3RD_NSH,
 };
 
-/* Don't modify Ltypes upto SCTP, otherwise it will
- * effect flow tag calculation and thus RSS.
- */
 enum npc_kpu_lg_ltype {
        NPC_LT_LG_TU_IP = 1,
        NPC_LT_LG_TU_IP6,
@@ -255,6 +253,9 @@ enum npc_kpu_lg_ltype {
        NPC_LT_LG_TU_ETHER_IN_NSH,
 };
 
+/* Don't modify Ltypes upto SCTP, otherwise it will
+ * effect flow tag calculation and thus RSS.
+ */
 enum npc_kpu_lh_ltype {
        NPC_LT_LH_TU_TCP = 1,
        NPC_LT_LH_TU_UDP,
drivers/net/octeontx2/otx2_lookup.c +1 -2
index 99199d08a..6cdca9b33 100644
@@ -272,13 +272,13 @@ 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;
                                val |= PKT_RX_L4_CKSUM_BAD;
                        } else if (errcode == NIX_RX_PERRCODE_IL4_CHK) {
                                val |= PKT_RX_L4_CKSUM_BAD;
                        } else {
-                               val |= PKT_RX_IP_CKSUM_GOOD;
                                val |= PKT_RX_L4_CKSUM_GOOD;
                        }
                        break;
--

2.17.2