All of lore.kernel.org
 help / color / mirror / Atom feed
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,
	Shahar Klein <shahark@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [for-next 08/15] net/mlx5: Add source e-switch owner
Date: Thu, 17 May 2018 18:22:51 -0700	[thread overview]
Message-ID: <20180518012258.26968-9-saeedm@mellanox.com> (raw)
In-Reply-To: <20180518012258.26968-1-saeedm@mellanox.com>

From: Shahar Klein <shahark@mellanox.com>

The source e-switch owner allows a vport on one e-switch port be associated
with a rule defined on the second port e-switch.

The role of the source eswitch owner valid bit in the flow group is to
allow the firmware fail driver attempts to wild card the source eswitch
match field. If this bit is not set, the firmware ignores the source
eswitch owner field totally.

Signed-off-by: Shahar Klein <shahark@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 ++++++++++
 include/linux/mlx5/mlx5_ifc.h                     |  6 ++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 5a80279b052a..b1a2ca0ff320 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1372,6 +1372,8 @@ static int create_auto_flow_group(struct mlx5_flow_table *ft,
 	struct mlx5_core_dev *dev = get_dev(&ft->node);
 	int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
 	void *match_criteria_addr;
+	u8 src_esw_owner_mask_on;
+	void *misc;
 	int err;
 	u32 *in;
 
@@ -1384,6 +1386,14 @@ static int create_auto_flow_group(struct mlx5_flow_table *ft,
 	MLX5_SET(create_flow_group_in, in, start_flow_index, fg->start_index);
 	MLX5_SET(create_flow_group_in, in, end_flow_index,   fg->start_index +
 		 fg->max_ftes - 1);
+
+	misc = MLX5_ADDR_OF(fte_match_param, fg->mask.match_criteria,
+			    misc_parameters);
+	src_esw_owner_mask_on = !!MLX5_GET(fte_match_set_misc, misc,
+					 source_eswitch_owner_vhca_id);
+	MLX5_SET(create_flow_group_in, in,
+		 source_eswitch_owner_vhca_id_valid, src_esw_owner_mask_on);
+
 	match_criteria_addr = MLX5_ADDR_OF(create_flow_group_in,
 					   in, match_criteria);
 	memcpy(match_criteria_addr, fg->mask.match_criteria,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 3d17709bc30c..9c3538f1b8b9 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -412,7 +412,7 @@ struct mlx5_ifc_fte_match_set_misc_bits {
 	u8         reserved_at_0[0x8];
 	u8         source_sqn[0x18];
 
-	u8         reserved_at_20[0x10];
+	u8         source_eswitch_owner_vhca_id[0x10];
 	u8         source_port[0x10];
 
 	u8         outer_second_prio[0x3];
@@ -6995,7 +6995,9 @@ struct mlx5_ifc_create_flow_group_in_bits {
 	u8         reserved_at_a0[0x8];
 	u8         table_id[0x18];
 
-	u8         reserved_at_c0[0x20];
+	u8         source_eswitch_owner_vhca_id_valid[0x1];
+
+	u8         reserved_at_c1[0x1f];
 
 	u8         start_flow_index[0x20];
 
-- 
2.17.0

  parent reply	other threads:[~2018-05-18  1:22 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 ` [for-next 07/15] net/mlx5e: Explicitly set destination e-switch in FDB rules Saeed Mahameed
2018-05-18  1:22 ` Saeed Mahameed [this message]
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-9-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=shahark@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.