From patchwork Mon Nov 7 18:54:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 16638 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2233706wru; Mon, 7 Nov 2022 11:01:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM7vTw2NTEUYsDmyliShw9njUZEHkG/gb8iw1o4P0Eday/dYlSiZs8WcKwQDl7KzoO1y4KG9 X-Received: by 2002:a63:5d0b:0:b0:464:bb2b:9b0e with SMTP id r11-20020a635d0b000000b00464bb2b9b0emr43412926pgb.583.1667847701774; Mon, 07 Nov 2022 11:01:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667847701; cv=none; d=google.com; s=arc-20160816; b=gv0pDYc6Usvl1w+fcouLE8Z2BXoA63XsL/2xutLH5p8CgAjXTdCgt0Ua8ifS3VX6jY ExT3ZTyVyoxe7HT1NZSmRK3A5CiznnhvQORK7BCmNXJv8zllPfDJfpkPVFjIJmPxkZHZ QT6bWO7b0elfxf1R5Z/C7Rl1PK3lsJjCWusGC0/ZUQ/e+7QsHoyIxygHCE/Ac/ddwgNe eG5QNOdmNEhtOWm0GfTUFwie9f/fXbaMV6V78mDjQkVHUEARNd3KFzhnmN2DHQD+iNOi YzA9wut9JMbSmOo8iNx4eHDkVKTNFD0nylZ/FNY7b+z7t3FfafAVgDK2AykaxVZN1zoB zAww== 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=itzNjPSgtI5YQ3ZzVEgPaMFuJJoHJB+VuPcGUc7XBPA=; b=Nun3holaGACJ9JzK9ct81gAtK2mpixXc1115yIG6RCjBWB3EcvLHUH5TVfj4bUD7vH vBrGBuT0DzgkGgcZNAP0kHWVlEASXelvmzXT0YBHUJcujHZ/ac4qqpOHcqdd6c0rpe2V LofnlGt3om2FX/sqwlWq8pQkZ6VX1wsU8n7F9ujsdR4TJyIR5ZxX9KUmy/V2U+ptw8Na GynACTuQHImqq6njVTs65EQmYWJ53a6tp3R5t0HukInJ+JzG21xXXO0Qs5zanrac8yOW MA8c3vbSy2w8XHFELvFV4ZXw/Xhul6JX0DbmRmPLOd1ibq85zlFqEk+mTu+cQKoQMUUt DHmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=TvI9XFrP; 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 1-20020a621701000000b005668645daebsi9887495pfx.111.2022.11.07.11.01.08; Mon, 07 Nov 2022 11:01:41 -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=TvI9XFrP; 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 S233016AbiKGSzg (ORCPT + 99 others); Mon, 7 Nov 2022 13:55:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232105AbiKGSza (ORCPT ); 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 CA0F821E2B; 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=itzNjPSgtI5YQ3ZzVEgPaMFuJJoHJB+VuPcGUc7XBPA=; b=TvI9XFrPBGbzQWNayCtd/QHfzC c+nStyV96uynxPWlvUEeHDMR8U/pZ1cMjcW1n8KF5LGoD5/zjioGbXaAPOXGpVL467XaV+/7yZY9W vmA5sPiVfmJvbuCirrUKlLOGeZ7yablPwQuT6B68IM2Ha+Nw+hgBL9Ta4puijo45e8Bs=; 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 ) id 1os7HE-000LCc-Hs; Mon, 07 Nov 2022 19:55:20 +0100 From: Felix Fietkau To: netdev@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org Subject: [PATCH 09/14] flow_dissector: detect DSA using skb->protocol even when VLAN tag is present Date: Mon, 7 Nov 2022 19:54:47 +0100 Message-Id: <20221107185452.90711-9-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 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748865071870559418?= X-GMAIL-MSGID: =?utf-8?q?1748865071870559418?= Fixes flow dissection with ethernet devices that can combine VLAN rx hwaccel with DSA, since skb->protocol is set to htons(ETH_P_XDSA) by the network stack. Signed-off-by: Felix Fietkau --- net/core/flow_dissector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 25cd35f5922e..43f6bbca7447 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -970,7 +970,7 @@ bool __skb_flow_dissect(const struct net *net, hlen = skb_headlen(skb); #if IS_ENABLED(CONFIG_NET_DSA) if (unlikely(skb->dev && netdev_uses_dsa(skb->dev) && - proto == htons(ETH_P_XDSA))) { + skb->protocol == htons(ETH_P_XDSA))) { const struct dsa_device_ops *ops; int offset = 0;