Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1333403lqe; Mon, 8 Apr 2024 06:15:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCULlgl9J2cTZWsq/qgEAhyktQxxBB08TEw9F9XGCdKzkc19xYJ1DO6fdcEuZuDzBq3Apd3Eh+vMXDx2V/Ri/SbUoFP6IY8fqPwfChcWqw== X-Google-Smtp-Source: AGHT+IG+/f/wfWCybLNX55S63ceqXHCpndj+vDkbQX379Ak8NBWrLaz/eMYjeQuhSvC54r03a6zN X-Received: by 2002:a17:907:3ea6:b0:a51:b383:f587 with SMTP id hs38-20020a1709073ea600b00a51b383f587mr5311820ejc.15.1712582113801; Mon, 08 Apr 2024 06:15:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712582113; cv=pass; d=google.com; s=arc-20160816; b=cAY4e59cYYSY9JCbaO7amenWLSfnOC9CHl2ECFxz7cXNyQ1g9QS45hWl2+3t6pi0xk xBmXpuMgVHxu9WdRvWH/8ShsuTy2jGKtn2/+5toeB46/7UiCnBvlqc82s0vZzsDozFAa 44ijMi2jQ72xl4xVvyg/ET2gWvxQ7X5F1Tyln5alCcbfbsOZdMa4ceT12U9F4Rfyw5vd vJd3S7Jnj7tlBnaeOIqYWn17VT0q+YC5pk5bye+XrusnKBzT9T7BeEJqNDq5tZwoiz6Z PPJZVXuZydfgtubemy4oLiNkf9E7eEo4ZBZJCjumpKDxSFdYMACGWrdQ9yxVhWlcWDZb kTrQ== 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=japey+UIj5xQrVuN3SU2/xWIsHHfi4uzpMELxh5QNyk=; fh=938viA9k1ccK6J5qK5wK1J5SmYAIRtzf5Iyc8Ouj03s=; b=Uw2PQh8CdmPJ3QdgTe5Pxi26JjWlIeRL3+hGaqcaDry0MTG1xXNULPy9yBEIPy3IJG hlDtBiYgXIJ2Df6zRWEKCUIuyqBeVWT+ZY8heYTQaWEX9EewgR/ILgM7etBCfR4fMZvl rOHq23E9Hp4CsbaLImQqo7pboAeBpCylcC9wdco+YNvIWZeu+ZKjGYeyEJq99/rNiHJR UCx6TDnnirqw45QJfidlRn1UyP35lNlS71kYda03Bu6G1WtONzPhfSX750RdkUrEiQX6 tYW3oEsvSS2fejmGDo54tac5VMv9rXcqRp2QF98SuS9YUfxYpgxMxORLJBu4mtSaIeNM 1L4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=qteOSczA; 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-135409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135409-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 dm6-20020a170907948600b00a51d8604007si817789ejc.640.2024.04.08.06.15.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 06:15:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-135409-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=qteOSczA; 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-135409-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-135409-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 5F9251F2248F for ; Mon, 8 Apr 2024 13:15:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CB7085924; Mon, 8 Apr 2024 13:10:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="qteOSczA" 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 1455C8287F; Mon, 8 Apr 2024 13:10:48 +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=1712581851; cv=none; b=MtooxkWxZE9nMYd60FtkVa/X7asiazVFhJiXtdUxnbdrIRRKfWEfjI99KAwx3eHXG1WNaB5DVU173vgU09/KaBbK2NEmUsldzpcTARa41qnWPYjviHqnoVDz5TQjTtvTbXJOhYFv74HDJuWtylk9CckvTKhcsN+KHKDT+0p0SKU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712581851; c=relaxed/simple; bh=JhvINSSfLvE52ybLOuVuFxGqHxUcIIr9GHOMoeqR5HE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NLKF/atzBxakNeTAd2YCihYAprBEWt2/nLg91CJ0Kn1r2eD2UUoXvG4knhfs6Ya37sr10xbfTgXNSB6OImHtH3lIqT6YIhNd08If1lKTR6r84k+OdELMZsc5Uh4QoICWXlDWPPaGUUuB+9dcCoXTh8qhENcEQ1j7FNs8YYzC5+o= 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=qteOSczA; 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 0D636600DC; Mon, 8 Apr 2024 13:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712581839; bh=JhvINSSfLvE52ybLOuVuFxGqHxUcIIr9GHOMoeqR5HE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qteOSczAIRp0V/v8WSLj6CEOq5SgEreq1kGNOFJntvW4CKBugjgEoTbmq1BX41Nn/ Xaf96Zb6YaMmb/tyGAnXmaLp7SBnoBic75LpSqLSpvD7LQIww0ckQYLE3m6r3pbuaa fJPgSORUvEosFWgNJNE2mJIKC1Fif20T36t/L5HMdV8bB7UUZONLPpzsY2IcYiUkap ZIANjIueZ4utUx4ZpAya0WsTxnF9mfl7blxTnGOqOSaiesr3e6I7Jxixii2T8Tq0/x hhgc4S1KyhVje2+1ZAWrIY9kYw4CmcwoEQmkitMgY5Kcvt30YJKM27rANXsFcRruFO jIlJ7FFto5x5A== Received: by x201s (Postfix, from userid 1000) id 33287204CF2; Mon, 08 Apr 2024 13:09:39 +0000 (UTC) From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Louis Peens , Taras Chornyi , Woojung Huh , UNGLinuxDriver@microchip.com Cc: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yanguo Li , oss-drivers@corigine.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , Edward Cree , Jamal Hadi Salim , Cong Wang , Jiri Pirko Subject: [PATCH net-next 2/6] nfp: flower: fix check for unsupported control flags Date: Mon, 8 Apr 2024 13:09:20 +0000 Message-ID: <20240408130927.78594-3-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240408130927.78594-1-ast@fiberby.net> References: <20240408130927.78594-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 Use flow_rule_no_unsupp_control_flags() Check the mask, not the key, for unsupported control flags. Only compile-tested, no access to HW Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/netronome/nfp/flower/offload.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index 0aceef9fe5826..bc7d7c7e68efb 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -527,10 +527,10 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, struct flow_match_control ctl; flow_rule_match_control(rule, &ctl); - if (ctl.key->flags & ~NFP_FLOWER_SUPPORTED_CTLFLAGS) { - NL_SET_ERR_MSG_MOD(extack, "unsupported offload: match on unknown control flag"); + + if (!flow_rule_no_unsupp_control_flags(NFP_FLOWER_SUPPORTED_CTLFLAGS, + ctl.mask->flags, extack)) return -EOPNOTSUPP; - } } ret_key_ls->key_layer = key_layer; -- 2.43.0