Re: [PATCH net-next v3 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN stripping
From: Andrew Lunn
Date: Wed Apr 09 2025 - 08:05:19 EST
On Wed, Apr 09, 2025 at 03:12:53AM +0000, Ng, Boon Khai wrote:
> > This appears to be identical to dwmac4_wrback_get_rx_vlan_tci() ?
> >
> > Can it be moved into the shared code, or am i missing something?
> >
> > Andrew
>
> Hi Andrew thanks for the quick response.
>
> For the dwmac4 IP it has the following format at the
> Receive Normal Descriptor 0 (RDES0)
>
> 31 0
> ------------------------------------- -----------------------------------
> RDES0 | Inner VLAN TAG [31:16] | Outer VLAN TAG [31:16 |
> ------------------------------------- -----------------------------------
>
> While for dwxgmac2 IP it has the following format at the RDES0
> Depending on the Tunneled Frame bit (TNP)
>
> For Non-Tunneled Frame (TNP=0)
> 31 0
> ------------------------------------- -----------------------------------
> RDES0 | Inner VLAN TAG [31:16 ] | Outer VLAN TAG [31:16] |
> ------------------------------------- -----------------------------------
>
> For Tunneled Frame (TNP=1)
> 31 8 7 3 2 0
> -------------------------------- ----------------------- ----------------
> RDES0 | VNID/VSID | Reserved | OL2L3 |
> -------------------------------- ----------------------- ----------------
>
> While the logic for handling Tunneled Frame and Non-Tunneled
> Frame is not yet implemented in the
> dwxgmac2_wrback_get_rx_vlan_tci() function, I believe it is
> prudent to maintain separate functions within their respective
> descriptor driver files, (dwxgmac2_descs.c and dwmac4_descs.c)
Please add a comment, or describe this in the commit message.
Andrew