[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220214174349.6t3y7mwhqxaem3e7@skbuf>
Date: Mon, 14 Feb 2022 19:43:49 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: Måns Rullgård <mans@...sr.com>,
netdev@...r.kernel.org,
Egil Hjelmeland <privat@...l-hjelmeland.no>,
Andrew Lunn <andrew@...n.ch>,
Juergen Borleis <jbe@...gutronix.de>,
Grygorii Strashko <grygorii.strashko@...com>,
lorenzo@...nel.org
Subject: Re: DSA using cpsw and lan9303
Hi Måns,
On Mon, Feb 14, 2022 at 09:16:10AM -0800, Florian Fainelli wrote:
> +others,
>
> netdev is a high volume list, you should probably copy directly the
> people involved with the code you are working with.
Thanks, Florian.
> > Secondly, the cpsw driver strips VLAN tags from incoming frames, and
> > this prevents the DSA parsing from working. As a dirty workaround, I
> > did this:
> >
> > diff --git a/drivers/net/ethernet/ti/cpsw_priv.c b/drivers/net/ethernet/ti/cpsw_priv.c
> > index 424e644724e4..e15f42ece8bf 100644
> > --- a/drivers/net/ethernet/ti/cpsw_priv.c
> > +++ b/drivers/net/ethernet/ti/cpsw_priv.c
> > @@ -235,6 +235,7 @@ void cpsw_rx_vlan_encap(struct sk_buff *skb)
> >
> > /* Remove VLAN header encapsulation word */
> > skb_pull(skb, CPSW_RX_VLAN_ENCAP_HDR_SIZE);
> > + return;
> >
> > pkt_type = (rx_vlan_encap_hdr >>
> > CPSW_RX_VLAN_ENCAP_HDR_PKT_TYPE_SHIFT) &
> >
> > With these changes, everything seems to work as expected.
> >
> > Now I'd appreciate if someone could tell me how I should have done this.
Assuming cpsw_rx_vlan_encap() doesn't just eat the VLAN, but puts it in
the skb hwaccel area. The tag_lan9303.c tagger must deal with both
variants of VLANs.
For example, dsa_8021q_rcv() has:
skb_push_rcsum(skb, ETH_HLEN);
if (skb_vlan_tag_present(skb)) {
tci = skb_vlan_tag_get(skb);
__vlan_hwaccel_clear_tag(skb);
} else {
__skb_vlan_pop(skb, &tci);
}
skb_pull_rcsum(skb, ETH_HLEN);
vid = tci & VLAN_VID_MASK;
(process @vid here)
which should give you a head start.
> > Please don't make me send an actual patch.
So what is your plan otherwise? :)
Powered by blists - more mailing lists