From patchwork Wed Jul 3 10:45:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13721978 X-Patchwork-Delegate: kuba@kernel.org Received: from mail1.fiberby.net (mail1.fiberby.net [193.104.135.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F03D186E5A; Wed, 3 Jul 2024 10:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.104.135.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720003648; cv=none; b=el4ItL3cIhDscWSgU/xC7rd+p5x1JZeKWEpH9LoW3WM9Kc9iF9CGGGCCpBIey4p6h+JrsZ1yd9H+wEnnwoSGr88s0OKE+l/5coXc2YXsgdpQXbo1bbuZ08jHTpcqjTCmugxWv6KXPYmFPJay8Yy+IHdhWqFijG5HtHuW8N2zyaU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720003648; c=relaxed/simple; bh=z6CU+hempZ5xYvk+G+kTKKpEJcoRr3AqdbLe57dcww8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mUKO22ADIe5U4YVL7dDkvCOgwFhNKk6zD9tuLVE+eeraqq0YEam6sF7LZ9Nd/KsIhQY48S7lYnNdCik5j3aUJSucxLQoU13D+74PVqXKUCjjIOusF9hblbLxAwZq9g08CBQY20COnzJnGh4GqT2z0T/pGFJ29C2IN+hBqaPjdzM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net; spf=pass smtp.mailfrom=fiberby.net; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b=N55ptznV; arc=none smtp.client-ip=193.104.135.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=fiberby.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fiberby.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="N55ptznV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1720003635; bh=z6CU+hempZ5xYvk+G+kTKKpEJcoRr3AqdbLe57dcww8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N55ptznV6NMf8dsS9lPo4ylqBG0iMjE+exkEQn+mTqEvjlwGLrIAx9tMrZUBQnVjc mKpfkPS+zaLzWJlCMbJaC88DBrW/RZHfYXJ6WUpct/ckmCtskz9ouHglnhcPM1nL1z EeZG36f8oPy0cTEEcwSCCfrrA8H7qM+uLt8JJWYEbWhucad6ACGj2pKNgb/pknCx9S N+5tHIGq1qvzBJyyfYdEq7CzAZpYd5mQs1/9oeP80UzZsHnm5PFbJgWfE7VoY37hot QNWYCF/xRhIqejHV9ze13ku56PPj8/xF5IUuqOX2y57H5RjudgfP61f0CRUbKaoT7i b6LxXsGo7B4fA== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 149C160078; Wed, 3 Jul 2024 10:46:59 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 7416D20474A; Wed, 03 Jul 2024 10:46:33 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , Davide Caratti , Ilya Maximets , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Simon Horman , Ratheesh Kannoth , Florian Westphal , Alexander Lobakin , linux-kernel@vger.kernel.org Subject: [PATCH net-next 9/9] flow_dissector: set encapsulation control flags for non-IP Date: Wed, 3 Jul 2024 10:45:58 +0000 Message-ID: <20240703104600.455125-10-ast@fiberby.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703104600.455125-1-ast@fiberby.net> References: <20240703104600.455125-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Make sure to set encapsulated control flags also for non-IP packets, such that it's possible to allow matching on e.g. TUNNEL_OAM on a geneve packet carrying a non-IP packet. Suggested-by: Davide Caratti Signed-off-by: Asbjørn Sloth Tønnesen --- net/core/flow_dissector.c | 4 ++++ net/sched/cls_flower.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 1a9ca129fddd..ada1e39b557e 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -434,6 +434,10 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb, ipv6->dst = key->u.ipv6.dst; } break; + default: + skb_flow_dissect_set_enc_control(0, ctrl_flags, flow_dissector, + target_container); + break; } if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_ENC_KEYID)) { diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 897d6b683cc6..38b2df387c1e 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -2199,7 +2199,8 @@ static void fl_init_dissector(struct flow_dissector *dissector, FL_KEY_SET_IF_MASKED(mask, keys, cnt, FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS, enc_ipv6); if (FL_KEY_IS_MASKED(mask, enc_ipv4) || - FL_KEY_IS_MASKED(mask, enc_ipv6)) + FL_KEY_IS_MASKED(mask, enc_ipv6) || + FL_KEY_IS_MASKED(mask, enc_control)) FL_KEY_SET(keys, cnt, FLOW_DISSECTOR_KEY_ENC_CONTROL, enc_control); FL_KEY_SET_IF_MASKED(mask, keys, cnt,