From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B858C433F5 for ; Mon, 14 Feb 2022 20:52:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229834AbiBNUwv convert rfc822-to-8bit (ORCPT ); Mon, 14 Feb 2022 15:52:51 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiBNUws (ORCPT ); Mon, 14 Feb 2022 15:52:48 -0500 Received: from unicorn.mansr.com (unicorn.mansr.com [IPv6:2001:8b0:ca0d:8d8e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCDEB13DEF for ; Mon, 14 Feb 2022 12:52:29 -0800 (PST) Received: from raven.mansr.com (raven.mansr.com [IPv6:2001:8b0:ca0d:8d8e::3]) by unicorn.mansr.com (Postfix) with ESMTPS id 7791515360; Mon, 14 Feb 2022 19:17:33 +0000 (GMT) Received: by raven.mansr.com (Postfix, from userid 51770) id 69EB8219C0A; Mon, 14 Feb 2022 19:17:33 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Vladimir Oltean Cc: Florian Fainelli , netdev@vger.kernel.org, Egil Hjelmeland , Andrew Lunn , Juergen Borleis , Grygorii Strashko , lorenzo@kernel.org Subject: Re: DSA using cpsw and lan9303 References: <20220214174349.6t3y7mwhqxaem3e7@skbuf> Date: Mon, 14 Feb 2022 19:17:33 +0000 In-Reply-To: <20220214174349.6t3y7mwhqxaem3e7@skbuf> (Vladimir Oltean's message of "Mon, 14 Feb 2022 19:43:49 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Vladimir Oltean writes: > 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. Thanks, that looks promising. >> > Please don't make me send an actual patch. > > So what is your plan otherwise? :) I meant I didn't want to send a patch I know to be broken only to provoke a discussion. -- Måns Rullgård