lkml.org 
[lkml]   [2024]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2024-03-30 15:56    [W:0.111 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site