diff mbox series

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

Message ID 20230216122907.2207291-1-horatiu.vultur@microchip.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] 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 7 of 7 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, 8 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. 16, 2023, 12:29 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 hardcore the actionset in the
driver, therefore it is OK to remove this.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
v1->v2:
- improve the commit message by mentioning the commit which allows
  to make this change
---
 drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Larysa Zaremba Feb. 16, 2023, 1:54 p.m. UTC | #1
On Thu, Feb 16, 2023 at 01:29:07PM +0100, Horatiu Vultur 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 hardcore the actionset in the

I am sure, you've meant 'hardcode'

> driver, therefore it is OK to remove this.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> v1->v2:
> - improve the commit message by mentioning the commit which allows
>   to make this change
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> 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);

Is this the only location, where this can be done? I'm not very familiar with 
this driver, would it maybe make sense to check out lan966x_ptp_add_trap() too?

>  			if (err)
>  				goto out;
>  
> -- 
> 2.38.0
>
Horatiu Vultur Feb. 17, 2023, 8:08 a.m. UTC | #2
The 02/16/2023 14:54, Larysa Zaremba wrote:

Hi Larysa,

> 
> On Thu, Feb 16, 2023 at 01:29:07PM +0100, Horatiu Vultur 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 hardcore the actionset in the
> 
> I am sure, you've meant 'hardcode'

Yes, I will change this in the next version.

> 
> > driver, therefore it is OK to remove this.
> >
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> > ---
> > v1->v2:
> > - improve the commit message by mentioning the commit which allows
> >   to make this change
> > ---
> >  drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > 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);
> 
> Is this the only location, where this can be done? I'm not very familiar with
> this driver, would it maybe make sense to check out lan966x_ptp_add_trap() too?

Good catch! Also in lan966x_ptp_add_trap, the function
vcap_set_rule_set_actionset can be removed.

> 
> >                       if (err)
> >                               goto out;
> >
> > --
> > 2.38.0
> >
diff mbox series

Patch

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;