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>, Mark Bloch <mbloch@nvidia.com>,
Maor Dickman <maord@nvidia.com>
Subject: [net-next 15/15] net/mlx5: TC, Add support for SF tunnel offload
Date: Mon, 22 Aug 2022 22:55:33 -0700 [thread overview]
Message-ID: <20220823055533.334471-16-saeed@kernel.org> (raw)
In-Reply-To: <20220823055533.334471-1-saeed@kernel.org>
From: Roi Dayan <roid@nvidia.com>
VF tunnel flow already exists and SF tunnel is the
same flow. Support offloading of tunneling over SF device
by allow to attach an encap route over SF and set to use
indirect flow table on SF.
Signed-off-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Reviewed-by: Maor Dickman <maord@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 7 +++++--
drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 6 +++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 0b98e117cc0a..0872a214d2a3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -1505,8 +1505,11 @@ bool mlx5e_tc_is_vf_tunnel(struct net_device *out_dev, struct net_device *route_
route_priv = netdev_priv(route_dev);
route_mdev = route_priv->mdev;
- if (out_mdev->coredev_type != MLX5_COREDEV_PF ||
- route_mdev->coredev_type != MLX5_COREDEV_VF)
+ if (out_mdev->coredev_type != MLX5_COREDEV_PF)
+ return false;
+
+ if (route_mdev->coredev_type != MLX5_COREDEV_VF &&
+ route_mdev->coredev_type != MLX5_COREDEV_SF)
return false;
return mlx5e_same_hw_devs(out_priv, route_priv);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
index 0abef71cb839..c9a91158e99c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c
@@ -78,12 +78,16 @@ mlx5_esw_indir_table_needed(struct mlx5_eswitch *esw,
struct mlx5_core_dev *dest_mdev)
{
struct mlx5_esw_flow_attr *esw_attr = attr->esw_attr;
+ bool vf_sf_vport;
+
+ vf_sf_vport = mlx5_eswitch_is_vf_vport(esw, vport_num) ||
+ mlx5_esw_is_sf_vport(esw, vport_num);
/* Use indirect table for all IP traffic from UL to VF with vport
* destination when source rewrite flag is set.
*/
return esw_attr->in_rep->vport == MLX5_VPORT_UPLINK &&
- mlx5_eswitch_is_vf_vport(esw, vport_num) &&
+ vf_sf_vport &&
esw->dev == dest_mdev &&
attr->ip_version &&
attr->flags & MLX5_ATTR_FLAG_SRC_REWRITE;
--
2.37.1
prev parent reply other threads:[~2022-08-23 5:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-23 5:55 [pull request][net-next 00/15] mlx5 updates 2022-08-22 Saeed Mahameed
2022-08-23 5:55 ` [net-next 01/15] net/mlx5e: Introduce flow steering API Saeed Mahameed
2022-08-24 12:30 ` patchwork-bot+netdevbpf
2022-08-23 5:55 ` [net-next 02/15] net/mlx5e: Decouple fs_tt_redirect from en.h Saeed Mahameed
2022-08-23 5:55 ` [net-next 03/15] net/mlx5e: Decouple fs_tcp " Saeed Mahameed
2022-08-23 5:55 ` [net-next 04/15] net/mlx5e: Drop priv argument of ptp function in en_fs Saeed Mahameed
2022-08-23 5:55 ` [net-next 05/15] net/mlx5e: Convert ethtool_steering member of flow_steering struct to pointer Saeed Mahameed
2022-08-23 5:55 ` [net-next 06/15] net/mlx5e: Directly get flow_steering struct as input when init/cleanup ethtool steering Saeed Mahameed
2022-08-23 5:55 ` [net-next 07/15] net/mlx5e: Separate ethtool_steering from fs.h and make private Saeed Mahameed
2022-08-23 5:55 ` [net-next 08/15] net/mlx5e: Introduce flow steering debug macros Saeed Mahameed
2022-08-23 5:55 ` [net-next 09/15] net/mlx5e: Make flow steering arfs independent of priv Saeed Mahameed
2022-08-23 5:55 ` [net-next 10/15] net/mlx5e: Make all ttc functions of en_fs get fs struct as argument Saeed Mahameed
2022-08-23 5:55 ` [net-next 11/15] net/mlx5e: Completely eliminate priv from fs.h Saeed Mahameed
2022-08-23 5:55 ` [net-next 12/15] net/mlx5: E-Switch, Add default drop rule for unmatched packets Saeed Mahameed
2022-08-23 5:55 ` [net-next 13/15] net/mlx5: E-Switch, Split creating fdb tables into smaller chunks Saeed Mahameed
2022-08-23 5:55 ` [net-next 14/15] net/mlx5: E-Switch, Move send to vport meta rule creation Saeed Mahameed
2022-08-24 14:43 ` Alexander Lobakin
2022-08-28 6:37 ` Roi Dayan
2022-08-23 5:55 ` Saeed Mahameed [this message]
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=20220823055533.334471-16-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=maord@nvidia.com \
--cc=mbloch@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).