From patchwork Wed Jul 3 10:45:53 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: 13721975 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 5817216DEAC; Wed, 3 Jul 2024 10:47: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=1720003647; cv=none; b=dHn7ZeSqPNkR/FBU0fgmTDfzEcoPaRAUGx0TD1vStHgCsE4ewrXSEA47D3m6zdjzzDwBaRzuUqcvT2Gs1bHPzql/va9k63NauTeBlvAmatp1Yv0yFhO05rqhYQazZDx1OTRzbAHClUD7pQXgUay/UbBJ8kh0p/mxmY0t5aOxeOA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720003647; c=relaxed/simple; bh=x3/P101kTrWBP0mOd7ouZ5Zzmzv0mY5UEzLYFmlbEnc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hwu6zdKmz1r2nDYPfruUVEmmkk5mxA0EL2WVmtFziIOTFj6Bl/nyIuwsrwzNkUwocKrg5FDlvnEVVawPvDwHx2DQtFB5vR9aJHhpMj1X4deEex7adFvYSwH8TMfOh/7UtYMU1JmE62nP1RAsmgPbs1T4faDloC0P5BLpoTfAen0= 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=Xj/n5YFd; 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="Xj/n5YFd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1720003636; bh=x3/P101kTrWBP0mOd7ouZ5Zzmzv0mY5UEzLYFmlbEnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xj/n5YFdGB5eR0vDvR5mfOgRtsri8MNKOV1Mpsx16jTM4t43r0fQErkUOWcb9Sw2J 1r1BqO4lvXh8nXKw9WJWy9bRumRS4YT+szTrxD7c7jd4dq09XE9NDcgNieboFuv/sK Aah/MH6A1pCrgDKE6WS0h1Lyg8lphf/tHOE3SkCy4U80HfmpNCfbEMB6dKx0ahAPc/ 2cmIjbU4eCcElZy0wiSQlzN8GEyiC/uytEEthEz1p6pMO8pJONmz4R2lJ4G3iSPlKM 6Lafd2uYnIk1rNd363oOcbIsBOufQhxcIg3+JmH7Sznuwlgp4NECcZE8f0tO9Qyxa8 qw1NgTzxEHBSg== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 2A1D96008B; Wed, 3 Jul 2024 10:47:16 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 61F4F204519; Wed, 03 Jul 2024 10:46:25 +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 4/9] flow_dissector: prepare for encapsulated control flags Date: Wed, 3 Jul 2024 10:45:53 +0000 Message-ID: <20240703104600.455125-5-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 Rename skb_flow_dissect_set_enc_addr_type() to skb_flow_dissect_set_enc_control(), and make it set both addr_type and flags in FLOW_DISSECTOR_KEY_ENC_CONTROL. Signed-off-by: Asbjørn Sloth Tønnesen --- net/core/flow_dissector.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index e64a26379807..1614c6708ea7 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -299,9 +299,10 @@ void skb_flow_dissect_meta(const struct sk_buff *skb, EXPORT_SYMBOL(skb_flow_dissect_meta); static void -skb_flow_dissect_set_enc_addr_type(enum flow_dissector_key_id type, - struct flow_dissector *flow_dissector, - void *target_container) +skb_flow_dissect_set_enc_control(enum flow_dissector_key_id type, + u32 ctrl_flags, + struct flow_dissector *flow_dissector, + void *target_container) { struct flow_dissector_key_control *ctrl; @@ -312,6 +313,7 @@ skb_flow_dissect_set_enc_addr_type(enum flow_dissector_key_id type, FLOW_DISSECTOR_KEY_ENC_CONTROL, target_container); ctrl->addr_type = type; + ctrl->flags = ctrl_flags; } void @@ -367,6 +369,7 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb, { struct ip_tunnel_info *info; struct ip_tunnel_key *key; + u32 ctrl_flags = 0; /* A quick check to see if there might be something to do. */ if (!dissector_uses_key(flow_dissector, @@ -395,9 +398,9 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb, switch (ip_tunnel_info_af(info)) { case AF_INET: - skb_flow_dissect_set_enc_addr_type(FLOW_DISSECTOR_KEY_IPV4_ADDRS, - flow_dissector, - target_container); + skb_flow_dissect_set_enc_control(FLOW_DISSECTOR_KEY_IPV4_ADDRS, + ctrl_flags, flow_dissector, + target_container); if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS)) { struct flow_dissector_key_ipv4_addrs *ipv4; @@ -410,9 +413,9 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb, } break; case AF_INET6: - skb_flow_dissect_set_enc_addr_type(FLOW_DISSECTOR_KEY_IPV6_ADDRS, - flow_dissector, - target_container); + skb_flow_dissect_set_enc_control(FLOW_DISSECTOR_KEY_IPV6_ADDRS, + ctrl_flags, flow_dissector, + target_container); if (dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS)) { struct flow_dissector_key_ipv6_addrs *ipv6;