[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aAovTY6Q-4S__0Mh@shell.armlinux.org.uk>
Date: Thu, 24 Apr 2025 13:32:13 +0100
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Boon Khai Ng <boon.khai.ng@...era.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Jesper Dangaard Brouer <hawk@...nel.org>,
John Fastabend <john.fastabend@...il.com>,
Furong Xu <0x1207@...il.com>,
Matthew Gerlach <matthew.gerlach@...era.com>,
Tien Sung Ang <tien.sung.ang@...era.com>,
Mun Yew Tham <mun.yew.tham@...era.com>,
G Thomas Rohan <rohan.g.thomas@...era.com>
Subject: Re: [PATCH net-next v4 1/2] net: stmmac: Refactor VLAN implementation
On Thu, Apr 24, 2025 at 02:04:04PM +0200, Paolo Abeni wrote:
> On 4/21/25 6:29 PM, Boon Khai Ng wrote:
> > Refactor VLAN implementation by moving common code for DWMAC4 and
> > DWXGMAC IPs into a separate VLAN module. VLAN implementation for
> > DWMAC4 and DWXGMAC differs only for CSR base address, the descriptor
> > for the VLAN ID and VLAN VALID bit field.
> >
> > The descriptor format for VLAN is not moved to the common code due
> > to hardware-specific differences between DWMAC4 and DWXGMAC.
> >
> > For the DWMAC4 IP, the Receive Normal Descriptor 0 (RDES0) is
> > formatted as follows:
> > 31 0
> > ------------------------ -----------------------
> > RDES0| Inner VLAN TAG [31:16] | Outer VLAN TAG [15:0] |
> > ------------------------ -----------------------
> >
> > For the DWXGMAC IP, the RDES0 format varies based on the
> > Tunneled Frame bit (TNP):
> >
> > a) For Non-Tunneled Frame (TNP=0)
> >
> > 31 0
> > ------------------------ -----------------------
> > RDES0| Inner VLAN TAG [31:16] | Outer VLAN TAG [15:0] |
> > ------------------------ -----------------------
> >
> > b) For Tunneled Frame (TNP=1)
> >
> > 31 8 7 3 2 0
> > --------------------- ------------------ -------
> > RDES0| VNID/VSID | Reserved | OL2L3 |
> > --------------------- ------------------ ------
> >
> > The logic for handling tunneled frames is not yet implemented
> > in the dwxgmac2_wrback_get_rx_vlan_tci() function. Therefore,
> > it is prudent to maintain separate functions within their
> > respective descriptor driver files
> > (dwxgmac2_descs.c and dwmac4_descs.c).
> >
> > Signed-off-by: Boon Khai Ng <boon.khai.ng@...era.com>
> > Reviewed-by: Matthew Gerlach <matthew.gerlach@...era.com>
>
> This patch does IMHO too many things together, and should be split in
> several ones, i.e.:
> - just moving the code in a separate file
> - rename functions and simbols.
> - other random changes...
>
> > - ret = readl_poll_timeout(ioaddr + GMAC_VLAN_TAG, val,
> > - !(val & GMAC_VLAN_TAG_CTRL_OB),
> > - 1000, 500000);
> > - if (ret) {
> > - netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n");
> > - return -EBUSY;
> > - }
>
> > + for (i = 0; i < timeout; i++) {
> > + val = readl(ioaddr + VLAN_TAG);
> > + if (!(val & VLAN_TAG_CTRL_OB))
> > + return 0;
> > + udelay(1);
> > + }
> > +
> > + netdev_err(dev, "Timeout accessing MAC_VLAN_Tag_Filter\n");
> > +
> > + return -EBUSY;
>
> ... like the above on (which looks unnecessary?!?)
Also looks like a backward step, because we ask people to use the helper
macros where possible.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists