diff mbox series

[net] octeontx2-af: Consider the action set by PF

Message ID 1708347314-21624-1-git-send-email-sbhatta@marvell.com (mailing list archive)
State Accepted
Commit 3b1ae9b71c2a97f848b00fb085a2bd29bddbe8d9
Delegated to: Netdev Maintainers
Headers show
Series [net] octeontx2-af: Consider the action set by PF | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 1 maintainers not CCed: jerinj@marvell.com
netdev/build_clang success Errors and warnings before: 973 this patch: 973
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 973 this patch: 973
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 10 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-21--00-00 (tests: 1452)

Commit Message

Subbaraya Sundeep Feb. 19, 2024, 12:55 p.m. UTC
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")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 21, 2024, 11:20 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

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.
> 
> [...]

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!
Przemek Kitszel Feb. 21, 2024, 11:24 a.m. UTC | #2
On 2/19/24 13:55, Subbaraya Sundeep 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.
> 
> Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet replication feature")
> Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> ---
>   drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> index e5d6156..516adb5 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
> @@ -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)

> +		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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
index e5d6156..516adb5 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c
@@ -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);