Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp108746lqp; Tue, 11 Jun 2024 16:55:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRMmXCcdtB+OsJn+MoxZzWW/oDGlvD3VAu4YK09bul1slBUmN3ojNBELkA/eXhx2N8OGBJAiYv+bbMe2IQU9zqqRzl9TNIrGOXK1tqXA== X-Google-Smtp-Source: AGHT+IFrx9TjC7kkxEEsi6Mbmqfw33J8553lzUF8N74dSk3eKhjW7th24QloiRkzYOPHSQja9U38 X-Received: by 2002:ac8:5a8a:0:b0:440:f54d:1bac with SMTP id d75a77b69052e-4415abd5ad9mr2563941cf.16.1718150124725; Tue, 11 Jun 2024 16:55:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718150124; cv=pass; d=google.com; s=arc-20160816; b=dOEDnsWkvM7VDO7M6lUqWNItKFxHCfGAjSu4NWKSuoA2wbiGownF+OUjjhM9sLnHrf etAsDuHQ+wc3EV+KXiYI29LGNUOi4V4eLte2LDtqNdZ03jByzCrDhyBP3xAeHOjlt/ck 9Ay5W/TvyyaP7y+jPYvHeZR2vzYgfPN4QdcH1GZXaIkbXZhuZITBH2nprebWJNkKMGNW A3ET9SESXjeKH3WQ2amKG65ScQIctcJtg6S+5fDKJpBYnzqPgn06VDPDWimoVbLQhhSs 7/m8k9qm2skyVAgxNpFVUitUEjoLMCOViA3h2l5AOwD2wxvH7vk/NBv2e5mRHGDYMhqZ GLmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Fm12VLmeM2ExRAjq3Jlw6yd9ITjMNo6qIgSnkgoEnpU=; fh=frjvUbsquGPigjV6mdI2Sw3TyI8amMB5MY8lXlm26fI=; b=eQfIstPxw2CjwcjBhgSblWSbvczBKBI0XgT6cpHwcG/SY+lTZRlOZBvzBSorI94OJX fjdxtDg7KghvwebzzrrlI93lYUlmMnaS4omI92AKT0WP/kmb4NObWofZ7sCEL2qkLKg9 w/dwb4w0aAwSeVz2SI8fwb8++aQnTKcKujEAV5c0u0gjm5pI6nAfBhi1avghGOPOySY8 eaaU7cmvJBZl9I3gE9nsBP6RCWNjT+bRbASVQE51TE/BoMCfpn/toYLnch7mdx868k75 yS7EJ2WAWSKSWpt+NVZPTF4Axyr5EaijoHiOUihOmsJ6o4SM8GJc5iu/NXB9K002Cjcw BmMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=ikGFchdz; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-210718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-440521b92d5si99282221cf.391.2024.06.11.16.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 16:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=ikGFchdz; arc=pass (i=1 spf=pass spfdomain=fiberby.net dkim=pass dkdomain=fiberby.net dmarc=pass fromdomain=fiberby.net); spf=pass (google.com: domain of linux-kernel+bounces-210718-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210718-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 7265A1C22248 for ; Tue, 11 Jun 2024 23:55:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1744D15747D; Tue, 11 Jun 2024 23:54:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="ikGFchdz" 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 77E36156883; Tue, 11 Jun 2024 23:54:26 +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=1718150068; cv=none; b=rrnBzi6fdawfmGEED+iSxQQIYB1+OhtNaMyu6OvTS+NJ/cTNflSY8WE+1VLC8obaM/+OqC8yTLQ14XZAvAinq4adh8ccQZBxtQY/NA/vkeCRqFEO35MPDJWDKrdJETEeca76+zQDnJxlQAM24wyLdAeHchHS7qsO/T4AsaXLnEs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718150068; c=relaxed/simple; bh=uQ3bxVY+0T6qnIHKOOb0Ur6SpvSb5e5xHUZ/3GTatt4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IVeCWynK+Vthfktmit8eMPQw9ToeIE4SPQCqN9ARh2imC+Drz1iV0fpIROiqpCmfnSb0MPFgiE6dJQZeooVZ9bTzBL7w6sSAfK7Hgh+ej1a47jIUHk204ZKzoMY40rHA74zgks+u525gaS6ANAaQpVJMTgH9NdQBtcitFuvUgjg= 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=ikGFchdz; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1718150057; bh=uQ3bxVY+0T6qnIHKOOb0Ur6SpvSb5e5xHUZ/3GTatt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ikGFchdz4a38gulfVPIs0gavYDQsF52n6fpopDkeVBG3GnGXy2GzQjmg8MtaPEi3T KVCmVlyyfIVt0py69aDC87oXnrQfZklHEqBB1Xhx1EDKCsgTiNMBslbEFvpFVeuwnW ccXX9vLYRYFz7nKW633s57R7gMuRdbCZbQMwFXIgxMUqhngoKMhoS/sq2uQDpjno6L cV6HLZo8jig+wTLAbTXJk8kRlaJPYdEx7N/YN3um7zDQoiV8k5H2TZVnM1ab5TIXfX vIhW+YG6ojcFLD1cQ7Akh84em4k5O2Pmclm5rH9osMuK1KdabYgVaYl1cOwiPM4dLo Ug8rGlRFC7KDw== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id AEF5560085; Tue, 11 Jun 2024 23:54:10 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 8297A202FA5; Tue, 11 Jun 2024 23:54:00 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: Davide Caratti , Ilya Maximets , Jamal Hadi Salim , Cong Wang , Jiri Pirko Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH net-next 5/9] flow_dissector: set encapsulated control flags from tun_flags Date: Tue, 11 Jun 2024 23:53:38 +0000 Message-ID: <20240611235355.177667-6-ast@fiberby.net> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240611235355.177667-1-ast@fiberby.net> References: <20240611235355.177667-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set the new FLOW_DIS_F_TUNNEL_* encapsulated control flags, based on if their counter-part is set in tun_flags. These flags are not userspace visible yet, as the code to dump encapsulated control flags will first be added, and later activated in the following patches. Signed-off-by: Asbjørn Sloth Tønnesen --- net/core/flow_dissector.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c index 86a11a01445ad..6e9bd4cecab66 100644 --- a/net/core/flow_dissector.c +++ b/net/core/flow_dissector.c @@ -396,6 +396,15 @@ skb_flow_dissect_tunnel_info(const struct sk_buff *skb, key = &info->key; + if (test_bit(IP_TUNNEL_CSUM_BIT, key->tun_flags)) + ctrl_flags |= FLOW_DIS_F_TUNNEL_CSUM; + if (test_bit(IP_TUNNEL_DONT_FRAGMENT_BIT, key->tun_flags)) + ctrl_flags |= FLOW_DIS_F_TUNNEL_DONT_FRAGMENT; + if (test_bit(IP_TUNNEL_OAM_BIT, key->tun_flags)) + ctrl_flags |= FLOW_DIS_F_TUNNEL_OAM; + if (test_bit(IP_TUNNEL_CRIT_OPT_BIT, key->tun_flags)) + ctrl_flags |= FLOW_DIS_F_TUNNEL_CRIT_OPT; + switch (ip_tunnel_info_af(info)) { case AF_INET: skb_flow_dissect_set_enc_control(FLOW_DISSECTOR_KEY_IPV4_ADDRS, -- 2.45.1