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>,
Maor Dickman <maord@nvidia.com>, Roi Dayan <roid@nvidia.com>
Subject: [net 05/14] net/mlx5: E-switch, Fix wrong usage of source port rewrite in split rules
Date: Tue, 14 Mar 2023 10:49:31 -0700 [thread overview]
Message-ID: <20230314174940.62221-6-saeed@kernel.org> (raw)
In-Reply-To: <20230314174940.62221-1-saeed@kernel.org>
From: Maor Dickman <maord@nvidia.com>
In few cases, rules with mirror use case are split to two FTEs, one which
do the mirror action and forward to second FTE which do the rest of the rule
actions and the second redirect action.
In case of mirror rules which do split and forward to ovs internal port or
VF stack devices, source port rewrite should be used in the second FTE but
it is wrongly also set in the first FTE which break the offload.
Fix this issue by removing the wrong check if source port rewrite is needed to
be used on the first FTE of the split and instead return EOPNOTSUPP which will
block offload of rules which mirror to ovs internal port or VF stack devices
which isn't supported.
Fixes: 10742efc20a4 ("net/mlx5e: VF tunnel TX traffic offloading")
Fixes: a508728a4c8b ("net/mlx5e: VF tunnel RX traffic offloading")
Signed-off-by: Maor Dickman <maord@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
.../net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 10 +++++-----
1 file changed, 5 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 d766a64b1823..22075943bb58 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -723,11 +723,11 @@ mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw,
flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
for (i = 0; i < esw_attr->split_count; i++) {
- if (esw_is_indir_table(esw, attr))
- err = esw_setup_indir_table(dest, &flow_act, esw, attr, false, &i);
- else if (esw_is_chain_src_port_rewrite(esw, esw_attr))
- err = esw_setup_chain_src_port_rewrite(dest, &flow_act, esw, chains, attr,
- &i);
+ if (esw_attr->dests[i].flags & MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE)
+ /* Source port rewrite (forward to ovs internal port or statck device) isn't
+ * supported in the rule of split action.
+ */
+ err = -EOPNOTSUPP;
else
esw_setup_vport_dest(dest, &flow_act, esw, esw_attr, i, i, false);
--
2.39.2
next prev parent reply other threads:[~2023-03-14 17:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-14 17:49 [pull request][net 00/14] mlx5 fixes 2023-03-14 Saeed Mahameed
2023-03-14 17:49 ` [net 01/14] net/mlx5e: Fix macsec ASO context alignment Saeed Mahameed
2023-03-14 17:49 ` [net 02/14] net/mlx5e: Don't cache tunnel offloads capability Saeed Mahameed
2023-03-15 13:14 ` Piotr Raczynski
2023-03-14 17:49 ` [net 03/14] net/mlx5: Fix setting ec_function bit in MANAGE_PAGES Saeed Mahameed
2023-03-15 13:10 ` Piotr Raczynski
2023-03-15 20:51 ` Saeed Mahameed
2023-03-15 21:04 ` Jakub Kicinski
2023-03-15 21:09 ` Saeed Mahameed
2023-03-15 21:33 ` Jakub Kicinski
2023-03-15 22:53 ` Saeed Mahameed
2023-03-14 17:49 ` [net 04/14] net/mlx5: Disable eswitch before waiting for VF pages Saeed Mahameed
2023-03-15 12:51 ` Piotr Raczynski
2023-03-14 17:49 ` Saeed Mahameed [this message]
2023-03-14 17:49 ` [net 06/14] net/mlx5: E-switch, Fix missing set of split_count when forward to ovs internal port Saeed Mahameed
2023-03-14 17:49 ` [net 07/14] net/mlx5e: Fix cleanup null-ptr deref on encap lock Saeed Mahameed
2023-03-14 17:49 ` [net 08/14] net/mlx5e: kTLS, Fix missing error unwind on unsupported cipher type Saeed Mahameed
2023-03-14 17:49 ` [net 09/14] net/mlx5: Set BREAK_FW_WAIT flag first when removing driver Saeed Mahameed
2023-03-14 17:49 ` [net 10/14] net/mlx5e: Lower maximum allowed MTU in XSK to match XDP prerequisites Saeed Mahameed
2023-03-14 17:49 ` [net 11/14] net/sched: TC, fix raw counter initialization Saeed Mahameed
2023-03-14 17:49 ` [net 12/14] net/mlx5e: TC, fix missing error code Saeed Mahameed
2023-03-14 17:49 ` [net 13/14] net/mlx5e: TC, fix cloned flow attribute Saeed Mahameed
2023-03-14 17:49 ` [net 14/14] net/mlx5e: TC, Remove error message log print 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=20230314174940.62221-6-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=maord@nvidia.com \
--cc=netdev@vger.kernel.org \
--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).