lkml.org 
[lkml]   [2023]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v1 2/2] net: dsa: microchip: add ETS Qdisc support for KSZ9477 series
On Mon, Mar 06, 2023 at 01:49:40PM +0100, Oleksij Rempel wrote:
> +static int ksz_queue_set_strict(struct ksz_device *dev, int port, int queue)
> +{
> + int ret;
> +
> + /* In order to ensure proper prioritization, it is necessary to set the
> + * rate limit for the related queue to zero. Otherwise strict priority
> + * mode will not work.
> + */
> + ret = ksz_pwrite8(dev, port, KSZ9477_REG_PORT_OUT_RATE_0 + queue,
> + KSZ9477_OUT_RATE_NO_LIMIT);

Uff, this part works by accident. KSZ9477_REG_PORT_OUT_RATE_0 registers
should be written in a direct order. According to the documentation
"update will not take effect until the Port Queue 3 Egress Limit
Control Register is written.". But we are writing in a reverse order -
queue 3 is written first.

> + if (ret)
> + return ret;
> +
> + ret = ksz_pwrite32(dev, port, REG_PORT_MTI_QUEUE_INDEX__4, queue);
> + if (ret)
> + return ret;
> +
> + return ksz_setup_tc_mode(dev, port, MTI_SCHEDULE_STRICT_PRIO,
> + MTI_SHAPING_OFF);
> +}
> +
> +static int ksz_queue_set_wrr(struct ksz_device *dev, int port, int queue,
> + int weight)
> +{
> + int ret;
> +
> + /* In order to ensure proper prioritization, it is necessary to set the
> + * rate limit for the related queue to zero. Otherwise weighted round
> + * robin mode will not work.
> + */
> + ret = ksz_pwrite8(dev, port, KSZ9477_REG_PORT_OUT_RATE_0 + queue,
> + KSZ9477_OUT_RATE_NO_LIMIT);

same here.
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

\
 
 \ /
  Last update: 2023-03-27 00:48    [W:0.059 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site