Skip to content

Commit 1e4428b

Browse files
sgoutham-marvelldavem330
authored andcommitted
octeontx2-af: Set proper errorcode for IPv4 checksum errors
With current config, for packets with IPv4 checksum errors, errorcode is being set to UNKNOWN. Hence added a separate errorcodes for outer and inner IPv4 checksum and changed NPC configuration accordingly. Also turn on L2 multicast address check in NPC protocol check block. Fixes: 6b3321b ("octeontx2-af: Enable packet length and csum validation") Signed-off-by: Sunil Goutham <[email protected]> Signed-off-by: Subbaraya Sundeep <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 698a82e commit 1e4428b

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/ethernet/marvell/octeontx2/af

1 file changed

+4
-3
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,14 +2020,15 @@ int rvu_npc_init(struct rvu *rvu)
20202020

20212021
/* Enable below for Rx pkts.
20222022
* - Outer IPv4 header checksum validation.
2023-
* - Detect outer L2 broadcast address and set NPC_RESULT_S[L2M].
2023+
* - Detect outer L2 broadcast address and set NPC_RESULT_S[L2B].
2024+
* - Detect outer L2 multicast address and set NPC_RESULT_S[L2M].
20242025
* - Inner IPv4 header checksum validation.
20252026
* - Set non zero checksum error code value
20262027
*/
20272028
rvu_write64(rvu, blkaddr, NPC_AF_PCK_CFG,
20282029
rvu_read64(rvu, blkaddr, NPC_AF_PCK_CFG) |
2029-
BIT_ULL(32) | BIT_ULL(24) | BIT_ULL(6) |
2030-
BIT_ULL(2) | BIT_ULL(1));
2030+
((u64)NPC_EC_OIP4_CSUM << 32) | (NPC_EC_IIP4_CSUM << 24) |
2031+
BIT_ULL(7) | BIT_ULL(6) | BIT_ULL(2) | BIT_ULL(1));
20312032

20322033
rvu_npc_setup_interfaces(rvu, blkaddr);
20332034

0 commit comments

Comments
 (0)