netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, sgoutham@marvell.com
Subject: Re: [net PATCH] octeontx2-af: Fix devlink unregister
Date: Sun, 29 Jan 2023 14:41:18 +0200	[thread overview]
Message-ID: <Y9ZpbqKmt7uNZVmF@unreal> (raw)
In-Reply-To: <20230127094652.666693-1-rkannoth@marvell.com>

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@marvell.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@nvidia.com>

      parent reply	other threads:[~2023-01-29 12:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27  9:46 [net PATCH] octeontx2-af: Fix devlink unregister Ratheesh Kannoth
2023-01-27  9:46 ` [net PATCH] octeontx2-af: Removed unnecessary debug messages Ratheesh Kannoth
2023-01-29 12:36   ` Leon Romanovsky
2023-01-29 12:41 ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9ZpbqKmt7uNZVmF@unreal \
    --to=leon@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).