Skip to contentSkip to conversation

octeontx2-af: Consider the action set by PF

PATCH Applied Subbaraya Sundeep 3 participants 3 messages Feb 19, 2024 – Feb 21, 2024

Subsystems (3)
lore
Share & tools
lore

Subbaraya Sundeep

author maintainer
#0 lore raw

PATCH 1/1 octeontx2-af: Consider the action set by PF

AF reserves MCAM entries for each PF, VF present in the system and populates the entry with DMAC and action with default RSS so that basic packet I/O works. Since PF/VF is not aware of the RSS action installed by AF, AF only fixup the actions of the rules installed by PF/VF with corresponding default RSS action. This worked well for rules installed by PF/VF for features like RX VLAN offload and DMAC filters but rules involving action like drop/forward to queue are also getting modified by AF. Hence fix it by setting the default RSS action only if requested by PF/VF.

Fixes 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +4 -0
index e5d6156..516adb5 100644
@@ -415,6 +415,10 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam,
 			return;
 	}
 
+	/* AF modifies given action iff PF/VF has requested for it */
+	if ((entry->action & 0xFULL) != NIX_RX_ACTION_DEFAULT)
+		return;
+
 	/* copy VF default entry action to the VF mcam entry */
 	rx_action = npc_get_default_entry_action(rvu, mcam, blkaddr,
 						 target_func);
Signature · 1 line
2.7.4
#1 lore raw
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 11 lines · On Mon, 19 Feb 2024 18:25:14 +0530 you wrote:

AF reserves MCAM entries for each PF, VF present in the system and populates the entry with DMAC and action with default RSS so that basic packet I/O works. Since PF/VF is not aware of the RSS action installed by AF, AF only fixup the actions of the rules installed by PF/VF with corresponding default RSS action. This worked well for rules installed by PF/VF for features like RX VLAN offload and DMAC filters but rules involving action like drop/forward to queue are also getting modified by AF. Hence fix it by setting the default RSS action only if requested by PF/VF.

Quoted 1 line

[...]

Here is the summary with links:
- [net] octeontx2-af: Consider the action set by PF

    https://git.kernel.org/netdev/net/c/3b1ae9b71c2a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#2 lore raw
In reply to Subbaraya Sundeep
Quoted 22 lines · Subbaraya Sundeep

AF reserves MCAM entries for each PF, VF present in the system and populates the entry with DMAC and action with default RSS so that basic packet I/O works. Since PF/VF is not aware of the RSS action installed by AF, AF only fixup the actions of the rules installed by PF/VF with corresponding default RSS action. This worked well for rules installed by PF/VF for features like RX VLAN offload and DMAC filters but rules involving action like drop/forward to queue are also getting modified by AF. Hence fix it by setting the default RSS action only if requested by PF/VF.

Fixes 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
---
  drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 4 ++++
  1 file changed, 4 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +0 -0
index e5d6156..516adb5 100644

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam, · line 419

Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +2 -0
@@ -415,6 +415,10 @@ static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam,
  			return;
  	}
 
+	/* AF modifies given action iff PF/VF has requested for it */
+	if ((entry->action & 0xFULL) != NIX_RX_ACTION_DEFAULT)

this is a magic constant, even if nice sounding one
and it's equal to NIX_RX_ACTION_DEFAULT BTW, but it's incidental (perhaps you should have two defines, one for mask, and one for action)

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c static void npc_fixup_vf_rule(struct rvu *rvu, struct npc_mcam *mcam, · line 424

Quoted 5 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +2 -0
+		return;
+
  	/* copy VF default entry action to the VF mcam entry */
  	rx_action = npc_get_default_entry_action(rvu, mcam, blkaddr,
  						 target_func);

Otherwise the patch makes sense