From patchwork Tue Dec 10 09:44:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Woudstra X-Patchwork-Id: 13901191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A911DE7717F for ; Tue, 10 Dec 2024 09:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BztZ0cfqRt9dxay4EdRKv7PmLiYD1WDU1Ehk6gLPnTE=; b=UUvoKS2c+DRqm2n3SsRra+oOgX mKBNIIiU8Uo72w13aX8GSvZ80WCF+GTb/znLruuMQxPE6kp1Sg3aZKxafgmVd+2Bu+zB1tHC1F0l6 G+jpKbEd6A+P6zd9Zg9KfhlLioHcLAmsfxXAjEEUG2mRGi5df9O1L/IZRKMoQ3x6rnGTMPdTaNv/3 h4ijX3z+NPGAaSlyVWfPWtTpe9jXLUUIf4E+UKQ0TssXldmeuGrLTP3FVJkO/v5nMhH8YEqlJolQZ IZwpRizS7OwSXLSGitRKhijq04erFl2J0UtqT7epw6O4y6ZNbfUqAttMaI2saHZCj5mTce1Y1DphT fymp7eHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tKx0B-0000000B2Ui-38xN; Tue, 10 Dec 2024 09:57:59 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tKwp4-0000000AzIa-2grI; Tue, 10 Dec 2024 09:46:31 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d41848901bso2136296a12.0; Tue, 10 Dec 2024 01:46:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733823989; x=1734428789; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BztZ0cfqRt9dxay4EdRKv7PmLiYD1WDU1Ehk6gLPnTE=; b=HGqI/6MrUXAAC5hb4vJVWvcKxJC50OHgaWmcin3bF7Pl4jZrjvur+L+4mhZofmUt0F JmD9Q6udroxg7KMVhTIs7cPc1H4oOU1sbh+ObHHtt4+w/Tn8Jzp5lBDmczZQLp6VBrGV uQSbfiICJ3ed79R/03fQk0dibFG6VB2EsQsn+k8DqwV4P+99rnST+0xVLeEmNygc0dEK bKsjtct7nc8kUOzPms5ftjawmprjWQToRrBKkeqEcnctmwZk81/6xwREH2KANOFvy+0f 2kp8V9rpbkFDuISBhJGJl41VX8/WU5PaKgtR+syRjbSoIjlzVteerNC9KMknTgIbgttI dg7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733823989; x=1734428789; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BztZ0cfqRt9dxay4EdRKv7PmLiYD1WDU1Ehk6gLPnTE=; b=NPa9dY4AhuvYVzXgA7acyNti0lITOPOOgftkjTXWeK9PWAsw7o429HAOk4nkuSKRVf KTyoeYeUrD/+d286NlbwPrCjkDC0gy8g0KihcXwjyokgPTdCYtSgnFvQjtytldMJ79/E rr8rRBBPSYorAzPyO738zUKKAyz7TQ1YWaieMDxPSxVLHKz3sM3yqsJrrb0U62TLCaJf 6HcT3d1ezNyM8tDBtoXFvAqwu5twJ5Vim8x/45oUZvU6YAnstIgu2VSm2aKDfgdv4wND T/xi/Ouzb+RUxS6yMGkPfWuswDuag8WSM+uqN5BqsUucW2o/0RXw6TIzoq0FR90EF6Px d/8g== X-Forwarded-Encrypted: i=1; AJvYcCUG9FC24gA2rXYr+4dkHUMP/UWKuHGfqiGXHjIv+hq8bgl2j3/1h03JxuGTtF0uiZwdoWl4Q01GIR5pt2YGptk=@lists.infradead.org, AJvYcCVqdp7b/6gQrRLi3fCPnltSHAgMriL5PhM8WX2d7NO5LaCt8k9u3/sj1JHZGzHqe2N19Pn9U2ugdBqKe/RHyEDe@lists.infradead.org X-Gm-Message-State: AOJu0YxTFb+yu88boX7iPw5uCijTXmrRPj+Kia+KwdiaVmAZFI5YRO+W b5L470dNhSTn5jK9bPHhbkjFI1C82dqNIhveA3wHydrwbksQGO7I X-Gm-Gg: ASbGncsia/O7cw/lLtMqWNqctdYar83fdMQjz8vmhuvaVcDL+S5v9YPIx2WaxnrtP2e Tqcesop2H/IdCE1ak261Fybm+hnf0vDQxOCEso91paqF8FKXgnYcSKG1sV7Hzhql9rfeqoCCglY k9+2ZZKoT8Piy8zhs+n/du5dKS2LM72XZn4Y0yUNC/Hw9C/+44aeUCi2lAoxVTlRxOs7DGgaJRN QNXaLp7pl394BrdAyLc6S8D2poGOKa65OWjxT1BvAYav5sa55JZWN/9L2pkJhrT0Zd1h2y+KSbi duhDoKcpsAxbetex9YReuKDg2fvC6kSk/6hIoc5zNr/PjUlXts0kHdxeX69wKl211tIPR8Y= X-Google-Smtp-Source: AGHT+IFyTeE5viLWDV5JNS3lSXCPHMg3QwwF9F8vVIQIRSBON1JTkjS6u5VFo+SMdaaFOV+dkCijqQ== X-Received: by 2002:a05:6402:524e:b0:5d0:e461:68e6 with SMTP id 4fb4d7f45d1cf-5d41e36d2acmr2440521a12.17.1733823989216; Tue, 10 Dec 2024 01:46:29 -0800 (PST) Received: from corebook.localdomain (2001-1c00-020d-1300-1b1c-4449-176a-89ea.cable.dynamic.v6.ziggo.nl. [2001:1c00:20d:1300:1b1c:4449:176a:89ea]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d14b609e56sm7313936a12.40.2024.12.10.01.46.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 01:46:28 -0800 (PST) From: Eric Woudstra To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Pablo Neira Ayuso , Jozsef Kadlecsik , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Matthias Brugger , AngeloGioacchino Del Regno , David Ahern , Sebastian Andrzej Siewior , Lorenzo Bianconi , Joe Damato , Alexander Lobakin , Vladimir Oltean , "Frank Wunderlich" , Daniel Golle Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, bridge@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Eric Woudstra Subject: [PATCH RFC v3 net-next 10/13] netfilter: nft_flow_offload: No ingress_vlan forward info for dsa user port Date: Tue, 10 Dec 2024 10:44:58 +0100 Message-ID: <20241210094501.3069-11-ericwouds@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241210094501.3069-1-ericwouds@gmail.com> References: <20241210094501.3069-1-ericwouds@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241210_014630_687148_8C2FE3A2 X-CRM114-Status: GOOD ( 10.97 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The bitfield info->ingress_vlans and correcponding vlan encap are used for a switchdev user port. However, they should not be set for a dsa user port. Signed-off-by: Eric Woudstra --- net/netfilter/nft_flow_offload.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/netfilter/nft_flow_offload.c b/net/netfilter/nft_flow_offload.c index f7c2692ff3f2..387e5574c31f 100644 --- a/net/netfilter/nft_flow_offload.c +++ b/net/netfilter/nft_flow_offload.c @@ -117,6 +117,11 @@ static void nft_dev_path_info(const struct net_device_path_stack *stack, break; if (path->type == DEV_PATH_DSA) { i = stack->num_paths; + if (!info->num_encaps || + !(info->ingress_vlans & BIT(info->num_encaps - 1))) + break; + info->num_encaps--; + info->ingress_vlans &= ~BIT(info->num_encaps - 1); break; } if (path->type == DEV_PATH_MTK_WDMA) {