Re: [PATCH net-next v2 2/2] net: dsa: microchip: add ETS Qdisc support for KSZ9477 series

From: Arun.Ramadoss
Date: Thu Mar 09 2023 - 23:22:33 EST


Hi Oleksij,

> +
> +#define KSZ9477_PORT_MRI_TC_MAP__4 0x0808
> +#define KSZ9477_DEFAULT_TC_MAP 0x33221100

KSZ9477 and KSZ8 switches has 4 queues per port whereas LAN937x has 8
queues. So Default TC MAP for LAN937x will be 0x76543210. Instead of
using this values for all the switch, this value must be derived based
on chip info. Can you consider to add this value in chip_info and use
it in funciton ksz_tc_ets_del based on the switch type, So that the
function will be generic.

> +
> +#define KSZ9477_PORT_TC_MAP_S 4
> +#define KSZ9477_MAX_TC_PRIO 7
> +
> /* CBS related registers */
> #define REG_PORT_MTI_QUEUE_INDEX__4 0x0900
>
> @@ -670,6 +679,9 @@ static inline int is_lan937x(struct ksz_device
> *dev)
> #define MTI_SHAPING_SRP 1
> #define MTI_SHAPING_TIME_AWARE 2
>
> +#define KSZ9477_PORT_MTI_QUEUE_CTRL_1 0x0915
> +#define KSZ9477_DEFAULT_WRR_WEIGHT 1
> +
> #define REG_PORT_MTI_HI_WATER_MARK 0x0916
> #define REG_PORT_MTI_LO_WATER_MARK 0x0918
>
> --
> 2.30.2
>