Re: [PATCH v2 net-next 1/2] octeontx2-af: Knobs for NPC default rule counters

From: Simon Horman
Date: Sat Sep 14 2024 - 04:13:40 EST


On Thu, Sep 12, 2024 at 09:44:49PM +0530, Linu Cherian wrote:
> Add devlink knobs to enable/disable counters on NPC
> default rule entries.
>
> Introduce lowlevel variant of rvu_mcam_remove/add_counter_from/to_rule
> for better code reuse, which assumes necessary locks are taken at
> higher level.
>
> Sample command to enable default rule counters:
> devlink dev param set <dev> name npc_def_rule_cntr value true cmode runtime
>
> Sample command to read the counter:
> cat /sys/kernel/debug/cn10k/npc/mcam_rules
>
> Signed-off-by: Linu Cherian <lcherian@xxxxxxxxxxx>
> ---
> Changelog from v1:
> Removed wrong mutex_unlock invocations.

Hi Linu,

This patch seems to be doing two things:

1) Refactoring some functions to have locking and non-locking variants.
By LoC this is appears the bulk of the code changed in this patch.
It also appears to be straightforward.

2) Adding devlink knobs

As this is a user-facing change it probably requires a deeper review
than 1)

I would suggest, that for review, it would be very nice to split
1) and 2) into separate patches. Maybe including a note in the patch
for 1) that the refactor will be used in the following patch for 2).

As for the code changes themselves, I did look over them,
and I didn't see any problems.