[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230308071649.GD1692@pengutronix.de>
Date: Wed, 8 Mar 2023 08:16:49 +0100
From: Oleksij Rempel <o.rempel@...gutronix.de>
To: "David S. Miller" <davem@...emloft.net>,
Andrew Lunn <andrew@...n.ch>,
Eric Dumazet <edumazet@...gle.com>,
Florian Fainelli <f.fainelli@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Vladimir Oltean <olteanv@...il.com>,
Woojung Huh <woojung.huh@...rochip.com>
Cc: kernel@...gutronix.de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com
Subject: Re: [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 |
Powered by blists - more mailing lists