Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp23222lqj; Wed, 10 Apr 2024 02:39:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXLLqEEuRpGerIFLmw6q3lO6z5C5iybRLsJiKrvwzp+lQVgKQ3CO3z5dX9bJsnXWn+WYrQUBmNoQoUnpLLJQ0aaQKmEmdiqW6lrvyUjng== X-Google-Smtp-Source: AGHT+IHhxSTgu+O8BJjR/P0BW8wlAR57jtap6cVMF9B21lmkyvsAe2dM9ug2CpkQj/9Vbf+s4sdM X-Received: by 2002:a17:902:b684:b0:1e3:d38c:9e4b with SMTP id c4-20020a170902b68400b001e3d38c9e4bmr1982758pls.67.1712741983265; Wed, 10 Apr 2024 02:39:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712741983; cv=pass; d=google.com; s=arc-20160816; b=OQFEKWEnuNqqlMSkw1qcHi3oHSXqjyy+CeA2G7LTAzdCyee8FsUHonyzHgBzGbAD6M Pa8peVKR7xVxuEOnKZKtQbF0IAMEMi6Dk7a6Hnz5gZKOeCgq+NyqbVq04wcTIUgeU8dj +MpFUKA3iBXrfJgoHWuSWYz5lCWkHmgPsqV9k09/ivlIpG8/8gGMyasl8lxzVK/j+RoD NulPPje2vSNF3K1uyuwNWSxtAyndRE7o3cjWQIBvrQ0GhN110NHfNXcci8GCiO7R0CkE RRc5qfFWSOYkD4AnP51TaXvhpWFmS80Co3aiOh5RRLPu/FOBW3vSnxhjb9va8GdDnzVp +n1w== 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=CHLMVgcjUTYkA2dDTt4tB4AdouzWHVhWjyZbUQXjeXc=; fh=ymilCVC6zcVXBsRWgTaQwNQko51561pjqSmDEoQse7M=; b=O0ZiU1L45qeEDofrVr2ma88X3WWwDjXfa6DsGzupzzq5nDktmW7QHZoT2XFkyyuUP8 020JotvfF/L6XH5awR1GTZ93SDRkYtIxwSsXvFqYszL0rYkQTgaIipNhFWyKWpLo+gtk OwfqimHmaDNnTSGgbzvtZPFYyB4HQ12JtyD5MfPu8GIIuSwZrtyVo9IIq43y0n0ro6p8 nORg+YzWTTGq4VHzO+sxhkANvVJIFC10h9ufBV4BGonsOWV1mqiu9eK2dGGrMyCvZPn1 YSVC9p5PNWMfFXX0aZO8CBanikF7/qwQqs4w9grP7kJgXIxNZBy/8VVJeM7ChHFGBuHl Ju+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=ni7csRqO; 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-138264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fiberby.net Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o7-20020a170902d4c700b001e3e6ebf396si7720336plg.381.2024.04.10.02.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 02:39:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@fiberby.net header.s=202008 header.b=ni7csRqO; 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-138264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138264-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0955DB238E8 for ; Wed, 10 Apr 2024 09:34:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BABE159564; Wed, 10 Apr 2024 09:33:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="ni7csRqO" 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 6961C155389; Wed, 10 Apr 2024 09:33:00 +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=1712741582; cv=none; b=hKQxjuGZ3DpSB1yGQBlhU3x0GS+hqboEK5L4j62QlGLFMRe3kU43G4+1MDsflGVpuS01qqYfLfLt9CaLHIJwrlglOVd8wkJ/58DKfA/ZeXAPjgjuZf55tXn9EOICRkefXBzwOLMzctlL4YnajPVFCTLGK096zfjpCI1gW451U0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712741582; c=relaxed/simple; bh=GT4plfdJZt39vVnqpYEPKRuMEYhANrU28JfgNwwGJys=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tZh8Zkfd2hUCFdjRQHTUrlW+h4MiN8Dpgi02kkaiOoNICrabUN7jW5dWxufIM9qJOo8DZg5U820GmLWSH3s7oVhRA3n+/0kCc18vBAYrgid0SJDyfqghcdKXyfPsGdHjTPRN2TsUOXKhAU5xjGhrVMLBlWBz7X+n4iMHMIYTEiU= 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=ni7csRqO; 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 E3EBB600AF; Wed, 10 Apr 2024 09:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1712741573; bh=GT4plfdJZt39vVnqpYEPKRuMEYhANrU28JfgNwwGJys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ni7csRqODiV1tTRkAlCPkK5OzuQ85mHFohlaufJJEYUjYvlzJ1lqDQnOPYyt09PJT 18Hdkle/tBFD8EFNt6vG43PchFqjaTP2a4+3EZlYvTVAwdZXiS+uR7OHQwe8ezoMRa p5ZH2MQRBn36cLIyJRsK5PvkH9+F4At68wT4HTf+zg/rRM32AOdoBgUdeurF5I8TRb w5Z3ufhbsyeLtL5fzW26Tzjqm/vKcYIp8wuriytdP56LJXznkcWZhBoNHC4WtHXf40 h2g0+dorGGpdE6hfZNrmV3QEmCSgrTCBe8EbteB+t5NlCw33YhPFDM98GDHcS21/4N g2M5z7AFkYAKQ== Received: by x201s (Postfix, from userid 1000) id 62CF020BDE2; Wed, 10 Apr 2024 09:32:40 +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 , linux-kernel@vger.kernel.org, Louis Peens , Yanguo Li , oss-drivers@corigine.com, Taras Chornyi , Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Florian Fainelli , Vladimir Oltean , Edward Cree , Jamal Hadi Salim , Cong Wang , Jiri Pirko Subject: [PATCH net-next v2 2/4] nfp: flower: fix check for unsupported control flags Date: Wed, 10 Apr 2024 09:32:23 +0000 Message-ID: <20240410093235.5334-3-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240410093235.5334-1-ast@fiberby.net> References: <20240410093235.5334-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_is_supp_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..8e0a890381b60 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_is_supp_control_flags(NFP_FLOWER_SUPPORTED_CTLFLAGS, + ctl.mask->flags, extack)) return -EOPNOTSUPP; - } } ret_key_ls->key_layer = key_layer; -- 2.43.0