Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3235093rwb; Tue, 8 Nov 2022 02:05:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf5MSiiljtvsR+dkIsCEIf3QDp6NlCRIA3TyJaMDABR9kks6xyjeOBN5bPoR9W9O6c0Kf9jq X-Received: by 2002:a17:907:984:b0:7ae:50c3:396d with SMTP id bf4-20020a170907098400b007ae50c3396dmr14435609ejc.360.1667901935975; Tue, 08 Nov 2022 02:05:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667901935; cv=none; d=google.com; s=arc-20160816; b=o/Iv+N9ZSbU6mK5T7V18d+tZ3BSDNepEE+zDEesjTjc5COkFu2wkXK/vSV4eleXSbz FnXr2ooaGmxdHqjUqWaEMlkJie5A3Ey7h4psH1ESrAwmG8keLBmlNj4NpK/cHovpvGrw V9nJ4oMsF59Wb/BteHJKHD7tR2TmZvO28m38YmeIlLjKlzm/wZyLjgBbw6gjn/X+s9a+ 1lu2N7Gp5wcfjfoaUckxphyFd70cq+4j4dt2ttZVeY0UKM0bfBsp6lk0bWGzL0+7Os0u zt/Bi7QAEroaA2dBvUtem8vLFpOHYd1aWWnG/WZ8rB/mu10lVlVhSLrreFoQ7qlbZDBp 278A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=qlS6GEUkXGwLlwdu2gwmGvxGx2k9efRT6xQlXFUW+zQ=; b=gbiW5e4qScfjcJmQ7bvymodohUJ2ac9GWa1Hoc2HsC4QIK/ao1olrUxscIvGI0Zdu4 6HJto0E9rouOrupuxsqgMk2fmhzLvU8gML+GM0RrRk84ikEer6KYrIM1cOo6bkZ4iQ23 smffdO4rFIqbtkM8duub9ENmbcKbbOh106LnuQEJ/7ShBV3qMC3GMh8zYCEd3QxDnC87 1ozfPbZQGE4IlCpHUyC96RS21I14javBHAykRGHC84plfHmWoWdz0TXXTxry1+KWN6/M 2JDGWk8/uXasrcLq3FwM0Oj9GNf7darkB6tOmx4R6CEavk9UgSpH1esqZdVWdueSTatt amoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=hUfcfaMx; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga32-20020a1709070c2000b007ade20fc415si13038957ejc.811.2022.11.08.02.05.13; Tue, 08 Nov 2022 02:05:35 -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=hUfcfaMx; 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 S233689AbiKHJVA (ORCPT + 89 others); Tue, 8 Nov 2022 04:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbiKHJUy (ORCPT ); Tue, 8 Nov 2022 04:20:54 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCE432655A; Tue, 8 Nov 2022 01:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=qlS6GEUkXGwLlwdu2gwmGvxGx2k9efRT6xQlXFUW+zQ=; b=hUfcfaMxa0oNwAAY8cZ79bGZvg LgavErq/mVjr96n4XP7+CGKKQ1itY8GrUA9VER2MT8Q95dmLJ5z5RiOonUNeS4I9gqYtNgMUbDTZp 0Hh+nXRV4OXD9xrBhokOLQGfLX3i/OK5O3Jp5+RyR2LUd6XZZedkRO4cmaeQWHwGofFk=; Received: from p200300daa72ee1006d973cebf3767a25.dip0.t-ipconnect.de ([2003:da:a72e:e100:6d97:3ceb:f376:7a25] helo=nf.local) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1osKmj-000ToR-LN; Tue, 08 Nov 2022 10:20:45 +0100 Message-ID: <0948d841-b0eb-8281-455a-92f44586e0c0@nbd.name> Date: Tue, 8 Nov 2022 10:20:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH 08/14] net: vlan: remove invalid VLAN protocol warning Content-Language: en-US To: Vladimir Oltean Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org References: <20221107185452.90711-1-nbd@nbd.name> <20221107185452.90711-8-nbd@nbd.name> <20221107215745.ascdvnxqrbw4meuv@skbuf> <3b275dda-39ac-282d-8a46-d3a95fdfc766@nbd.name> <20221108090039.imamht5iyh2bbbnl@skbuf> From: Felix Fietkau In-Reply-To: <20221108090039.imamht5iyh2bbbnl@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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: X-Mailing-List: linux-kernel@vger.kernel.org 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