From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>,
Doug Ledford <dledford@redhat.com>
Cc: Jason Gunthorpe <jgg@mellanox.com>,
Leon Romanovsky <leonro@mellanox.com>,
Or Gerlitz <ogerlitz@mellanox.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
Rabie Loulou <rabiel@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [for-next 07/15] net/mlx5e: Explicitly set destination e-switch in FDB rules
Date: Thu, 17 May 2018 18:22:50 -0700 [thread overview]
Message-ID: <20180518012258.26968-8-saeedm@mellanox.com> (raw)
In-Reply-To: <20180518012258.26968-1-saeedm@mellanox.com>
From: Rabie Loulou <rabiel@mellanox.com>
Set a specific destination e-switch when setting a destination vport.
Signed-off-by: Rabie Loulou <rabiel@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Shahar Klein <shahark@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 ++
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 1 +
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 5 +++++
3 files changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 4197001f9801..880adc810ccc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -836,6 +836,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
out_priv = netdev_priv(encap_dev);
rpriv = out_priv->ppriv;
attr->out_rep = rpriv->rep;
+ attr->out_mdev = out_priv->mdev;
}
err = mlx5_eswitch_add_vlan_action(esw, attr);
@@ -2501,6 +2502,7 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts,
out_priv = netdev_priv(out_dev);
rpriv = out_priv->ppriv;
attr->out_rep = rpriv->rep;
+ attr->out_mdev = out_priv->mdev;
} else if (encap) {
parse_attr->mirred_ifindex = out_dev->ifindex;
parse_attr->tun_info = *info;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 4cd773fa55e3..ac5db54823a1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -230,6 +230,7 @@ enum {
struct mlx5_esw_flow_attr {
struct mlx5_eswitch_rep *in_rep;
struct mlx5_eswitch_rep *out_rep;
+ struct mlx5_core_dev *out_mdev;
int action;
__be16 vlan_proto;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
index 90c8cb31e633..ea93867d1ab4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
@@ -72,6 +72,11 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_FWD_DEST) {
dest[i].type = MLX5_FLOW_DESTINATION_TYPE_VPORT;
dest[i].vport.num = attr->out_rep->vport;
+ if (MLX5_CAP_ESW(esw->dev, merged_eswitch)) {
+ dest[i].vport.vhca_id =
+ MLX5_CAP_GEN(attr->out_mdev, vhca_id);
+ dest[i].vport.vhca_id_valid = 1;
+ }
i++;
}
if (flow_act.action & MLX5_FLOW_CONTEXT_ACTION_COUNT) {
--
2.17.0
next prev parent reply other threads:[~2018-05-18 1:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 1:22 [pull request][for-next 00/15] Mellanox, mlx5 core and netdev updates 2018-05-17 Saeed Mahameed
2018-05-18 1:22 ` [for-next 01/15] net/mlx5: Vport, Use 'kvfree()' for memory allocated by 'kvzalloc()' Saeed Mahameed
2018-05-18 1:22 ` [for-next 02/15] net/mlx5: Eswitch, " Saeed Mahameed
2018-05-18 1:22 ` [for-next 03/15] IB/mlx5: " Saeed Mahameed
2018-05-18 1:22 ` [for-next 04/15] net/mlx5: Add merged e-switch cap Saeed Mahameed
2018-05-18 1:22 ` [for-next 05/15] net/mlx5: Properly handle a vport destination when setting FTE Saeed Mahameed
2018-05-18 1:22 ` [for-next 06/15] net/mlx5: Add destination e-switch owner Saeed Mahameed
2018-05-18 1:22 ` Saeed Mahameed [this message]
2018-05-18 1:22 ` [for-next 08/15] net/mlx5: Add source " Saeed Mahameed
2018-05-18 1:22 ` [for-next 09/15] net/mlx5e: Explicitly set source e-switch in offloaded TC rules Saeed Mahameed
2018-05-18 1:22 ` [for-next 10/15] net/mlx5e: Offload TC eswitch rules for VFs belonging to different PFs Saeed Mahameed
2018-05-18 1:22 ` [for-next 11/15] net/mlx5e: Add ingress/egress indication for offloaded TC flows Saeed Mahameed
2018-05-18 1:22 ` [for-next 12/15] net/mlx5e: Prepare for shared table to keep TC eswitch flows Saeed Mahameed
2018-05-18 1:22 ` [for-next 13/15] net/mlx5e: Use shared table for offloaded " Saeed Mahameed
2018-05-18 1:22 ` [for-next 14/15] net/mlx5e: Ignore attempts to offload multiple times a TC flow Saeed Mahameed
2018-05-18 1:22 ` [for-next 15/15] net/mlx5e: Add HW vport counters to representor ethtool stats Saeed Mahameed
2018-05-18 17:03 ` [pull request][for-next 00/15] Mellanox, mlx5 core and netdev updates 2018-05-17 David Miller
2018-05-18 17:21 ` Jason Gunthorpe
2018-05-18 20:36 ` Saeed Mahameed
2018-05-18 20:33 ` Saeed Mahameed
2018-05-22 18:48 ` Doug Ledford
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=20180518012258.26968-8-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=dledford@redhat.com \
--cc=jgg@mellanox.com \
--cc=leonro@mellanox.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=rabiel@mellanox.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