From patchwork Wed Apr 24 12:53:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13641832 X-Patchwork-Delegate: kuba@kernel.org 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 C49D515B12E; Wed, 24 Apr 2024 12:54:07 +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=1713963250; cv=none; b=Oln61OYMYYIRwwmO5NdZQkm5yZDMYgD1HQby6GkmQmZyedjZcq23iUqMiF4hLbO11G3OVmzADnyK+uxVnwx8fxOVTvw3NuSMMA1fCurv5PHUUnrI4nRkKIumb3C64MawI4JMhRwWPxi/Y+JzBhP4ji5dlGFnhn5VM5WhtMuKJ0M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713963250; c=relaxed/simple; bh=spHRJnpxm4ltwTrNamDMm3cZ/Ft8kFmxS/nYJAtGSYE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gR5TPDys/t3s2FR5161qASE8EElgVnRoDcjXdfg4fk4JkBg0Ql3tax0hl4yvP0ZNBbH2pw15NkPpmHGll+uzSKYlpLcLrXJxK1C7PXC05cnDxfsOPc6FieXgUI1bIOS7pIZs5dOWRUkrjEQxrHyO+Hdtoul+RmZNRenbhnFTM3I= 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=D2kdgSKP; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="D2kdgSKP" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 6F806600A9; Wed, 24 Apr 2024 12:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713963245; bh=spHRJnpxm4ltwTrNamDMm3cZ/Ft8kFmxS/nYJAtGSYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D2kdgSKPgFdZlyIJQptx7LcQcJe9l2CiJRu/gkXZzQxJmCRCPXYiuRgLgXszHI9qW jOgaNAlvOxtuZpVsK3fM7Y/dRXdFf0uOKtTXSR+hgHH0rRIQ86o/9Ic2GyN1392oS3 VyNAhpH+qSVr5iAr2L/z1HmgtCHUbAxYCLRWcz+8SOEFqxdqpOnVt4S/zAe0J/QCTz SkcbRCZTV3KbLK8Ls76sE+dU17VeHmpJb/pNIIrulZZNd7Dgcuk3RUI3UMuGy1tSrU CIn5GkqEhf+zefv7y7YgogADjbOYl2gigxsOURMoegAMHcCX6gZsV6BndbigXEmWPt cAbqPKV8qO6ww== Received: by x201s (Postfix, from userid 1000) id 1C6DE205831; Wed, 24 Apr 2024 12:53:52 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , Horatiu Vultur , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jiri Pirko , Simon Horman Subject: [PATCH net-next v2 1/3] net: lan966x: flower: add extack to lan966x_tc_flower_handler_control_usage() Date: Wed, 24 Apr 2024 12:53:38 +0000 Message-ID: <20240424125347.461995-2-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240424125347.461995-1-ast@fiberby.net> References: <20240424125347.461995-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Define extack locally, to reduce line lengths and aid future users. Only compile-tested. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c index d696cf9dbd19..a63b83fa2823 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c @@ -45,6 +45,7 @@ static bool lan966x_tc_is_known_etype(struct vcap_tc_flower_parse_usage *st, static int lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) { + struct netlink_ext_ack *extack = st->fco->common.extack; struct flow_match_control match; int err = 0; @@ -80,7 +81,7 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) return err; out: - NL_SET_ERR_MSG_MOD(st->fco->common.extack, "ip_frag parse error"); + NL_SET_ERR_MSG_MOD(extack, "ip_frag parse error"); return err; } From patchwork Wed Apr 24 12:53:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13641829 X-Patchwork-Delegate: kuba@kernel.org 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 0660915B140; Wed, 24 Apr 2024 12:54:07 +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=1713963250; cv=none; b=Ncxj0amFs3/Ql5s0vmfctm1vdu5+aIaa3lrlJ4WYxMH1FmtLnsroRZyvAhbzh60XyQbk27tCJpT5c2AeMLf32/+KP1sits4InXNQIGZrOU4ev/XHhGFw5dNwe7vyepz+bkFqa2DsSeKL40BRSNkHHUUrLs3Nrh9raNOpMQDly1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713963250; c=relaxed/simple; bh=iNH+eQ6aAUewGyeXzpG70jlt31YtG/wfET46QLPSCps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J4SuaQRvVjp8qZQQfAXgVqAQZ3XvAOa+RCZW3ibxdlNny2EB5k5gw6JwTW554+Wz8ArcnjfefdUQxyh9UvXZlFUpN5YYu0ENDuUhPob9V/GmipEuSS+sG3GZ2qK8jQOkrBgS3xyK/fSolqTDJZv2AmhpYugCt2EofaR7F17G1wE= 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=R1EhFZAX; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="R1EhFZAX" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 68053600A7; Wed, 24 Apr 2024 12:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713963245; bh=iNH+eQ6aAUewGyeXzpG70jlt31YtG/wfET46QLPSCps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R1EhFZAXc18kk+VpEpOy355SLzWZ1Wb7O+jcit7znsOvn6OmX0s2m+hrzRV2EnPzA FAizbkk6jKeYvSTZnMH8X3X8x4GaNONO3LeBQEkYmAw4AazPPR5Yw7weApGmu4bm/L +lQxnfQVSKx0klGZneU0eUtEU+LTQP5VBzMbu0sKQ6ZDHtVmWICH00pMEstmZyA+xM b0mrZihUVpFMfC8EVvUpU5CN7BYF8osVfVx4fV8reClulMYBmRlgB+c/oXhcQAud+y 0UonDeEmlLITL89Ps8T9RH6bnKl75vuem0gruV8umM09rbLTY4G7+f52h04tTKPASJ Gqs7hONU9/owA== Received: by x201s (Postfix, from userid 1000) id D7E0021BB43; Wed, 24 Apr 2024 12:53:58 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , Horatiu Vultur , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jiri Pirko , Simon Horman Subject: [PATCH net-next v2 2/3] net: lan966x: flower: rename goto in lan966x_tc_flower_handler_control_usage() Date: Wed, 24 Apr 2024 12:53:39 +0000 Message-ID: <20240424125347.461995-3-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240424125347.461995-1-ast@fiberby.net> References: <20240424125347.461995-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Rename goto label, as the error message is specific to the fragment flags. Only compile-tested. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c index a63b83fa2823..8baec0cd8d95 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c @@ -60,7 +60,7 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) VCAP_KF_L3_FRAGMENT, VCAP_BIT_0); if (err) - goto out; + goto bad_frag_out; } if (match.mask->flags & FLOW_DIS_FIRST_FRAG) { @@ -73,14 +73,14 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) VCAP_KF_L3_FRAG_OFS_GT0, VCAP_BIT_1); if (err) - goto out; + goto bad_frag_out; } st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL); return err; -out: +bad_frag_out: NL_SET_ERR_MSG_MOD(extack, "ip_frag parse error"); return err; } From patchwork Wed Apr 24 12:53:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= X-Patchwork-Id: 13641830 X-Patchwork-Delegate: kuba@kernel.org 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 2B09215B14B; Wed, 24 Apr 2024 12:54:07 +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=1713963250; cv=none; b=VWfAtSNB2MDhL/8jGr9jEAu/KnzxDWdXVzD2iG6kkJWs3DoqV+IJFshKtEYP51Jc1o+50KicIW1P3NGFGIr9AuEUXaLyjYAvXREw9W9B7c9mM3f+qRsqqW8owP4sjMKg15tgWXpO4cweIBtOwIRIphRdJWFvh6hMSDcGS5b5JNE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713963250; c=relaxed/simple; bh=6KXD0oeK4Ss5GHj0EJM6H4ROKzmr2ymo8levWGdF1ZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o67Czv+F4A2EEAL5RIX4tHjN5ZMILA7JwUFLxHysB4T8aEqIkOJG3ZOUdCXZoim/bOlCErUYoLqPd/hxC7ONP0gSHGuvixUaCpHqAy2WiP/8GMo1P56qdOzUbv6LFr58D/FKpW+3uXYfuW3gxAnW2aXDAm04bkNVcXNQb6Ew0f0= 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=Ju5+3kQS; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fiberby.net header.i=@fiberby.net header.b="Ju5+3kQS" Received: from x201s (193-104-135-243.ip4.fiberby.net [193.104.135.243]) by mail1.fiberby.net (Postfix) with ESMTPSA id 39932600C8; Wed, 24 Apr 2024 12:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fiberby.net; s=202008; t=1713963246; bh=6KXD0oeK4Ss5GHj0EJM6H4ROKzmr2ymo8levWGdF1ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ju5+3kQS/0CsVD4CUrXhaDUtmKTNmqpnNj+oESarYfiQEnjsv/yxMVpbWLWHstc2h GgPmc5ZE+bcRwQImrfpjx6/yizZ4X7/aLPrjyTYLTpADbcNN5WvjKFLJoGzv0fhGGL yA33nsArXJEy2p+Dw47MkOtdKqMnsgWHlAKE5gIlrIS/frEz4y27hhHSkYBjLnR6rz ibiUrMLR2XbFMpdvJD/jnZD2yfJM+nxIcMVSZmBo/pUkNtn5XiV/vFEoTs/e1VOILO FSq/Ng+JJ/YpoqJ0qjSelhWZJ2C/Pim6E6rNwZMfN5RY+q3WrdkSWEKMmPkLoryTSX piUq9av6cigBA== Received: by x201s (Postfix, from userid 1000) id E5E2221BB45; Wed, 24 Apr 2024 12:53:59 +0000 (UTC) From: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= To: netdev@vger.kernel.org Cc: =?utf-8?q?Asbj=C3=B8rn_Sloth_T=C3=B8nnesen?= , Horatiu Vultur , UNGLinuxDriver@microchip.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, Jiri Pirko , Simon Horman Subject: [PATCH net-next v2 3/3] net: lan966x: flower: check for unsupported control flags Date: Wed, 24 Apr 2024 12:53:40 +0000 Message-ID: <20240424125347.461995-4-ast@fiberby.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240424125347.461995-1-ast@fiberby.net> References: <20240424125347.461995-1-ast@fiberby.net> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Use flow_rule_is_supp_control_flags() to reject filters with unsupported control flags. In case any unsupported control flags are masked, flow_rule_is_supp_control_flags() sets a NL extended error message, and we return -EOPNOTSUPP. Only compile-tested. Signed-off-by: Asbjørn Sloth Tønnesen --- drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c index 8baec0cd8d95..43913d6204e1 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c @@ -76,6 +76,11 @@ lan966x_tc_flower_handler_control_usage(struct vcap_tc_flower_parse_usage *st) goto bad_frag_out; } + if (!flow_rule_is_supp_control_flags(FLOW_DIS_IS_FRAGMENT | + FLOW_DIS_FIRST_FRAG, + match.mask->flags, extack)) + return -EOPNOTSUPP; + st->used_keys |= BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL); return err;