From patchwork Fri Jul 5 13:33:43 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: 13725143 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 4439015574A; Fri, 5 Jul 2024 13:34:18 +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=1720186459; cv=none; b=Jnq5ekhTED41iIWxvKx8LMSUt31vIMB6MtAZtfnhZFd2daaCWEwcmxM75jth9RftLOZvEmRoMGKOVL68+vMf9+uAkc3DEUChVmo4n+rD3qredxkxUeSdR0mBPckdB4zozyTyIe+/pIyeKsnuCZvhnKEoBzvsl9YjTPIBGUd1Rys= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720186459; c=relaxed/simple; bh=JJoSLE5E+0mjDp0PfeRqb2o1NFt14d/nWg6OdMLm9/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=F7tPo067Aw7vdxqrG6juYqeiGNuUu3iBhLaKIHWhdUGHljbrMp5063CGW6khncBNpLt+QehzcO8ifUfRDxo36UdQkPQ3yFB0rnSEqrCojEnO2QbxpIQx0SVwCVhd6mZM1/hrRa5QKPauMyrQJZ4FRzhSBPqVe+q3OQR94ooHsQw= 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=R2W8xAB5; 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="R2W8xAB5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1720186451; bh=JJoSLE5E+0mjDp0PfeRqb2o1NFt14d/nWg6OdMLm9/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R2W8xAB5Ldt4R0R2QUgU/ZVjbhEW5J85dmj1D8ep+nkAT8wtVQjr7raSDkHiBPR6Z dQAU4/WFJMwBvUXeYlk+im1Zb9ORG11e56S9vsqQztAWomUue6kAWqougNwitw80cy 4IBkQSSJBpg5W6dwGJCxRmxfVoryuCwIz1JDW9j3Py2nF3bM92h5bPCg9olLwWZc3j LlCshz3iQwr6UBKZqjOGdRKyoZ3k3ZOoUO0cMuG8ZRv/CvGqmrk7PQN1J/OEoIXR2m wm85DI/ApnJP4J5g/ixKD2ipBKMerS4EdmB9lt9XYdR0F9cbMZvWenGGrODwJaBb9a JVGbmc6a8YazA== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 2D0E160079; Fri, 5 Jul 2024 13:34:09 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 0EA722048B2; Fri, 05 Jul 2024 13:33:51 +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 v2 07/10] net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags() Date: Fri, 5 Jul 2024 13:33:43 +0000 Message-ID: <20240705133348.728901-8-ast@fiberby.net> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240705133348.728901-1-ast@fiberby.net> References: <20240705133348.728901-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 Prepare to set and dump the tunnel flags. This code won't see any of these flags yet, as these flags aren't allowed by the NLA_POLICY_MASK, and the functions doesn't get called with encap set to true yet. Signed-off-by: Asbjørn Sloth Tønnesen Tested-by: Davide Caratti --- net/sched/cls_flower.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index fc9a9a0b4897c..2a440f11fe1fa 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -1204,6 +1204,21 @@ static int fl_set_key_flags(struct nlattr **tb, bool encap, u32 *flags_key, TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST, FLOW_DIS_FIRST_FRAG); + fl_set_key_flag(key, mask, flags_key, flags_mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_CSUM, + FLOW_DIS_F_TUNNEL_CSUM); + + fl_set_key_flag(key, mask, flags_key, flags_mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_DONT_FRAGMENT, + FLOW_DIS_F_TUNNEL_DONT_FRAGMENT); + + fl_set_key_flag(key, mask, flags_key, flags_mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_OAM, FLOW_DIS_F_TUNNEL_OAM); + + fl_set_key_flag(key, mask, flags_key, flags_mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_CRIT_OPT, + FLOW_DIS_F_TUNNEL_CRIT_OPT); + return 0; } @@ -3127,6 +3142,21 @@ static int fl_dump_key_flags(struct sk_buff *skb, bool encap, TCA_FLOWER_KEY_FLAGS_FRAG_IS_FIRST, FLOW_DIS_FIRST_FRAG); + fl_get_key_flag(flags_key, flags_mask, &key, &mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_CSUM, + FLOW_DIS_F_TUNNEL_CSUM); + + fl_get_key_flag(flags_key, flags_mask, &key, &mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_DONT_FRAGMENT, + FLOW_DIS_F_TUNNEL_DONT_FRAGMENT); + + fl_get_key_flag(flags_key, flags_mask, &key, &mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_OAM, FLOW_DIS_F_TUNNEL_OAM); + + fl_get_key_flag(flags_key, flags_mask, &key, &mask, + TCA_FLOWER_KEY_FLAGS_TUNNEL_CRIT_OPT, + FLOW_DIS_F_TUNNEL_CRIT_OPT); + _key = cpu_to_be32(key); _mask = cpu_to_be32(mask);