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, Tariq Toukan <tariqt@nvidia.com>,
Roi Dayan <roid@nvidia.com>, Chris Mi <cmi@nvidia.com>,
Oz Shlomo <ozsh@nvidia.com>
Subject: [net-next 13/15] net/mlx5e: Do early return when setup vports dests for slow path flow
Date: Tue, 29 Nov 2022 21:11:50 -0800 [thread overview]
Message-ID: <20221130051152.479480-14-saeed@kernel.org> (raw)
In-Reply-To: <20221130051152.479480-1-saeed@kernel.org>
From: Roi Dayan <roid@nvidia.com>
Adding flow flag cases in setup vport dests before the slow path
case is incorrect as the slow path should take precedence.
Current code doesn't show this importance so make the slow path
case return early and separate from the other cases and remove
the redundant comparison of it in the sample case.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Oz Shlomo <ozsh@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../ethernet/mellanox/mlx5/core/eswitch_offloads.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 8c6c9bcb3dc3..4b358b87fead 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -479,13 +479,15 @@ esw_setup_dests(struct mlx5_flow_destination *dest,
esw_src_port_rewrite_supported(esw))
attr->flags |= MLX5_ATTR_FLAG_SRC_REWRITE;
- if (attr->flags & MLX5_ATTR_FLAG_SAMPLE &&
- !(attr->flags & MLX5_ATTR_FLAG_SLOW_PATH)) {
- esw_setup_sampler_dest(dest, flow_act, attr->sample_attr.sampler_id, *i);
- (*i)++;
- } else if (attr->flags & MLX5_ATTR_FLAG_SLOW_PATH) {
+ if (attr->flags & MLX5_ATTR_FLAG_SLOW_PATH) {
esw_setup_slow_path_dest(dest, flow_act, esw, *i);
(*i)++;
+ goto out;
+ }
+
+ if (attr->flags & MLX5_ATTR_FLAG_SAMPLE) {
+ esw_setup_sampler_dest(dest, flow_act, attr->sample_attr.sampler_id, *i);
+ (*i)++;
} else if (attr->flags & MLX5_ATTR_FLAG_ACCEPT) {
esw_setup_accept_dest(dest, flow_act, chains, *i);
(*i)++;
@@ -506,6 +508,7 @@ esw_setup_dests(struct mlx5_flow_destination *dest,
}
}
+out:
return err;
}
--
2.38.1
next prev parent reply other threads:[~2022-11-30 5:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 5:11 [pull request][net-next 00/15] mlx5 updates 2022-11-29 Saeed Mahameed
2022-11-30 5:11 ` [net-next 01/15] net/mlx5e: Remove unneeded io-mapping.h #include Saeed Mahameed
2022-12-01 6:40 ` patchwork-bot+netdevbpf
2022-11-30 5:11 ` [net-next 02/15] net/mlx5e: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Saeed Mahameed
2022-11-30 5:11 ` [net-next 03/15] net/mlx5: Remove unused ctx variables Saeed Mahameed
2022-11-30 5:11 ` [net-next 04/15] net/mlx5e: Add padding when needed in UMR WQEs Saeed Mahameed
2022-11-30 5:11 ` [net-next 05/15] net/mlx5: Remove unused UMR MTT definitions Saeed Mahameed
2022-11-30 5:11 ` [net-next 06/15] net/mlx5: Generalize name of UMR alignment definition Saeed Mahameed
2022-11-30 5:11 ` [net-next 07/15] net/mlx5: Use generic definition for UMR KLM alignment Saeed Mahameed
2022-11-30 5:11 ` [net-next 08/15] net/mlx5: Fix orthography errors in documentation Saeed Mahameed
2022-11-30 5:11 ` [net-next 09/15] net/mlx5e: Don't use termination table when redundant Saeed Mahameed
2022-11-30 5:11 ` [net-next 10/15] net/mlx5e: Don't access directly DMA device pointer Saeed Mahameed
2022-11-30 5:11 ` [net-next 11/15] net/mlx5e: Delete always true DMA check Saeed Mahameed
2022-11-30 5:11 ` [net-next 12/15] net/mlx5: Remove redundant check Saeed Mahameed
2022-11-30 5:11 ` Saeed Mahameed [this message]
2022-11-30 5:11 ` [net-next 14/15] net/mlx5e: TC, Add offload support for trap with additional actions Saeed Mahameed
2022-11-30 5:11 ` [net-next 15/15] net/mlx5e: Support devlink reload of IPsec core 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=20221130051152.479480-14-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=cmi@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ozsh@nvidia.com \
--cc=pabeni@redhat.com \
--cc=roid@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@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).