public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>
Subject: Re: [PATCH net-next v2 2/3] net: lan966x: Add PGID_FIRST and PGID_LAST
Date: Tue, 4 Jan 2022 11:21:20 +0000	[thread overview]
Message-ID: <20220104112120.6tfdrzikkn6nbhkn@skbuf> (raw)
In-Reply-To: <20220104101849.229195-3-horatiu.vultur@microchip.com>

On Tue, Jan 04, 2022 at 11:18:48AM +0100, Horatiu Vultur wrote:
> The first entries in the PGID table are used by the front ports while
> the last entries are used for different purposes like flooding mask,
> copy to CPU, etc. So add these macros to define which entries can be
> used for general purpose.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---

Not too thrilled by the "first" and "last" names, since there are PGIDs
before the "first" PGID, and after the "last" PGID, too. I can see how
others may get confused about this. In the ocelot driver they are called
"nonreserved" PGIDs. It also doesn't help that PGID_FIRST and PGID_LAST
are defined under the "Reserved PGIDs" comment, because they aren't reserved.

>  drivers/net/ethernet/microchip/lan966x/lan966x_main.h | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> index f70e54526f53..190d62ced3fd 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.h
> @@ -30,7 +30,11 @@
>  /* Reserved amount for (SRC, PRIO) at index 8*SRC + PRIO */
>  #define QSYS_Q_RSRV			95
>  
> +#define CPU_PORT			8
> +
>  /* Reserved PGIDs */
> +#define PGID_FIRST			(CPU_PORT + 1)
> +#define PGID_LAST			PGID_CPU

Since PGID_LAST is defined in terms of PGID_CPU, I would put it _below_
PGID_CPU.

>  #define PGID_CPU			(PGID_AGGR - 6)
>  #define PGID_UC				(PGID_AGGR - 5)
>  #define PGID_BC				(PGID_AGGR - 4)
> @@ -44,8 +48,6 @@
>  #define LAN966X_SPEED_100		2
>  #define LAN966X_SPEED_10		3
>  
> -#define CPU_PORT			8
> -
>  /* MAC table entry types.
>   * ENTRYTYPE_NORMAL is subject to aging.
>   * ENTRYTYPE_LOCKED is not subject to aging.
> -- 
> 2.33.0
>

  reply	other threads:[~2022-01-04 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 10:18 [PATCH net-next v2 0/3] net: lan966x: Extend switchdev with mdb support Horatiu Vultur
2022-01-04 10:18 ` [PATCH net-next v2 1/3] net: lan966x: Add function lan966x_mac_ip_learn() Horatiu Vultur
2022-01-04 11:17   ` Vladimir Oltean
2022-01-04 13:40     ` Horatiu Vultur
2022-01-04 10:18 ` [PATCH net-next v2 2/3] net: lan966x: Add PGID_FIRST and PGID_LAST Horatiu Vultur
2022-01-04 11:21   ` Vladimir Oltean [this message]
2022-01-04 13:46     ` Horatiu Vultur
2022-01-04 10:18 ` [PATCH net-next v2 3/3] net: lan966x: Extend switchdev with mdb support Horatiu Vultur
2022-01-04 11:12   ` Vladimir Oltean
2022-01-04 13:36     ` Horatiu Vultur

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=20220104112120.6tfdrzikkn6nbhkn@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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