Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3024575rwb; Mon, 7 Nov 2022 22:48:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Lw714Mjyq6Mgw10DXRNhy/kZm2+eoKfxVTxIkXKFLoCl69G/5WWU+a+ApGMVVqEaqTkWb X-Received: by 2002:a17:906:2b55:b0:7ae:7ac:db80 with SMTP id b21-20020a1709062b5500b007ae07acdb80mr30364565ejg.187.1667890101341; Mon, 07 Nov 2022 22:48:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667890101; cv=none; d=google.com; s=arc-20160816; b=I8rWxuxyyodEHsb8bucBU3fhzo41+boU3IEThcc8Pn8/0xdJbG28/uHvq3fqn2WfLm q5KBiLqSSdznmqWnfZDUtk3iFX4xqcCAPevyLFqTnndUpTMu4rqM3AolDDVPqmqKBlBc 6rD+ZAMjjenLPK8jZ8Yox5x3f7gbkC7/43Ebw2QhveM0NK3LCsP6p2GATCoU4H72TPK4 lhdCsvB6A9IirJPkWf8PEElHWlPv2+uxUJcXaG9GquhEOA+ZjTDL9DMF5Mlmn64FLiaH o4r7hINXv6XDvfL2uDBLSOyGJDPF6iH7PEoBu6fpCG2q7MUSaRzQUQAjMERXxi1qlhCp SbfA== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=lX5dMwSe9Rd96LMOZpp+mMM/r5G59N9f2OpAHzfo0S8=; b=XBkr6VkFhinqc0D5t8Jo81PQa98dNLnl9tEiq4iqM8TXOZtuBC/YfXGGHoT1tBQHwA 8pNrBFKFssQF5smwdql3XAHGd5mATTOHCIJC/HcOdJ0mmRyrJ+VH1UoxSD33KGZUfARq P2LqRDh6Q0peIUMoiT5C+bM6v3z1HugOntggaU8NhVck85F1IUwjbODopKUpT36fO0iN Fix5CrJIRWxoofPI5QOd/mnqJkkBDOi9r2z27/kg+hU5ghLsRLGygK0fpkKw2GoCp4EJ TPISwPULYsu7+cCzxOZKJC3YTsyUQT2PxXG4HD+7foSiwRnXdF8FEkQ9p53PP6dqA/Xt mn9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b="TqDgqa/u"; 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 hb13-20020a170907160d00b007707f83375bsi12665688ejc.945.2022.11.07.22.48.00; Mon, 07 Nov 2022 22:48:21 -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="TqDgqa/u"; 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 S232929AbiKHGI5 (ORCPT + 90 others); Tue, 8 Nov 2022 01:08:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiKHGIz (ORCPT ); Tue, 8 Nov 2022 01:08:55 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086A11903F; Mon, 7 Nov 2022 22:08:54 -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:Subject:From :References:Cc:To: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=lX5dMwSe9Rd96LMOZpp+mMM/r5G59N9f2OpAHzfo0S8=; b=TqDgqa/uRNm3NQaCoOHCBw2D9F D5ZwGLJ1KIbRl1UGDVy3ISajP1Z66EbqD8/RSxrFKIWLBTGu0Vq+uY/JdmkUGH260KZJ+pQrYNouT 1cFRrfxb6UYA2POZJuzK4oyknOtNPX2RXuR9+MuuRoJ7p1WKOgW75vnOhGjCTssK0x8Q=; 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 1osHmw-000S3b-VA; Tue, 08 Nov 2022 07:08:47 +0100 Message-ID: <3b275dda-39ac-282d-8a46-d3a95fdfc766@nbd.name> Date: Tue, 8 Nov 2022 07:08:46 +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 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> From: Felix Fietkau Subject: Re: [PATCH 08/14] net: vlan: remove invalid VLAN protocol warning In-Reply-To: <20221107215745.ascdvnxqrbw4meuv@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 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 >> --- >> 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