Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp109004lqp; Tue, 11 Jun 2024 16:56:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUc5W8yfm4gEuKOiovkazIFvwIW+nrl/VDG25D3hRv5mNNdKEPY2GBUXVdrVO4EYG0d5ABcTWWmQBFWXU0REufKyD0i3gY+Pn0U57MPmw== X-Google-Smtp-Source: AGHT+IFvuVl5xlseuc9/mV+m1ZNcKVTGwEVueDmPkh2Ay61Rh1XIfoYMWYnLB4am46Vn9P27bqMg X-Received: by 2002:a17:902:c946:b0:1f6:8a19:4562 with SMTP id d9443c01a7336-1f83b5f2506mr4485465ad.24.1718150173227; Tue, 11 Jun 2024 16:56:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718150173; cv=pass; d=google.com; s=arc-20160816; b=Y/MlUnf4mf7idMtouRCr9HxBvBHLd5JV5btpBnIimXrXaRDv0GGITcSf9I2mZ6Yc8L Nmzp1L6gYRGsAmkv1nPPc02vbDyiZ6sAYXGZ1A2VK2y5wbAiCXyxHFIgIWBmcc4Gna12 gzbl8q5AGU68SMAsW+uz5P1VxZhZEazrJp7JhQzf2bmNsb/xt89rFqVYPT4Xj+GrycmE TdNOSUkgxzjt7ymiDQkPlR9zdixc9e4eFj5KuZKzaB4XOzyfgq8tTY7X9h7XHFtXwb+k MKxPtfHJn4dioDC+P4bD4AZxxhvCKVYQQCgUvINHDJSSJoUCTc6W3nMY84ZAG4uYDazv sbUQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=Zkd8RdI457pNovI45cHHmcuiR9u8WVvw9mMxBY84Rbg=; fh=frjvUbsquGPigjV6mdI2Sw3TyI8amMB5MY8lXlm26fI=; b=ix5s82CNkYJ5v8NJX9+w7hpKxiFOsdvrMVySejUFOGCx0fS6SisxbdaO7QWa7UbZre vI6fmf1o6kdY9D53D1LswIdq3PpP0Tfbftz2G9qNVpXRmijeVMoGAXVGTyzqGalWmApC eyAt1RTtjadJ3fFdHpGJpf6RLhKQk5GKSOrq9EEmdsKk9g2Qc90eqBXc/W4dvUmdbaWS XW5kwSNbugG5Pqj5QhkTlI47G029IeD6Rszw0hITdZp1X1BMhWPUdD2NcJjUQylxh8Sg qb5aE87rImFBMOxShwYxl+rPpwP/1fvAFbAjvlV6FIXWjF7XhEG5RtUJH2fKfU0DjAvk Sokw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=IHIQHmUG; 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-210721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210721-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f71496523asi43889835ad.107.2024.06.11.16.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 16:56:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=IHIQHmUG; 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-210721-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210721-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5FCFF285250 for ; Tue, 11 Jun 2024 23:56:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A35A21586C1; Tue, 11 Jun 2024 23:54:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="IHIQHmUG" 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 E24AB156F27; Tue, 11 Jun 2024 23:54:27 +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=1718150069; cv=none; b=spGrm15DsvuY1p7FBFA/LBqD8capNIt+xN1Zfp0OqeJNQSDTxGXfrFpmTJOBOPXeeT7yJHO/KrwsMYP8M3o05l14FOEQto2sj0CXiKR6/EAYhDB6qunc/o4UZH1VQKLN1aoo8ZAsmkDrLp43nzXzIRV35QK9kZ0aSV0uTLlAcpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718150069; c=relaxed/simple; bh=6WLbAEInjDjxdoJ59nU4KB2k9ELUpSH0unl5+CoajBA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=oYPxtoPP8u9fhyx+Y1URH3jsmu+4u7jmTFOM/P1zE4X91Wn4/WPCv07fAPMw70RSAjc82e80Mxl2D0ofJaQiw+zd9Av5iUALLIB1OlXIZZPSMYFvQVe35w5+FOJ4avzlH8LcwkA8cNviHZgoS2l+TF4LgiTQZh5hiX9f0jh/H8k= 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=IHIQHmUG; 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=1718150060; bh=6WLbAEInjDjxdoJ59nU4KB2k9ELUpSH0unl5+CoajBA=; h=From:To:Cc:Subject:Date:From; b=IHIQHmUGnI4B/OK/rhT8tjEPPf3KfKkAd9EHGPONFq6I4FMHrwBFTQP9FH39j1Rq8 m0JhA5wMmBX8Q4xp+O0rZyhNSyBlU/AEnkCe6ncBgPRb23y0IDa8xWnM1ZbnUeomis Lt6BgyLMVmnUGJdrkpCUICx4M3H2IQJ1ztNuvKu7LV8ZeR2f/kJE8hawKl9MQAQz9w v6p8Z9XZod2ydZqV90ymmH+UECZISXL69b/6e82//ynLEvlIO1TpvNNf/7xm1D+UbE 8/tNs6me4rK7CbxZ9/ya4EJ0P5ZrWUAZShtPzDf9F47nu9MeO+HyuQg9fGzxW3XwLB LTZZZN43GjP0g== Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 723B1600A2; Tue, 11 Jun 2024 23:54:17 +0000 (UTC) Received: by x201s (Postfix, from userid 1000) id 55203201944; 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 0/9] flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage Date: Tue, 11 Jun 2024 23:53:33 +0000 Message-ID: <20240611235355.177667-1-ast@fiberby.net> X-Mailer: git-send-email 2.45.1 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 This series reworks the recently added TCA_FLOWER_KEY_ENC_FLAGS attribute, to be more like TCA_FLOWER_KEY_FLAGS, and use the unused u32 flags field in TCA_FLOWER_KEY_ENC_CONTROL, instead of adding another u32 in FLOW_DISSECTOR_KEY_ENC_FLAGS. I have defined the new FLOW_DIS_F_* and TCA_FLOWER_KEY_FLAGS_* flags to coexists for now, so the meaning of the flags field in struct flow_dissector_key_control is not depending on the context that it is used in. If we run out of bits then we can always make split them up later, if we really want to. Davide and Ilya would this work for you? Currently this series is only compile-tested. Preliminary discussion about these changes: https://lore.kernel.org/netdev/ZmFuxElwZiYJzBkh@dcaratti.users.ipa.redhat.com/ --- If this series is put directly on top of: 668b6a2ef832 ("flow_dissector: add support for tunnel control flags") and 1d17568e74de ("net/sched: cls_flower: add support for matching tunnel control flags") as can be done by reverting them, cherry-picking them, and then applying this series. Then it gives this combined diffstat: $ git diff --stat ... include/net/flow_dissector.h | 17 ++++- include/uapi/linux/pkt_cls.h | 8 ++ net/core/flow_dissector.c | 34 +++++--- net/sched/cls_flower.c | 103 ++++++++++++++++++++++---- 4 files changed, 136 insertions(+), 26 deletions(-) Normal shortlog and diffstat below: Asbjørn Sloth Tønnesen (9): net/sched: flower: define new tunnel flags net/sched: cls_flower: prepare fl_{set,dump}_key_flags() for ENC_FLAGS net/sched: cls_flower: add policy for TCA_FLOWER_KEY_FLAGS flow_dissector: prepare for encapsulated control flags flow_dissector: set encapsulated control flags from tun_flags net/sched: cls_flower: add tunnel flags to fl_{set,dump}_key_flags() net/sched: cls_flower: rework TCA_FLOWER_KEY_ENC_FLAGS usage flow_dissector: cleanup FLOW_DISSECTOR_KEY_ENC_FLAGS flow_dissector: set encapsulation control flags for non-IP include/net/flow_dissector.h | 26 +++---- include/net/ip_tunnels.h | 12 ---- include/uapi/linux/pkt_cls.h | 5 ++ net/core/flow_dissector.c | 50 ++++++------- net/sched/cls_flower.c | 135 ++++++++++++++++++++--------------- 5 files changed, 123 insertions(+), 105 deletions(-) -- 2.45.1