lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y9ZpbqKmt7uNZVmF@unreal>
Date:   Sun, 29 Jan 2023 14:41:18 +0200
From:   Leon Romanovsky <leon@...nel.org>
To:     Ratheesh Kannoth <rkannoth@...vell.com>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, sgoutham@...vell.com
Subject: Re: [net PATCH] octeontx2-af: Fix devlink unregister

On Fri, Jan 27, 2023 at 03:16:51PM +0530, Ratheesh Kannoth wrote:
> Exact match devlink entry is only for CN10K-B.
> Unregistration devlink should subtract this
> entry before invoking devlink unregistration
> 
> Fixes: 87e4ea29b030 ("octeontx2-af: Debugsfs support for exact match.")
> Signed-off-by: Ratheesh Kannoth <rkannoth@...vell.com>
> ---
>  .../net/ethernet/marvell/octeontx2/af/rvu_devlink.c    | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> index bda1a6fa2ec4..d058eeadb23f 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
> @@ -1603,10 +1603,16 @@ void rvu_unregister_dl(struct rvu *rvu)
>  {
>  	struct rvu_devlink *rvu_dl = rvu->rvu_dl;
>  	struct devlink *dl = rvu_dl->dl;
> +	size_t size;
>  
>  	devlink_unregister(dl);
> -	devlink_params_unregister(dl, rvu_af_dl_params,
> -				  ARRAY_SIZE(rvu_af_dl_params));
> +	/* Unregister exact match devlink only for CN10K-B */
> +	size = ARRAY_SIZE(rvu_af_dl_params);
> +	if (!rvu_npc_exact_has_match_table(rvu))
> +		size -= 1;
> +
> +	devlink_params_unregister(dl, rvu_af_dl_params, size);

The code is ok, but it will be much better if you separate
rvu_af_dl_params to two structs and call to devlink_params_register()
twice with relevant parameters.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ