lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4380faf1-9911-4188-9982-a7060e143394@lunn.ch>
Date: Sat, 30 Mar 2024 15:55:42 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Naveen Mamindlapalli <naveenm@...vell.com>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>,
	"David S. Miller" <davem@...emloft.net>,
	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>,
	Arun Ramadoss <arun.ramadoss@...rochip.com>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
	David Ahern <dsahern@...nel.org>, Simon Horman <horms@...nel.org>,
	Willem de Bruijn <willemb@...gle.com>,
	Søren Andersen <san@...v.dk>
Subject: Re: [PATCH net-next v1 5/9] net: dsa: microchip: add support for
 different DCB app configurations

On Fri, Mar 29, 2024 at 09:29:32AM +0000, Naveen Mamindlapalli wrote:
> 
> > +int ksz_init_global_dscp_map(struct ksz_device *dev) {
> > +	int reg, per_reg, ret, dscp;
> > +	u8 data = 0;
> > +	u8 mask;
> > +
> > +	/* On KSZ9xxx variants, DSCP remapping is disabled by default.
> > +	 * Enable to have, predictable and reproducible behavior across
> > +	 * different devices.
> > +	 */
> > +	if (!is_ksz8(dev)) {
> > +		ret = ksz_rmw8(dev, KSZ9477_REG_SW_MAC_TOS_CTRL,
> > +			       KSZ9477_SW_TOS_DSCP_REMAP,
> > +			       KSZ9477_SW_TOS_DSCP_REMAP);
> > +		if (ret)
> > +			return ret;
> > +	}
> > +
> > +	ksz_get_dscp_prio_reg(dev, &reg, &per_reg, &mask);
> > +
> > +	for (dscp = 0; dscp < DSCP_MAX; dscp++) {
> > +		int ipv, shift;
> > +
> > +		/* Map DSCP to Traffic Type, which is corresponding to the
> > +		 * Internal Priority Value (IPV) in the switch.
> > +		 */
> > +		if (!is_ksz8(dev)) {
> > +			ipv = ietf_dscp_to_ieee8021q_tt(dscp);
> > +		} else {
> > +			ipv =
> > ieee8021q_tt_to_tc(ietf_dscp_to_ieee8021q_tt(dscp),
> > +						 dev->info->num_tx_queues);
> > +		}
> 
> No need for braces for single statement.

Please trim the email when replying. It is very easy to miss comments
when it is 99% quoted text with a couple of one-liners mixed in.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ