Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3186285rwb; Tue, 8 Nov 2022 01:22:17 -0800 (PST) X-Google-Smtp-Source: AMsMyM4XWKuo9Wb62mHpegAroH1Zfbtv+CzCr821fkPqrNwAf7o+nTKcBvnxv5On0oi6MIsZh0pj X-Received: by 2002:a17:903:185:b0:187:2430:d39e with SMTP id z5-20020a170903018500b001872430d39emr45817717plg.65.1667899336914; Tue, 08 Nov 2022 01:22:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667899336; cv=none; d=google.com; s=arc-20160816; b=VI1VRFlkLAWxRIhBlm0/cN8jL67CxR0Xzc+LZo+ZzTK9J+zQCo4R3k1yyq79Gs+h8O suxBhN5tglZxuIMO7AguSLuNfR72S0T84nIuz8+0w1rvlopCLWa9AVImUiP64MTI9+py mmRmu48RPQTSwhZW5yiNaBKsZoPJ+SgVZd5i36Qi4ud3ZYidYfifHjEXIMZCxD/GhxQE A9Lowr4I7lhSbZGoba3Es4gJDBedoQVfxsIfrBnJWZ4AaezdzurKnuC9bEvnZePYT7oW 0ASajI7YdkTuh3DC6nZNR5PD2x2tu9jjAeAG0jQKjaXf3O++cYhvg26uGvk6VYkXcGCu VZHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qqad13SKeURtqLzBBk2kO3txC+IAP/eZrITsK9q/+vM=; b=RHPF2bM/93WJ3tYo4ffKAUqaFxoDk/WgJz8B0Q0b8tnp0cHh1LRnHTG/O0lIKEOZVQ xBSowlE4Gb4kTXwKogMG+7k7C4OSaPmX4anD8oApAPK6WYy8h5OCUjV1pQALbLmQb1+r 0Kn4UdAY3p61i+OVs/Hpimd/JoKbFwJXLKSNXWCGp8Oyx1fd/rX5AGBW7mBaCYVaceCn F+9if9/Tpy1bITC7aGxGaE3CpylfmEtUj7AjmHf4DVy8M1IUTlfYajhZhwIYp/Aydb87 NZ9VVeZrhOO9/gXqAOTbKZWPNkq0s8/dTVQMnUOpcjzYIAKsF106HLg84dTO8npipH6G XYXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Fyo6VKZF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a170902d48c00b00186ae54007dsi16048576plg.499.2022.11.08.01.22.05; Tue, 08 Nov 2022 01:22:16 -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=pass header.i=@gmail.com header.s=20210112 header.b=Fyo6VKZF; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbiKHJAq (ORCPT + 90 others); Tue, 8 Nov 2022 04:00:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229931AbiKHJAo (ORCPT ); Tue, 8 Nov 2022 04:00:44 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82671FD04; Tue, 8 Nov 2022 01:00:43 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id x2so21432613edd.2; Tue, 08 Nov 2022 01:00:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=qqad13SKeURtqLzBBk2kO3txC+IAP/eZrITsK9q/+vM=; b=Fyo6VKZFQCvyNKwJRr9u1BS9sxRBdiYwe4YcODvmtE+p8ZsS7RB/HbdAAwdL8JAb+s nt1aESdu6rrhWskQlB7pxVWMVZVL8qx67qeKc9iCGhnN0vJquZx2AYFbWb3o5xU7zCGy ncEuuWXw4523mIrYKX73Natdzn08Bz/I2xgFy8M9NNAN9rOcqupPgRGZerow6bqlUmwR kEyC11F+2eCkIVoSvtoWf/0+xpaZ8z2a1JYSsYxFMMQirxwChSM/2ztTr5jO90dz+pJH im+1bLc1CCyvW4Z4EymXPUw45Qu3n3u/I3Wv25HxRte3R/1wbz5xskKgsz89illO6g1/ il4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=qqad13SKeURtqLzBBk2kO3txC+IAP/eZrITsK9q/+vM=; b=bBJziHUYeDrNrLBBRl4HqUj7FJDqQD7y2T0SQeQL98dGPr8oXG6X+4qdhLmbBwaORa 1Xvr1oIX+Baa9OXCWHNdTezX6uSMKqGHhidoCvkx0WoKTa2OmCN2UQ/ZjG8qM/rsqB1N dSlKX7secSTPAGd8JsMDzoirl5JMPM2P/PWTyH+pwKtoHrX+Xs27VgIFVH6iSWOLsYfA NbNblWeOEMFMhg9sLQml35zoooJclcCs2mzJRiHxTqn97ONjZyONd6+RQFFlbK+r1f9g 6195Fu4yojmaenctlWyJa26sgcqCmlHmnTWSykv52sFwTdMhGSvsk7WfcTAu9VSo4xD3 yo7w== X-Gm-Message-State: ACrzQf1BT1sQ4cRn9ymc9AQWJWXw53DG1NSgp5/kBZliHrAtBEox2A4+ mKZeYzaawk4c3YIzC3N0+ds= X-Received: by 2002:aa7:cd12:0:b0:463:69ac:a5d3 with SMTP id b18-20020aa7cd12000000b0046369aca5d3mr46793480edw.269.1667898041911; Tue, 08 Nov 2022 01:00:41 -0800 (PST) Received: from skbuf ([188.27.184.197]) by smtp.gmail.com with ESMTPSA id f24-20020a056402069800b00458a03203b1sm5304486edy.31.2022.11.08.01.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 01:00:41 -0800 (PST) Date: Tue, 8 Nov 2022 11:00:39 +0200 From: Vladimir Oltean To: Felix Fietkau Cc: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/14] net: vlan: remove invalid VLAN protocol warning Message-ID: <20221108090039.imamht5iyh2bbbnl@skbuf> References: <20221107185452.90711-1-nbd@nbd.name> <20221107185452.90711-8-nbd@nbd.name> <20221107215745.ascdvnxqrbw4meuv@skbuf> <3b275dda-39ac-282d-8a46-d3a95fdfc766@nbd.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b275dda-39ac-282d-8a46-d3a95fdfc766@nbd.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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.