Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, UNGLinuxDriver@microchip.com
Subject: Re: [PATCH net] net: lan966x: Fix port police support using tc-matchall
Date: Wed, 1 Mar 2023 14:27:11 +0200	[thread overview]
Message-ID: <20230301122711.2eqlbjplitrpktdj@skbuf> (raw)
In-Reply-To: <20230228204742.2599151-1-horatiu.vultur@microchip.com>

On Tue, Feb 28, 2023 at 09:47:42PM +0100, Horatiu Vultur wrote:
> When the police was removed from the port, then it was trying to
> remove the police from the police id and not from the actual
> police index.
> The police id represents the id of the police and police index
> represents the position in HW where the police is situated.
> The port police id can be any number while the port police index
> is a number based on the port chip port.
> Fix this by deleting the police from HW that is situated at the
> police index and not police id.
> 
> Fixes: 5390334b59a3 ("net: lan966x: Add port police support using tc-matchall")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_police.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_police.c b/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
> index a9aec900d608d..7d66fe75cd3bf 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_police.c
> @@ -194,7 +194,7 @@ int lan966x_police_port_del(struct lan966x_port *port,
>  		return -EINVAL;
>  	}
>  
> -	err = lan966x_police_del(port, port->tc.police_id);
> +	err = lan966x_police_del(port, POL_IDX_PORT + port->chip_port);
>  	if (err) {
>  		NL_SET_ERR_MSG_MOD(extack,
>  				   "Failed to add policer to port");
> -- 
> 2.38.0
> 

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

but the extack message is also wrong; it says it failed to add the
policer, when the operation that failed was a deletion.

  parent reply	other threads:[~2023-03-01 12:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-28 20:47 [PATCH net] net: lan966x: Fix port police support using tc-matchall Horatiu Vultur
2023-03-01 10:34 ` Simon Horman
2023-03-01 12:27 ` Vladimir Oltean [this message]
2023-03-01 19:49   ` Horatiu Vultur
2023-03-01 17:30 ` patchwork-bot+netdevbpf

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=20230301122711.2eqlbjplitrpktdj@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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