Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp108561lqp; Tue, 11 Jun 2024 16:54:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJz/uYkPyEdKVoQepAPPvctEQETEMrufH7Busrubu/yjCXpczIyhv9Z7upwessjOppgnYMWaVQdhYjAm5U/5J267Roe/wJEXE7ZASxZQ== X-Google-Smtp-Source: AGHT+IHzSiIS6KbUrjB4ShYqqmalo2yovgP4ZnLhje8qad26+b9Bij+3svDk7i75IjRYipMQXw7a X-Received: by 2002:ac2:443a:0:b0:52c:5224:1bf5 with SMTP id 2adb3069b0e04-52c9a3dfcdamr81404e87.33.1718150088661; Tue, 11 Jun 2024 16:54:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718150088; cv=pass; d=google.com; s=arc-20160816; b=Wu/eJrklGXkHKSag0et0L2vssU3h6W/xxSeAiNS4ECE31PDL711npjP58l0HWHsFft Zf7vBJ6i08L8wFfI9lzmf4mh5BeJWjorikGqoDw3RtskZ8kwyvwWcl3Jr2b1Wp9DrfDx 7/LvARk0TLzz72j+IXS7VfUNCJtHC/iT0XqdOzVtZf1+8cEUCW+MUPKUxoRdX9clKbzC RVOjFgYK6EFotQ8/Q3U1HxRIWFriptOQYn6bzqCxtm2iU0rxVAghyK/kcVtnB7jEJY9q pAFXDFv39yc7C4r6rWgOkvzjkAb50xu16LhcZsBoJ98iUuVz1F091uo8UVmKcLK2ua3k wAHA== 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=IQBwWz84mz1y8/uREDGZXPqadsBI0EUl4wS0S4XIX5A=; fh=frjvUbsquGPigjV6mdI2Sw3TyI8amMB5MY8lXlm26fI=; b=vGGAZiyYOnm+J+KhcVC71MGe0m1t8IpAZBMZhY2Y13lohbUjWt3G8RhyYyiajl7aqA B1oZplBrfDrZWf7PAtW/WKvORJtrZy0COMgIWLri7zIsutQr57SQge+zXmdRUXZeoRYl rHvZavK2m6IRDDOCSeNugDTTYE1XJClfJoKh39VVujAMX19O5zUEKCfvXneDmrfCO7KC r+KSZmY7AVzejOtNwGWse9CFyQCffIH8C+GSWULg9y1QhVcxs2bN7qVBPUlq0jdD4Wm1 kcc6rwMBaJhvGob3MRmi+T7WThZY2lRK9oPWb2VZ5xtZ9/mzgFQUMVGSzdr917E9MTeq aiXA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=wDGQzWmj; 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-210715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f03092f47si381295166b.51.2024.06.11.16.54.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 16:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=wDGQzWmj; 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-210715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210715-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5C76B1F23BC4 for ; Tue, 11 Jun 2024 23:54:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5B9C156967; Tue, 11 Jun 2024 23:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="wDGQzWmj" 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 7D82C155A5C; Tue, 11 Jun 2024 23:54: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=1718150066; cv=none; b=nl2FOPjwAtfrvhov2YSmaLQYcqZwfJeA9bvUNzIrVWjk1rkMbrYk43M91AjG7d3xOlm72zjyRJKn4XqHsddQU140SLiDU5i+SSrauNMgpmvik5Epac2+XZT3n4alx1ZSvWJFscnv89RPvgu2Y/rKuD4cojGJJ2RL5RQbWLaejOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718150066; c=relaxed/simple; bh=+hUPd2L+XW9o1OK0uo9xBYcaeGFFYjWBxApJBDzWEPQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oTz/YFBL/0RuRCcthJbc+1BfMUYQK3J+OPLaeKsbXphAi8t+g3nA+LJ0Q5uwrnDK/QqqJ7ShFjKpBKoHALxsQWHnXOgDJqkuyv1mh6lO00xZGp1CG60ZSK+zC6WRUkU1eZwHdGZGP0iCeZKGh/oJBBj+m4KeWi1jKd6fxS5SCCU= 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=wDGQzWmj; 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=+hUPd2L+XW9o1OK0uo9xBYcaeGFFYjWBxApJBDzWEPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wDGQzWmj+Yj7AXrocGXVArV9XEZglOCxvvj1ga6GT9i9TKmGkmBo6gLmWQwKJz3SP 9ReewMNOLaucH2ohNrbIZdX9/R27K1iJUPMtQ0silY7cqhaxr65ZNE1t/+zQbQZ2W6 mbJ5oR1A3944FS3J5I+kH4E0A5RWP7KI1eyZHiQChTqde+mfWxGYPzGEFUntHiPc2O Wf5r4/Be0HAXaOaJ23xAxluHGHt/16fxr6kI8CrSShQnBADWFADgf64V3UHm3PYoUg zstWI1gHtenkxVke0IHzT/MQhb1a97bnsHjFDQt4ePHroHnlEwAd3oRaLiN2u2PmhW ngUT1AHEodl9w== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id AEEFE60084; Tue, 11 Jun 2024 23:54:10 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 8C9B9202FDB; 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 6/9] net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags() Date: Tue, 11 Jun 2024 23:53:39 +0000 Message-ID: <20240611235355.177667-7-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 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 --- 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 6a2afc31f038b..61ab336645caa 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); -- 2.45.1