[Enable Designware XGMAC VLAN Stripping Feature v2 1/1] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping

Ng, Boon Khai boon.khai.ng at intel.com
Mon May 27 19:29:43 PDT 2024


> -----Original Message-----
> From: Andrew Lunn <andrew at lunn.ch>
> Sent: Tuesday, May 28, 2024 3:00 AM
> To: Ng, Boon Khai <boon.khai.ng at intel.com>
> Cc: Alexandre Torgue <alexandre.torgue at foss.st.com>; Jose Abreu
> <joabreu at synopsys.com>; David S . Miller <davem at davemloft.net>; Eric
> Dumazet <edumazet at google.com>; Jakub Kicinski <kuba at kernel.org>; Paolo
> Abeni <pabeni at redhat.com>; Maxime Coquelin
> <mcoquelin.stm32 at gmail.com>; netdev at vger.kernel.org; linux-stm32 at st-
> md-mailman.stormreply.com; linux-arm-kernel at lists.infradead.org; linux-
> kernel at vger.kernel.org; Ang, Tien Sung <tien.sung.ang at intel.com>; G
> Thomas, Rohan <rohan.g.thomas at intel.com>; Looi, Hong Aun
> <hong.aun.looi at intel.com>; Andy Shevchenko
> <andriy.shevchenko at linux.intel.com>; Ilpo Jarvinen
> <ilpo.jarvinen at linux.intel.com>
> Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature v2 1/1] net:
> stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping
> 
> > This implementation was ported from the dwmac4 driver.
> 
> How does it differ from dwmac4? Can the dwmac4 implementation just be
> used, rather than duplicating all the code/bugs.

Hi Andrew, 5 years ago the driver was initially implemented separately, maybe need David S. Miller help to clarify this.
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

If you take a look at the code, the register mapping looks different at their TX MAC Configuration register and RX MAC Configuration register.
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/stmicro/stmmac/dwmac4.h

So, for this XGMAC VLAN patch, the idea of getting the VLAN id from the descriptor is the same, but 
The register bit filed of getting the VLAN packet VALID is different. Thus, it need to be implemented separately. 

> 
> 	Andrew



More information about the linux-arm-kernel mailing list