Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp607754lqp; Sun, 9 Jun 2024 10:35:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNWgnhxKeSz8QEeQk6ws0+qPbmENHhkqoh15dVW7ypvJUS5VREnPgK8L+E3T9jCNC5sFneR6wT9bObcW68/12OoOTJoFu5EYTTDzhz4Q== X-Google-Smtp-Source: AGHT+IEXP0cbeqERXKCHBC3aDKX2i+8ArqlJLMQ4IJIl4hdnFK3VozD1f4/9GRJ/G6lQl4zPvpnq X-Received: by 2002:ac8:5f89:0:b0:43a:e2da:2b78 with SMTP id d75a77b69052e-44041b8dbfamr71643191cf.29.1717954553566; Sun, 09 Jun 2024 10:35:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717954553; cv=pass; d=google.com; s=arc-20160816; b=eAWOiizNTRHZI32DpZczngXfX3bx0zO8uGTPs8jM/BbXq40dTvJuys4DKg5rpTYi/f L3LOK1VhlWpzuqSzcQm5l4RQllGCXoEeF5tGy8QYNz2BR6UwKHJ1jMBIctrD40IohRSi Z9Lpd5cc3Wu89fyqOdn9qzYWsBrzgZnxxGOlLCr6PUk3xDs0KzK5xYbaZhVl5zNLKImN SmhiBSywYYswXyBgXqsclQlDyyem0qE4zl4uYAOPd37+Z80zbecSAx717yaVSvmKL6M6 TcqvP4LmgkRMGiDdHmUrY7h/dmmOcS7W2CQVmf8AkU/uvjQ6jaXySwTHXq0pn1jvStnT PB4Q== 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=kQ39yrWSeLcfBXFbIW3/ujUEiVU2vTM6IiCeVabdV3U=; fh=NMJjGA7aflQMPIhpvsA4i+dCSr7fXFZYjo6umaJRvs0=; b=YWwEQFmiIJTl/3niaRxFAHn1qiOMCKlqj3s4L9+R6bBq21KhZVEQjeOCx9hZR9zBCn qkFoe20I4RSKOiy/Hpg7wLpgM8yZ++tr2pAW4mWWRU3vpbyro4JV+xyL6QhJO7u6cqsz xcALjBpIkIPN9KzpRn0gQr1H8TMTODoSxiCHF/Oe28S0z5+CyAPAVRyQJD5M123P2Mqi VdbvAJwvwD3JBTqQV+KbRL8/zYsJlln55TdkSgeEnHgUm+047/UhT3lhlnLI5EpfxAoY 9z/22NMehoyMC0SvuUsBsboVXDWanRaebaJwEpK0wK2kh2dpIf0/Fy+h6tfTzcoXm970 BJ8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=EdXQqAH7; 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-207446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207446-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-4405d1f1204si30606061cf.347.2024.06.09.10.35.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 10:35:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=EdXQqAH7; 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-207446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207446-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 48E4A1C209B4 for ; Sun, 9 Jun 2024 17:35:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CAE7250249; Sun, 9 Jun 2024 17:35:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="EdXQqAH7" 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 B2C83D2E5; Sun, 9 Jun 2024 17:34:56 +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=1717954500; cv=none; b=mfnQTM/XkSY/DTv2Spb1B2qrTYtBqW7zOdVnDaBu39NrCxJIASdK49hF32P+0TOuVaY9qovfs+nRh03QGhCyscK3KCvboX85k9HI7XYwKJgaWJbIRXTKsGAK0940uVqfH9/o18aQxDIPA4hHZXEVpwwL/prNjJ3Vq83wWhYV76U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717954500; c=relaxed/simple; bh=JkrJak/o4liAaLBMuPCt9zcaNAf1wkkZu0Qot3yV6wg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=tPp87dB7qJUlnF/gCcPWLgFWbVXDv4y4+aFnydeTtDokvhqmCfeWKmA6k9sPe81s09dNpY0zv68AFkOqxDaMbBDRV/UiUah8GY2miAZJs5eY8rzAgWgDHNHk1AHXp1zItffDnm7COFBf9U0f2Ec4+gm99BnvBSY08MUhwVFwpgk= 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=EdXQqAH7; 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 Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id DE3E4600B1; Sun, 9 Jun 2024 17:34:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1717954494; bh=JkrJak/o4liAaLBMuPCt9zcaNAf1wkkZu0Qot3yV6wg=; h=From:To:Cc:Subject:Date:From; b=EdXQqAH7a3qGW2gZRnfJJiAl70D1KwnUMbIefvkUaBBW79a5LcPm2PPvDwjOgGtpF nW2eIz5JrhxlPCkcB12sd2bqWz8zm+KB2lHJXfINxhQc+aXZBmBvD37CqzD5xr23eH 5haAvzvvdeM0JbwSzDTDwLEX7Vwi2unAgwNrjB8O4cXhz2mBYsx8LrtxrmiHtnLgkE ZgA1C5BrRNuQN5HFjihLedleg9fEqnFF7alBEFvz69z1SDwsBOMXiLVIr5hDJCROa3 zONw2GyEI7FqiCMlSKbYJphr6KSLN6e2Aq4QbryqRP3jLSkYXbj6oHbLNI50VyZXC+ PcC8O0/pko9GQ== Received: by x201s (Postfix, from userid 1000) id BD5A520407A; Sun, 09 Jun 2024 17:34:24 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Edward Cree , Martin Habets , linux-net-drivers@amd.com, Saeed Mahameed , Leon Romanovsky , Tariq Toukan , linux-rdma@vger.kernel.org, Jesse Brandeburg , Tony Nguyen , intel-wired-lan@lists.osuosl.org, Louis Peens , oss-drivers@corigine.com, linux-kernel@vger.kernel.org, Davide Caratti , i.maximets@ovn.org Subject: [PATCH net-next 0/5] net: flower: validate encapsulation control flags Date: Sun, 9 Jun 2024 17:33:50 +0000 Message-ID: <20240609173358.193178-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 Now that all drivers properly rejects unsupported flower control flags used with FLOW_DISSECTOR_KEY_CONTROL, then time has come to add similar checks to the drivers supporting FLOW_DISSECTOR_KEY_ENC_CONTROL. There are currently just 4 drivers supporting this key, and 3 of those currently doesn't validate encapsulated control flags. Encapsulation control flags may currently be unused, but they should still be validated by the drivers, so that drivers will properly reject any new flags when they are introduced. This series adds some helper functions, and implements them in all 4 drivers. NB: It is currently discussed[1] to use encapsulation control flags for tunnel flags instead of the new FLOW_DISSECTOR_KEY_ENC_FLAGS. [1] https://lore.kernel.org/netdev/ZmFuxElwZiYJzBkh@dcaratti.users.ipa.redhat.com/ Asbjørn Sloth Tønnesen (5): flow_offload: add encapsulation control flag helpers sfc: use flow_rule_is_supp_enc_control_flags() net/mlx5e: flower: validate encapsulation control flags nfp: flower: validate encapsulation control flags ice: flower: validate encapsulation control flags drivers/net/ethernet/intel/ice/ice_tc_lib.c | 4 +++ .../ethernet/mellanox/mlx5/core/en/tc_tun.c | 6 ++++ .../ethernet/netronome/nfp/flower/offload.c | 4 +++ drivers/net/ethernet/sfc/tc.c | 5 +-- include/net/flow_offload.h | 35 +++++++++++++++++++ 5 files changed, 50 insertions(+), 4 deletions(-) -- 2.45.1