mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Arun.Ramadoss@microchip.com>
To: <andrew@lunn.ch>, <olteanv@gmail.com>, <davem@davemloft.net>,
	<Woojung.Huh@microchip.com>, <pabeni@redhat.com>,
	<o.rempel@pengutronix.de>, <edumazet@google.com>,
	<f.fainelli@gmail.com>, <kuba@kernel.org>
Cc: <kernel@pengutronix.de>, <dsahern@kernel.org>, <san@skov.dk>,
	<willemb@google.com>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <horms@kernel.org>,
	<UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH net-next v4 6/9] net: dsa: microchip: dcb: add special handling for KSZ88X3 family
Date: Mon, 8 Apr 2024 16:26:34 +0000	[thread overview]
Message-ID: <7f0684fb1729dafc92f8b81ce81f10c91385c0c2.camel@microchip.com> (raw)
In-Reply-To: <20240408074758.1825674-7-o.rempel@pengutronix.de>

Hi Oleksij,

> 
> diff --git a/drivers/net/dsa/microchip/ksz_dcb.c
> b/drivers/net/dsa/microchip/ksz_dcb.c
> index 46491c6dd6f60..2c28c4ed288a9 100644
> --- a/drivers/net/dsa/microchip/ksz_dcb.c
> +++ b/drivers/net/dsa/microchip/ksz_dcb.c
> @@ -83,6 +83,10 @@ static const u8 ksz_supported_apptrust[] = {
>         IEEE_8021QAZ_APP_SEL_DSCP,
>  };
> 
> +static const u8 ksz8_port2_supported_apptrust[] = {
> +       DCB_APP_SEL_PCP,
> +};
> +
>  static const char * const ksz_supported_apptrust_variants[] = {
>         "empty", "dscp", "pcp", "dscp pcp"
>  };
> @@ -128,6 +132,48 @@ int ksz_port_get_default_prio(struct dsa_switch
> *ds, int port)
>         return (data & mask) >> shift;
>  }
> 
> 
> 
> +/**
> + * ksz88x3_port0_apptrust_quirk - Quirk for apptrust configuration
> on Port 1
> + *                               (port == 0) of KSZ88x3 devices
> + * @dev: Pointer to the KSZ switch device structure
> + * @port: Port number for which to set the apptrust selectors
> + * @reg: Register address for the apptrust configuration
> + * @data: Data to set for the apptrust configuration
> + *
> + * This function implements a quirk for apptrust configuration on
> Port 1 of
> + * KSZ88x3 devices. It ensures that apptrust configuration on Port 1
> is not
> + * possible if PCP apptrust on Port 2 is disabled. This is because
> the Port 2
> + * seems to be permanently hardwired to PCP classification, so we
> need to
> + * do Port 1 configuration always in agreement with Port 2
> configuration.
> + *
> + * Return: 0 on success, or a negative error code on failure
> + */
> +static int ksz88x3_port0_apptrust_quirk(struct ksz_device *dev, int
> port,
> +                                       int reg, u8 data)
> +{
> +       u8 port1_data;

why can't we have some common reference, because it is somewhat
confusing. function name is port0, but apptrust config is for port1 and
u8 port1_data. atleast instead of port1_data, port0_data, we can have
variable name as data, since they are handled in two different
functions. 

> +       int ret;
> +
> +       if (!(data & (KSZ8_PORT_802_1P_ENABLE |
> KSZ8_PORT_DIFFSERV_ENABLE)))
> +               return 0;
> +
> +       ret = ksz_pread8(dev, 1, reg, &port1_data);

Having macros for magic number for port 1 and 0 will be good. 
> --
> 2.39.2
> 

  reply	other threads:[~2024-04-08 16:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  7:47 [PATCH net-next v4 0/9] Enhanced DCB and DSCP Support for KSZ Switches Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 1/9] net: dsa: add support for DCB get/set apptrust configuration Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 2/9] net: dsa: microchip: add IPV information support Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 3/9] net: add IEEE 802.1q specific helpers Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 4/9] net: dsa: microchip: add multi queue support for KSZ88X3 variants Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 5/9] net: dsa: microchip: add support for different DCB app configurations Oleksij Rempel
2024-04-08 16:10   ` Arun.Ramadoss
2024-04-09  4:31     ` Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 6/9] net: dsa: microchip: dcb: add special handling for KSZ88X3 family Oleksij Rempel
2024-04-08 16:26   ` Arun.Ramadoss [this message]
2024-04-09  8:02     ` Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 7/9] net: dsa: microchip: enable ETS support for KSZ989X variants Oleksij Rempel
2024-04-08  7:47 ` [PATCH net-next v4 8/9] net: dsa: microchip: init predictable IPV to queue mapping for all non KSZ8xxx variants Oleksij Rempel
2024-04-08 15:54   ` Arun.Ramadoss
2024-04-08  7:47 ` [PATCH net-next v4 9/9] net: dsa: microchip: let DCB code do PCP and DSCP policy configuration Oleksij Rempel
2024-04-08 15:55   ` Arun.Ramadoss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f0684fb1729dafc92f8b81ce81f10c91385c0c2.camel@microchip.com \
    --to=arun.ramadoss@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=horms@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=san@skov.dk \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®