From patchwork Sat Jul 13 02:19:09 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: 13732290 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 B84CF1DFF8; Sat, 13 Jul 2024 02:19:25 +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=1720837167; cv=none; b=iknChQK9KaBW4no8itpLgoFofRaZ5PqupglrMFgNJJfCPfTxSzw8ihCvMTJLcL549Kp2sLm+BCJJFVNvIgi7OEsoWgUbpbP+E8F2jMzw9c4+A0+GBwk4bc496FyZ65nN6nKtL3+YznuV6Xp1rLl8tyNI852P9qnd+6iM33dM0q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720837167; c=relaxed/simple; bh=6lkLYLizZcXhs67Bu7jME18WSkTmSOvmrJxYv+QlZZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AGFZoFKyq7SSpetaIk6DDie5OpOWOJ5XYNAvI6CviOEc8IZC18g1S54ReEzI0HfwaJKfD1l1WvN1mEkE+vGmJqTyAdd1p3PDEknBkF9iY3PHNULq3zkEz+Mssb1AlxeT4pDslHPnWN0rAqizcmboEjyxksitcT1Fd4DYHQsp3VQ= 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=LjukFLWa; 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="LjukFLWa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1720837159; bh=6lkLYLizZcXhs67Bu7jME18WSkTmSOvmrJxYv+QlZZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjukFLWa4gI8+pclGQSorMtfK+OobDGxkkN3B5p68hj/jSybh/REIRw9Vu9CNYheB skViogemUR/KK8QE6nA0AkezZiIESxHVozt+068UZFTYTIEWl84PcvMcSbp1IC/Pwb w9ohVuPxW14chdF4S/ONBhcC2B3HEt1yoCOfpJm+ccVn/6Y+qpIphkGWXnviFh1z4g jGODdxSaDF9oc4QkJoqWTNrubN9vnz1A+KurNCVEPJEfMI2xgx8LsWcKvCETqwnXlu Q+DaAbmacg8qz7dlmPvZDPKcl6GBue9nclM7VAe7qvUwdvw4uTGS/H8Xa/rTxKtbkM peX1uVlRoJi0g== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 79C3B6007E; Sat, 13 Jul 2024 02:19:19 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id CF671204DC1; Sat, 13 Jul 2024 02:19:12 +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 , Donald Hunter , linux-kernel@vger.kernel.org Subject: [PATCH net-next v4 12/13] flow_dissector: set encapsulation control flags for non-IP Date: Sat, 13 Jul 2024 02:19:09 +0000 Message-ID: <20240713021911.1631517-13-ast@fiberby.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240713021911.1631517-1-ast@fiberby.net> References: <20240713021911.1631517-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 Tested-by: Davide Caratti Reviewed-by: Davide Caratti --- 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 1a9ca129fddde..ada1e39b557e0 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 897d6b683cc6f..38b2df387c1e1 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,