Skip to content

Commit 1c120fe

Browse files
Hariprasad Kelamgregkh
authored andcommitted
Octeontx2-af: Skip overlap check for SPI field
[ Upstream commit 8c5d959 ] Octeontx2/CN10K silicon supports generating a 256-bit key per packet. The specific fields to be extracted from a packet for key generation are configurable via a Key Extraction (MKEX) Profile. The AF driver scans the configured extraction profile to ensure that fields from upper layers do not overwrite fields from lower layers in the key. Example Packet Field Layout: LA: DMAC + SMAC LB: VLAN LC: IPv4/IPv6 LD: TCP/UDP Valid MKEX Profile Configuration: LA -> DMAC -> key_offset[0-5] LC -> SIP -> key_offset[20-23] LD -> SPORT -> key_offset[30-31] Invalid MKEX profile configuration: LA -> DMAC -> key_offset[0-5] LC -> SIP -> key_offset[20-23] LD -> SPORT -> key_offset[2-3] // Overlaps with DMAC field In another scenario, if the MKEX profile is configured to extract the SPI field from both AH and ESP headers at the same key offset, the driver rejecting this configuration. In a regular traffic, ipsec packet will be having either AH(LD) or ESP (LE). This patch relaxes the check for the same. Fixes: 12aa0a3 ("octeontx2-af: Harden rule validation.") Signed-off-by: Hariprasad Kelam <hkelam@marvell.com> Link: https://patch.msgid.link/20250820063919.1463518-1-hkelam@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0cbf3ed commit 1c120fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ static void npc_set_features(struct rvu *rvu, int blkaddr, u8 intf)
606606
if (!npc_check_field(rvu, blkaddr, NPC_LB, intf))
607607
*features &= ~BIT_ULL(NPC_OUTER_VID);
608608

609-
/* Set SPI flag only if AH/ESP and IPSEC_SPI are in the key */
610-
if (npc_check_field(rvu, blkaddr, NPC_IPSEC_SPI, intf) &&
609+
/* Allow extracting SPI field from AH and ESP headers at same offset */
610+
if (npc_is_field_present(rvu, NPC_IPSEC_SPI, intf) &&
611611
(*features & (BIT_ULL(NPC_IPPROTO_ESP) | BIT_ULL(NPC_IPPROTO_AH))))
612612
*features |= BIT_ULL(NPC_IPSEC_SPI);
613613

0 commit comments

Comments
 (0)