diff mbox series

[net-next,v3] net: lan966x: Use automatic selection of VCAP rule actionset

Message ID 20230217132831.2508465-1-horatiu.vultur@microchip.com (mailing list archive)
State Accepted
Commit 4d3e050b548878a14edfa2aeaca5d583b8b980ef
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v3] net: lan966x: Use automatic selection of VCAP rule actionset | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Horatiu Vultur Feb. 17, 2023, 1:28 p.m. UTC
Since commit 81e164c4aec5 ("net: microchip: sparx5: Add automatic
selection of VCAP rule actionset") the VCAP API has the capability to
select automatically the actionset based on the actions that are attached
to the rule. So it is not needed anymore to hardcode the actionset in the
driver, therefore it is OK to remove this.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
v2->v3:
- fix typo hardcore -> hardcode
- remove vcap_set_rule_set_actionset also for PTP rules
v1->v2:
- improve the commit message by mentioning the commit which allows
  to make this change
---
 drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c       | 3 +--
 drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 2 --
 2 files changed, 1 insertion(+), 4 deletions(-)

Comments

Alexander Lobakin Feb. 17, 2023, 3:06 p.m. UTC | #1
From: Horatiu Vultur <horatiu.vultur@microchip.com>
Date: Fri, 17 Feb 2023 14:28:31 +0100

> Since commit 81e164c4aec5 ("net: microchip: sparx5: Add automatic
> selection of VCAP rule actionset") the VCAP API has the capability to
> select automatically the actionset based on the actions that are attached
> to the rule. So it is not needed anymore to hardcode the actionset in the
> driver, therefore it is OK to remove this.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> v2->v3:
> - fix typo hardcore -> hardcode

:D

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>

> - remove vcap_set_rule_set_actionset also for PTP rules
> v1->v2:
> - improve the commit message by mentioning the commit which allows
>   to make this change
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c       | 3 +--
>  drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 2 --
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> index a8348437dd87f..ded9ab79ccc21 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
> @@ -83,8 +83,7 @@ static int lan966x_ptp_add_trap(struct lan966x_port *port,
>  	if (err)
>  		goto free_rule;
>  
> -	err = vcap_set_rule_set_actionset(vrule, VCAP_AFS_BASE_TYPE);
> -	err |= vcap_rule_add_action_bit(vrule, VCAP_AF_CPU_COPY_ENA, VCAP_BIT_1);
> +	err = vcap_rule_add_action_bit(vrule, VCAP_AF_CPU_COPY_ENA, VCAP_BIT_1);
>  	err |= vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE, LAN966X_PMM_REPLACE);
>  	err |= vcap_val_rule(vrule, proto);
>  	if (err)
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
> index bd10a71897418..f960727ecaeec 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
> @@ -261,8 +261,6 @@ static int lan966x_tc_flower_add(struct lan966x_port *port,
>  							0);
>  			err |= vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE,
>  							LAN966X_PMM_REPLACE);
> -			err |= vcap_set_rule_set_actionset(vrule,
> -							   VCAP_AFS_BASE_TYPE);
>  			if (err)
>  				goto out;
>  

Thanks,
Olek
patchwork-bot+netdevbpf@kernel.org Feb. 20, 2023, 11:40 a.m. UTC | #2
Hello:

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

On Fri, 17 Feb 2023 14:28:31 +0100 you wrote:
> Since commit 81e164c4aec5 ("net: microchip: sparx5: Add automatic
> selection of VCAP rule actionset") the VCAP API has the capability to
> select automatically the actionset based on the actions that are attached
> to the rule. So it is not needed anymore to hardcode the actionset in the
> driver, therefore it is OK to remove this.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> 
> [...]

Here is the summary with links:
  - [net-next,v3] net: lan966x: Use automatic selection of VCAP rule actionset
    https://git.kernel.org/netdev/net-next/c/4d3e050b5488

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
index a8348437dd87f..ded9ab79ccc21 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
@@ -83,8 +83,7 @@  static int lan966x_ptp_add_trap(struct lan966x_port *port,
 	if (err)
 		goto free_rule;
 
-	err = vcap_set_rule_set_actionset(vrule, VCAP_AFS_BASE_TYPE);
-	err |= vcap_rule_add_action_bit(vrule, VCAP_AF_CPU_COPY_ENA, VCAP_BIT_1);
+	err = vcap_rule_add_action_bit(vrule, VCAP_AF_CPU_COPY_ENA, VCAP_BIT_1);
 	err |= vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE, LAN966X_PMM_REPLACE);
 	err |= vcap_val_rule(vrule, proto);
 	if (err)
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
index bd10a71897418..f960727ecaeec 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c
@@ -261,8 +261,6 @@  static int lan966x_tc_flower_add(struct lan966x_port *port,
 							0);
 			err |= vcap_rule_add_action_u32(vrule, VCAP_AF_MASK_MODE,
 							LAN966X_PMM_REPLACE);
-			err |= vcap_set_rule_set_actionset(vrule,
-							   VCAP_AFS_BASE_TYPE);
 			if (err)
 				goto out;