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

From: Ratheesh Kannoth
Date: Wed Apr 03 2024 - 06:35:46 EST


On 2024-04-03 at 14:58:58, Oleksij Rempel (o.rempel@xxxxxxxxxxxxxx) 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 <o.rempel@xxxxxxxxxxxxxx>
> Acked-by: Arun Ramadoss <arun.ramadoss@xxxxxxxxxxxxx>
> ---
>
> 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
>