From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Vlad Buslov <vladbu@nvidia.com>,
Jianbo Liu <jianbol@nvidia.com>
Subject: [net-next 13/15] net/mlx5e: Extend flower police validation
Date: Wed, 13 Jul 2022 15:58:57 -0700 [thread overview]
Message-ID: <20220713225859.401241-14-saeed@kernel.org> (raw)
In-Reply-To: <20220713225859.401241-1-saeed@kernel.org>
From: Vlad Buslov <vladbu@nvidia.com>
Recent net commit 4d1e07d83ccc ("net/mlx5e: Fix matchall police parameters
validation") removed notexceed action id validation from
mlx5e_police_validate() and left it up to callers. However, since
tc_act_can_offload_police() only exists in net-next its validation is
extended in this dedicated followup patch.
Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
Reviewed-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c
index ab32fe6a2e57..4bd9c04a49e3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c
@@ -10,6 +10,12 @@ tc_act_can_offload_police(struct mlx5e_tc_act_parse_state *parse_state,
int act_index,
struct mlx5_flow_attr *attr)
{
+ if (act->police.notexceed.act_id != FLOW_ACTION_PIPE &&
+ act->police.notexceed.act_id != FLOW_ACTION_ACCEPT) {
+ NL_SET_ERR_MSG_MOD(parse_state->extack,
+ "Offload not supported when conform action is not pipe or ok");
+ return false;
+ }
if (mlx5e_policer_validate(parse_state->flow_action, act,
parse_state->extack))
return false;
--
2.36.1
next prev parent reply other threads:[~2022-07-13 22:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 22:58 [pull request][net-next 00/15] mlx5 updates 2022-07-13 Saeed Mahameed
2022-07-13 22:58 ` [net-next 01/15] net/mlx5: Use the bitmap API to allocate bitmaps Saeed Mahameed
2022-07-15 5:20 ` patchwork-bot+netdevbpf
2022-07-13 22:58 ` [net-next 02/15] net/mlx5: Introduce ifc bits for using software vhca id Saeed Mahameed
2022-07-13 22:58 ` [net-next 03/15] net/mlx5: Use software VHCA id when it's supported Saeed Mahameed
2022-07-13 22:58 ` [net-next 04/15] net/mlx5: Expose vnic diagnostic counters for eswitch managed vports Saeed Mahameed
2022-07-13 22:58 ` [net-next 05/15] net/mlx5: debugfs, Add num of in-use FW command interface slots Saeed Mahameed
2022-07-13 22:58 ` [net-next 06/15] net/mlx5: Bridge, refactor groups sizes and indices Saeed Mahameed
2022-07-13 22:58 ` [net-next 07/15] net/mlx5: Bridge, rename filter fg to vlan_filter Saeed Mahameed
2022-07-13 22:58 ` [net-next 08/15] net/mlx5: Bridge, extract VLAN push/pop actions creation Saeed Mahameed
2022-07-13 22:58 ` [net-next 09/15] net/mlx5: Bridge, implement infrastructure for VLAN protocol change Saeed Mahameed
2022-07-13 22:58 ` [net-next 10/15] net/mlx5: Bridge, implement QinQ support Saeed Mahameed
2022-07-13 22:58 ` [net-next 11/15] net/mlx5e: Removed useless code in function Saeed Mahameed
2022-07-13 22:58 ` [net-next 12/15] net/mlx5e: configure meter in flow action Saeed Mahameed
2022-07-13 22:58 ` Saeed Mahameed [this message]
2022-07-13 22:58 ` [net-next 14/15] net/mlx5e: Move the LRO-XSK check to mlx5e_fix_features Saeed Mahameed
2022-07-13 22:58 ` [net-next 15/15] net/mlx5e: Remove the duplicating check for striding RQ when enabling LRO Saeed Mahameed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220713225859.401241-14-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jianbol@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=vladbu@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).