Message ID | 20221107185452.90711-8-nbd@nbd.name |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2234289wru; Mon, 7 Nov 2022 11:02:40 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Llu7GhsNlgpytaxpVPfgk29this4h9/180ds4cAamOHNNQZ2P3CZXTPVtUYY8JQj+LI+J X-Received: by 2002:a17:902:74c3:b0:182:57fa:b9c4 with SMTP id f3-20020a17090274c300b0018257fab9c4mr52297768plt.104.1667847760099; Mon, 07 Nov 2022 11:02:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667847760; cv=none; d=google.com; s=arc-20160816; b=nRmv6+bLwu1OmeVLV3ZaY29zdic6jj0uKRqniHX6GiUZw4NBCDVDVCFCmca/HNikym K/UyA0FGsPHzsCcDX30PNOqwO5MfzEpPK9U1k4pelW9TIFi3DZzeiNiLIaSQQvYY8qN4 PtejmHMWu07t85i5WntMYEGXJi1YD9eajtj4xpe9qdL/JvjW3r8elK4iEP/61sT6f6gb 7TFfJY70cHXf6h5QydbZJHWAcToTlaJH8dZWwLeG+uhK3C+DWkuPdoh9Q5FjctANP45p /uJ2HVTxO8vYa1UV0JG3JQur0XDaLqd4MUMa+lsN4OjVy67xlaiPXOXgaVZ1HyCz3NLT P4Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rEqDOzrzv1cA6N1C5HIe09p8JEcexs62RmH77rmkVQs=; b=glFyq6m+G2XayF3fH1vTYaSlbdbDsAukbboEx7kWi3wivEjxBhlNFdFWcxtqfijzd0 zzeKlhhV624TECfN0OKTjCyDvzDFkOR3vlphfMdL+IcT9DRqlWIRWfYKiDc4wi0Iv2zD tk4f0dN58XJ0aPdqr0+s01NFa/6NrmvGxUQMkXb+gRC7VfGaI7lHSdrOzzQ72pyjeReS dY7VyKnXAUx7qX7r88aGpHvEGFdCANSU327thfn4AjvLK5OcF5aP8RTNMGVZxurCKoOA T3HgfxuvqQdbRyAmRsW6fUy2O6LF0Wx1QuvxsafoynTbWBtiLvUuPfbGxGFb3/+z41gB ExQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IWCk0ao9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a17090abe0a00b002119e6aa0casi9588089pjs.43.2022.11.07.11.02.16; Mon, 07 Nov 2022 11:02:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=IWCk0ao9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232952AbiKGSzc (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 13:55:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbiKGSza (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 13:55:30 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A295E1139; Mon, 7 Nov 2022 10:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rEqDOzrzv1cA6N1C5HIe09p8JEcexs62RmH77rmkVQs=; b=IWCk0ao9veAQ5SBFD7O1oI/aTQ GbtUnG5IY6yzXmxO80j7/qvUBvKANFx+UwIqk1AfavoCvx+IqEkX2WhxEQOFtScwjsRR7iLO1Ff0t ebQVzDPNmEdZ9cbPfjYABI16FwypzAgvh2lXtSyakE/kbFZXPYxxnQ1OscuWonR+iRsY=; Received: from p200300daa72ee1007849d74f78949f6c.dip0.t-ipconnect.de ([2003:da:a72e:e100:7849:d74f:7894:9f6c] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from <nbd@nbd.name>) id 1os7HE-000LCc-0p; Mon, 07 Nov 2022 19:55:20 +0100 From: Felix Fietkau <nbd@nbd.name> To: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: linux-kernel@vger.kernel.org Subject: [PATCH 08/14] net: vlan: remove invalid VLAN protocol warning Date: Mon, 7 Nov 2022 19:54:46 +0100 Message-Id: <20221107185452.90711-8-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221107185452.90711-1-nbd@nbd.name> References: <20221107185452.90711-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748865132692295865?= X-GMAIL-MSGID: =?utf-8?q?1748865132692295865?= |
Series |
[01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length
|
|
Commit Message
Felix Fietkau
Nov. 7, 2022, 6:54 p.m. UTC
On MTK SoC ethernet, using NETIF_F_HW_VLAN_CTAG_RX in combination with hardware
special tag parsing can pass the special tag port metadata as VLAN protocol ID.
When the results is added as a skb hwaccel VLAN tag, it triggers a warning from
vlan_do_receive before calling the DSA tag receive function.
Remove this warning in order to properly pass the tag to the DSA receive function,
which will parse and clear it.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/8021q/vlan.h | 1 -
1 file changed, 1 deletion(-)
Comments
On Mon, Nov 07, 2022 at 07:54:46PM +0100, Felix Fietkau wrote: > On MTK SoC ethernet, using NETIF_F_HW_VLAN_CTAG_RX in combination with hardware > special tag parsing can pass the special tag port metadata as VLAN protocol ID. > When the results is added as a skb hwaccel VLAN tag, it triggers a warning from > vlan_do_receive before calling the DSA tag receive function. > Remove this warning in order to properly pass the tag to the DSA receive function, > which will parse and clear it. > > Signed-off-by: Felix Fietkau <nbd@nbd.name> > --- > net/8021q/vlan.h | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h > index 5eaf38875554..3f9c0406b266 100644 > --- a/net/8021q/vlan.h > +++ b/net/8021q/vlan.h > @@ -44,7 +44,6 @@ static inline int vlan_proto_idx(__be16 proto) > case htons(ETH_P_8021AD): > return VLAN_PROTO_8021AD; > default: > - WARN(1, "invalid VLAN protocol: 0x%04x\n", ntohs(proto)); Why would you ever want to remove a warning that's telling you you're doing something wrong? Aren't you calling __vlan_hwaccel_put_tag() with the wrong thing (i.e. htons(RX_DMA_VPID()) as opposed to VPID translated to something digestible by the rest of the network stack.. ETH_P_8021Q, ETH_P_8021AD etc)? > return -EINVAL; > } > } > -- > 2.38.1 >
On 07.11.22 22:57, Vladimir Oltean wrote: > On Mon, Nov 07, 2022 at 07:54:46PM +0100, Felix Fietkau wrote: >> On MTK SoC ethernet, using NETIF_F_HW_VLAN_CTAG_RX in combination with hardware >> special tag parsing can pass the special tag port metadata as VLAN protocol ID. >> When the results is added as a skb hwaccel VLAN tag, it triggers a warning from >> vlan_do_receive before calling the DSA tag receive function. >> Remove this warning in order to properly pass the tag to the DSA receive function, >> which will parse and clear it. >> >> Signed-off-by: Felix Fietkau <nbd@nbd.name> >> --- >> net/8021q/vlan.h | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h >> index 5eaf38875554..3f9c0406b266 100644 >> --- a/net/8021q/vlan.h >> +++ b/net/8021q/vlan.h >> @@ -44,7 +44,6 @@ static inline int vlan_proto_idx(__be16 proto) >> case htons(ETH_P_8021AD): >> return VLAN_PROTO_8021AD; >> default: >> - WARN(1, "invalid VLAN protocol: 0x%04x\n", ntohs(proto)); > > Why would you ever want to remove a warning that's telling you you're > doing something wrong? > > Aren't you calling __vlan_hwaccel_put_tag() with the wrong thing (i.e. > htons(RX_DMA_VPID()) as opposed to VPID translated to something > digestible by the rest of the network stack.. ETH_P_8021Q, ETH_P_8021AD > etc)? The MTK ethernet hardware treats the DSA special tag as a VLAN tag and reports it as such. The ethernet driver passes this on as a hwaccel tag, and the MTK DSA tag parser consumes it. The only thing that's sitting in the middle looking at the tag is the VLAN device lookup with that warning. Whenever DSA is not being used, the MTK ethernet device can also process regular VLAN tags. For those tags, htons(RX_DMA_VPID()) will contain the correct VPID. - Felix
On Tue, Nov 08, 2022 at 07:08:46AM +0100, Felix Fietkau wrote: > On 07.11.22 22:57, Vladimir Oltean wrote: > > Aren't you calling __vlan_hwaccel_put_tag() with the wrong thing (i.e. > > htons(RX_DMA_VPID()) as opposed to VPID translated to something > > digestible by the rest of the network stack.. ETH_P_8021Q, ETH_P_8021AD > > etc)? > > The MTK ethernet hardware treats the DSA special tag as a VLAN tag and > reports it as such. The ethernet driver passes this on as a hwaccel tag, and > the MTK DSA tag parser consumes it. The only thing that's sitting in the > middle looking at the tag is the VLAN device lookup with that warning. > > Whenever DSA is not being used, the MTK ethernet device can also process > regular VLAN tags. For those tags, htons(RX_DMA_VPID()) will contain the > correct VPID. So I don't object to the overall theme of having the DSA master offload the parsing and removal of the DSA tag, but you knock down a bit too many fences if you carry the DSA tag in skb->vlan_present (not only VLAN upper device lookup, but also the flow dissector). What other information will be present in the offloaded DSA headers except source port information? Maxime Chevallier is also working on a similar problem for qca8k, except in that case, the RX DSA offload seems to not be optional for him. https://patchwork.kernel.org/project/netdevbpf/patch/20221104174151.439008-4-maxime.chevallier@bootlin.com/ Would a solution based on METADATA_HW_PORT_MUX and dst_metadata that point to refcounted, preallocated structs work for Mediatek SoCs with DSA, or would more information be necessary? Meaning: mtk_eth_soc attaches the dst_metadata to the skb, tag_mtk.c retrieves and removes it.
On 08.11.22 10:00, Vladimir Oltean wrote: > On Tue, Nov 08, 2022 at 07:08:46AM +0100, Felix Fietkau wrote: >> On 07.11.22 22:57, Vladimir Oltean wrote: >> > Aren't you calling __vlan_hwaccel_put_tag() with the wrong thing (i.e. >> > htons(RX_DMA_VPID()) as opposed to VPID translated to something >> > digestible by the rest of the network stack.. ETH_P_8021Q, ETH_P_8021AD >> > etc)? >> >> The MTK ethernet hardware treats the DSA special tag as a VLAN tag and >> reports it as such. The ethernet driver passes this on as a hwaccel tag, and >> the MTK DSA tag parser consumes it. The only thing that's sitting in the >> middle looking at the tag is the VLAN device lookup with that warning. >> >> Whenever DSA is not being used, the MTK ethernet device can also process >> regular VLAN tags. For those tags, htons(RX_DMA_VPID()) will contain the >> correct VPID. > > So I don't object to the overall theme of having the DSA master offload > the parsing and removal of the DSA tag, but you knock down a bit too > many fences if you carry the DSA tag in skb->vlan_present (not only VLAN > upper device lookup, but also the flow dissector). > > What other information will be present in the offloaded DSA headers > except source port information? Maxime Chevallier is also working on a > similar problem for qca8k, except in that case, the RX DSA offload seems > to not be optional for him. > > https://patchwork.kernel.org/project/netdevbpf/patch/20221104174151.439008-4-maxime.chevallier@bootlin.com/ > > Would a solution based on METADATA_HW_PORT_MUX and dst_metadata that > point to refcounted, preallocated structs work for Mediatek SoCs with > DSA, or would more information be necessary? > > Meaning: mtk_eth_soc attaches the dst_metadata to the skb, tag_mtk.c > retrieves and removes it. I need to look into how METADATA_HW_PORT_MUX works, but I think it could work. - Felix
On Tue, Nov 08, 2022 at 10:20:44AM +0100, Felix Fietkau wrote: > I need to look into how METADATA_HW_PORT_MUX works, but I think it could > work. Could you please coordinate with Maxime to come up with something common? Currently he proposes a generic "oob" tagger, while you propose that we stay with the "mtk"/"qca" taggers, but they are taught to look after offloaded metadata rather than in the packet. IMO your proposal sounds better; the name of the tagging protocol is already exposed to user space via /sys/class/net/<dsa-master>/dsa/tagging and therefore ABI. It's just that we need a way to figure out how to make the flow dissector and other layers not adjust for DSA header length if the DSA tag is offloaded and not present in the packet.
On 08.11.22 10:40, Vladimir Oltean wrote: > On Tue, Nov 08, 2022 at 10:20:44AM +0100, Felix Fietkau wrote: >> I need to look into how METADATA_HW_PORT_MUX works, but I think it could >> work. > > Could you please coordinate with Maxime to come up with something > common? Currently he proposes a generic "oob" tagger, while you propose > that we stay with the "mtk"/"qca" taggers, but they are taught to look > after offloaded metadata rather than in the packet. IMO your proposal > sounds better; the name of the tagging protocol is already exposed to > user space via /sys/class/net/<dsa-master>/dsa/tagging and therefore ABI. > It's just that we need a way to figure out how to make the flow > dissector and other layers not adjust for DSA header length if the DSA > tag is offloaded and not present in the packet. I think it depends on the hardware. If you can rely on the hardware always reporting the port out-of-band, a generic "oob" tagger would be fine. In my case, it depends on whether a second non-DSA ethernet MAC is active on the same device, so I do need to continue using the "mtk" tag driver. The flow dissector part is already solved: I simply used the existing .flow_dissect() tag op. - Felix
On Tue, Nov 08, 2022 at 10:46:54AM +0100, Felix Fietkau wrote: > I think it depends on the hardware. If you can rely on the hardware always > reporting the port out-of-band, a generic "oob" tagger would be fine. > In my case, it depends on whether a second non-DSA ethernet MAC is active on > the same device, so I do need to continue using the "mtk" tag driver. It's not only about the time dimension (always OOB, vs sometimes OOB), but also about what is conveyed through the OOB tag. I can see 2 vendors agreeing today on a common "oob" tagger only to diverge in the future when they'll need to convey more information than just port id. What do you do with the tagging protocol string names then. Gotta make them unique from the get go, can't export "oob" to user space IMO. > The flow dissector part is already solved: I simply used the existing > .flow_dissect() tag op. Yes, well this seems like a generic enough case (DSA offload tag present => don't shift network header because it's where it should be) to treat it in the generic flow dissector and not have to invoke any tagger-specific fixup method.
On 08.11.22 11:08, Vladimir Oltean wrote: > On Tue, Nov 08, 2022 at 10:46:54AM +0100, Felix Fietkau wrote: >> I think it depends on the hardware. If you can rely on the hardware always >> reporting the port out-of-band, a generic "oob" tagger would be fine. >> In my case, it depends on whether a second non-DSA ethernet MAC is active on >> the same device, so I do need to continue using the "mtk" tag driver. > > It's not only about the time dimension (always OOB, vs sometimes OOB), > but also about what is conveyed through the OOB tag. I can see 2 vendors > agreeing today on a common "oob" tagger only to diverge in the future > when they'll need to convey more information than just port id. What do > you do with the tagging protocol string names then. Gotta make them > unique from the get go, can't export "oob" to user space IMO. > >> The flow dissector part is already solved: I simply used the existing >> .flow_dissect() tag op. > > Yes, well this seems like a generic enough case (DSA offload tag present > => don't shift network header because it's where it should be) to treat > it in the generic flow dissector and not have to invoke any tagger-specific > fixup method. In that case I think we shouldn't use METADATA_HW_PORT_MUX, since it is already used for other purposes. I will add a new metadata type METADATA_DSA instead. - Felix
On Tue, Nov 08, 2022 at 11:24:51AM +0100, Felix Fietkau wrote: > On 08.11.22 11:08, Vladimir Oltean wrote: > > On Tue, Nov 08, 2022 at 10:46:54AM +0100, Felix Fietkau wrote: > > > I think it depends on the hardware. If you can rely on the hardware always > > > reporting the port out-of-band, a generic "oob" tagger would be fine. > > > In my case, it depends on whether a second non-DSA ethernet MAC is active on > > > the same device, so I do need to continue using the "mtk" tag driver. > > > > It's not only about the time dimension (always OOB, vs sometimes OOB), > > but also about what is conveyed through the OOB tag. I can see 2 vendors > > agreeing today on a common "oob" tagger only to diverge in the future > > when they'll need to convey more information than just port id. What do > > you do with the tagging protocol string names then. Gotta make them > > unique from the get go, can't export "oob" to user space IMO. > > > > > The flow dissector part is already solved: I simply used the existing > > > .flow_dissect() tag op. > > > > Yes, well this seems like a generic enough case (DSA offload tag present > > => don't shift network header because it's where it should be) to treat > > it in the generic flow dissector and not have to invoke any tagger-specific > > fixup method. > > In that case I think we shouldn't use METADATA_HW_PORT_MUX, since it is > already used for other purposes. I will add a new metadata type METADATA_DSA > instead. Which case, flow dissector figuring out that DSA offload tag is present? Well, the skb can only carry one dst pointer ATM, so if it's METADATA_HW_PORT_MUX but it belongs to SR-IOV on the DSA master, we have bigger problems anyway. So, proto == ETH_P_XDSA && have METADATA_HW_PORT_MUX should be pretty good indication that DSA offload tag is present. Anyway I raised this concern as well to Jakub as well. Seems to be theoretical at the moment. Using METADATA_HW_PORT_MUX seems to be fine right now. Can be changed later if needed; it's not ABI.
On 08.11.22 11:33, Vladimir Oltean wrote: > On Tue, Nov 08, 2022 at 11:24:51AM +0100, Felix Fietkau wrote: >> On 08.11.22 11:08, Vladimir Oltean wrote: >> > On Tue, Nov 08, 2022 at 10:46:54AM +0100, Felix Fietkau wrote: >> > > I think it depends on the hardware. If you can rely on the hardware always >> > > reporting the port out-of-band, a generic "oob" tagger would be fine. >> > > In my case, it depends on whether a second non-DSA ethernet MAC is active on >> > > the same device, so I do need to continue using the "mtk" tag driver. >> > >> > It's not only about the time dimension (always OOB, vs sometimes OOB), >> > but also about what is conveyed through the OOB tag. I can see 2 vendors >> > agreeing today on a common "oob" tagger only to diverge in the future >> > when they'll need to convey more information than just port id. What do >> > you do with the tagging protocol string names then. Gotta make them >> > unique from the get go, can't export "oob" to user space IMO. >> > >> > > The flow dissector part is already solved: I simply used the existing >> > > .flow_dissect() tag op. >> > >> > Yes, well this seems like a generic enough case (DSA offload tag present >> > => don't shift network header because it's where it should be) to treat >> > it in the generic flow dissector and not have to invoke any tagger-specific >> > fixup method. >> >> In that case I think we shouldn't use METADATA_HW_PORT_MUX, since it is >> already used for other purposes. I will add a new metadata type METADATA_DSA >> instead. > > Which case, flow dissector figuring out that DSA offload tag is present? > Well, the skb can only carry one dst pointer ATM, so if it's METADATA_HW_PORT_MUX > but it belongs to SR-IOV on the DSA master, we have bigger problems anyway. > So, proto == ETH_P_XDSA && have METADATA_HW_PORT_MUX should be pretty > good indication that DSA offload tag is present. > > Anyway I raised this concern as well to Jakub as well. Seems to be > theoretical at the moment. Using METADATA_HW_PORT_MUX seems to be fine > right now. Can be changed later if needed; it's not ABI. Okay, I will stick with METADATA_HW_PORT_MUX for now. If we use it in the flow dissector to avoid the tagger specific fixup, we might as well use it in DSA to skip the tag proto receive call. What do you think? - Felix
On Tue, Nov 08, 2022 at 11:42:09AM +0100, Felix Fietkau wrote: > Okay, I will stick with METADATA_HW_PORT_MUX for now. If we use it in the > flow dissector to avoid the tagger specific fixup, we might as well use it > in DSA to skip the tag proto receive call. What do you think? I suppose that dsa_switch_rcv() could test for the presence of a metadata_dst and treat that generically if present, without unnecessarily calling down into the tagging protocol ->rcv() call. The assumption being that the metadata_dst is always formatted (by the DSA master) in a vendor-agnostic way.
On 08.11.22 11:52, Vladimir Oltean wrote: > On Tue, Nov 08, 2022 at 11:42:09AM +0100, Felix Fietkau wrote: >> Okay, I will stick with METADATA_HW_PORT_MUX for now. If we use it in the >> flow dissector to avoid the tagger specific fixup, we might as well use it >> in DSA to skip the tag proto receive call. What do you think? > > I suppose that dsa_switch_rcv() could test for the presence of a metadata_dst > and treat that generically if present, without unnecessarily calling down into > the tagging protocol ->rcv() call. The assumption being that the metadata_dst > is always formatted (by the DSA master) in a vendor-agnostic way. Right. The assumption is that if we use METADATA_HW_PORT_MUX, the field md_dst->u.port_info.port_id will contain the index of the DSA port. - Felix
On Tue, Nov 08, 2022 at 11:56:52AM +0100, Felix Fietkau wrote: > On 08.11.22 11:52, Vladimir Oltean wrote: > > On Tue, Nov 08, 2022 at 11:42:09AM +0100, Felix Fietkau wrote: > > > Okay, I will stick with METADATA_HW_PORT_MUX for now. If we use it in the > > > flow dissector to avoid the tagger specific fixup, we might as well use it > > > in DSA to skip the tag proto receive call. What do you think? > > > > I suppose that dsa_switch_rcv() could test for the presence of a metadata_dst > > and treat that generically if present, without unnecessarily calling down into > > the tagging protocol ->rcv() call. The assumption being that the metadata_dst > > is always formatted (by the DSA master) in a vendor-agnostic way. > > Right. The assumption is that if we use METADATA_HW_PORT_MUX, the field > md_dst->u.port_info.port_id will contain the index of the DSA port. Yes. Please coordinate with Maxime, see if it's possible to do something similar (generic) on TX, depending on whether the DSA master reports it can interpret metadata_dst as offloaded DSA tags. You didn't copy too many folks to this patch set, so others might have missed it.
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h index 5eaf38875554..3f9c0406b266 100644 --- a/net/8021q/vlan.h +++ b/net/8021q/vlan.h @@ -44,7 +44,6 @@ static inline int vlan_proto_idx(__be16 proto) case htons(ETH_P_8021AD): return VLAN_PROTO_8021AD; default: - WARN(1, "invalid VLAN protocol: 0x%04x\n", ntohs(proto)); return -EINVAL; } }