Subject: Re: [PATCH net-next v2 2/9] net: dsa: microchip: add IPV information support

From: Ratheesh Kannoth <[email-masked]>
Date: Wed, 3 Apr 2024 16:04:59 +0530

On 2024-04-03 at 14:58:58, Oleksij Rempel ([email-masked]) wrote:
> Most of Microchip KSZ switches use Internal Priority Value associated
> with every frame. For example, it is possible to map any VLAN PCP or
> DSCP value to IPV and at the end, map IPV to a queue.
>
> Since amount of IPVs is not equal to amount of queues, add this
> information and make use of it in some functions.
>
> Signed-off-by: Oleksij Rempel <[email-masked]>
> Acked-by: Arun Ramadoss <[email-masked]>
> ---
>
>  	dev->dev_ops->enable_stp_addr(dev);
>
> +	/* Make sure driver provide plausible queue and IPV values */
> +	if (!dev->info->num_tx_queues ||
> +	    dev->info->num_tx_queues > dev->info->max_ipvs) {
> +		dev_err(dev->dev, "Number of TX queues exceeds maximum supported IPVs\n");
if dev->info->num_tx_queues == 0, error message seems to be wrong.

> +		return -EINVAL;
> +	}
>
>  #define KSZ9477_PORT_TC_MAP_S		4
> -#define KSZ9477_MAX_TC_PRIO		7
>
>  /* CBS related registers */
>  #define REG_PORT_MTI_QUEUE_INDEX__4	0x0900
> --
> 2.39.2
>