Re: [PATCH net-next] net: ethernet: ti: am65-cpsw: Add priv-flag for Switch VLAN Aware mode

From: Sverdlin, Alexander
Date: Thu Jun 13 2024 - 09:16:28 EST


Hello Siddharth,

On Thu, 2024-02-29 at 16:37 +0530, Siddharth Vadapalli wrote:
> > > The current implementation is:
> > >
> > >   /* Control register */
> > >   writel(AM65_CPSW_CTL_P0_ENABLE | AM65_CPSW_CTL_P0_TX_CRC_REMOVE |
> > >          AM65_CPSW_CTL_VLAN_AWARE | AM65_CPSW_CTL_P0_RX_PAD,
> > >          common->cpsw_base + AM65_CPSW_REG_CTL);
> > >
> > > which sets the "AM65_CPSW_CTL_VLAN_AWARE" bit by default.

...

> functionality. CPSW_VLAN_AWARE corresponding to the
> AM65_CPSW_CTL_VLAN_AWARE bit enables further packet processing:
> VLAN tag addition/removal/replacement
> which is a layer on top of the Software generated packets Egressing out
> of the Ethernet Switch ports, or Forwarded packets Egressing out of the
> Ethernet Switch ports. If the aforementioned modification is handled in
> Software for example and we don't want packets from Software or on the
> Forwarding path to be modified, then turning off the CPSW_VLAN_AWARE
> mode is necessary.

I think the question many had in mind and which is I believe still
remains unclear, what exactly AM65_CPSW_CTL_VLAN_AWARE asserted by
default is currently used for?

Is it NETIF_F_HW_VLAN_CTAG_FILTER or in other words

static const struct net_device_ops am65_cpsw_nuss_netdev_ops = {
...
.ndo_vlan_rx_add_vid = am65_cpsw_nuss_ndo_slave_add_vid,
.ndo_vlan_rx_kill_vid = am65_cpsw_nuss_ndo_slave_kill_vid,
?

--
Alexander Sverdlin
Siemens AG
www.siemens.com