From: Or Gerlitz <ogerlitz@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Don Dutile <ddutile@redhat.com>,
Doug Ledford <dledford@redhat.com>,
Saeed Mahameed <saeedm@mellanox.com>,
Tal Alon <talal@mellanox.com>,
Hadar Har-Zion <hadarh@mellanox.com>,
Rony Efraim <ronye@mellanox.com>,
Or Gerlitz <ogerlitz@mellanox.com>
Subject: [PATCH net-next V1 15/18] net/mlx5: E-Switch, Introduce HCA cap and E-Switch vport context
Date: Sun, 29 Nov 2015 17:37:23 +0200 [thread overview]
Message-ID: <1448811446-18598-16-git-send-email-ogerlitz@mellanox.com> (raw)
In-Reply-To: <1448811446-18598-1-git-send-email-ogerlitz@mellanox.com>
From: Saeed Mahameed <saeedm@mellanox.com>
E-Switch vport context is unlike NIC vport context, managed by the
E-Switch manager or vport_group_manager and not by the NIC(VF) driver.
The E-Switch manager can access (read/modify) any of its vports
E-Switch context.
Currently E-Switch vport context includes only clietnt and server
vlan insertion and striping data (for later support of VST mode).
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/fw.c | 11 ++++
include/linux/mlx5/device.h | 9 +++
include/linux/mlx5/mlx5_ifc.h | 90 ++++++++++++++++++++++++++++
3 files changed, 110 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
index bf6e3df..1c9f9a5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
@@ -173,6 +173,17 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
return err;
}
+ if (MLX5_CAP_GEN(dev, vport_group_manager)) {
+ err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH,
+ HCA_CAP_OPMOD_GET_CUR);
+ if (err)
+ return err;
+ err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH,
+ HCA_CAP_OPMOD_GET_MAX);
+ if (err)
+ return err;
+ }
+
return 0;
}
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 88eb449..7d3a85f 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1145,6 +1145,7 @@ enum mlx5_cap_type {
MLX5_CAP_EOIB_OFFLOADS,
MLX5_CAP_FLOW_TABLE,
MLX5_CAP_ESWITCH_FLOW_TABLE,
+ MLX5_CAP_ESWITCH,
/* NUM OF CAP Types */
MLX5_CAP_NUM
};
@@ -1196,6 +1197,14 @@ enum mlx5_cap_type {
#define MLX5_CAP_ESW_FLOWTABLE_FDB_MAX(mdev, cap) \
MLX5_CAP_ESW_FLOWTABLE_MAX(mdev, flow_table_properties_nic_esw_fdb.cap)
+#define MLX5_CAP_ESW(mdev, cap) \
+ MLX5_GET(e_switch_cap, \
+ mdev->hca_caps_cur[MLX5_CAP_ESWITCH], cap)
+
+#define MLX5_CAP_ESW_MAX(mdev, cap) \
+ MLX5_GET(e_switch_cap, \
+ mdev->hca_caps_max[MLX5_CAP_ESWITCH], cap)
+
#define MLX5_CAP_ODP(mdev, cap)\
MLX5_GET(odp_cap, mdev->hca_caps_cur[MLX5_CAP_ODP], cap)
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index a81b008..f5d9449 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -459,6 +459,17 @@ struct mlx5_ifc_flow_table_eswitch_cap_bits {
u8 reserved_1[0x7800];
};
+struct mlx5_ifc_e_switch_cap_bits {
+ u8 vport_svlan_strip[0x1];
+ u8 vport_cvlan_strip[0x1];
+ u8 vport_svlan_insert[0x1];
+ u8 vport_cvlan_insert_if_not_exist[0x1];
+ u8 vport_cvlan_insert_overwrite[0x1];
+ u8 reserved_0[0x1b];
+
+ u8 reserved_1[0x7e0];
+};
+
struct mlx5_ifc_per_protocol_networking_offload_caps_bits {
u8 csum_cap[0x1];
u8 vlan_cap[0x1];
@@ -1860,6 +1871,7 @@ union mlx5_ifc_hca_cap_union_bits {
struct mlx5_ifc_per_protocol_networking_offload_caps_bits per_protocol_networking_offload_caps;
struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap;
struct mlx5_ifc_flow_table_eswitch_cap_bits flow_table_eswitch_cap;
+ struct mlx5_ifc_e_switch_cap_bits e_switch_cap;
u8 reserved_0[0x8000];
};
@@ -2305,6 +2317,26 @@ struct mlx5_ifc_hca_vport_context_bits {
u8 reserved_6[0xca0];
};
+struct mlx5_ifc_esw_vport_context_bits {
+ u8 reserved_0[0x3];
+ u8 vport_svlan_strip[0x1];
+ u8 vport_cvlan_strip[0x1];
+ u8 vport_svlan_insert[0x1];
+ u8 vport_cvlan_insert[0x2];
+ u8 reserved_1[0x18];
+
+ u8 reserved_2[0x20];
+
+ u8 svlan_cfi[0x1];
+ u8 svlan_pcp[0x3];
+ u8 svlan_id[0xc];
+ u8 cvlan_cfi[0x1];
+ u8 cvlan_pcp[0x3];
+ u8 cvlan_id[0xc];
+
+ u8 reserved_3[0x7a0];
+};
+
enum {
MLX5_EQC_STATUS_OK = 0x0,
MLX5_EQC_STATUS_EQ_WRITE_FAILURE = 0xa,
@@ -3743,6 +3775,64 @@ struct mlx5_ifc_query_flow_group_in_bits {
u8 reserved_5[0x120];
};
+struct mlx5_ifc_query_esw_vport_context_out_bits {
+ u8 status[0x8];
+ u8 reserved_0[0x18];
+
+ u8 syndrome[0x20];
+
+ u8 reserved_1[0x40];
+
+ struct mlx5_ifc_esw_vport_context_bits esw_vport_context;
+};
+
+struct mlx5_ifc_query_esw_vport_context_in_bits {
+ u8 opcode[0x10];
+ u8 reserved_0[0x10];
+
+ u8 reserved_1[0x10];
+ u8 op_mod[0x10];
+
+ u8 other_vport[0x1];
+ u8 reserved_2[0xf];
+ u8 vport_number[0x10];
+
+ u8 reserved_3[0x20];
+};
+
+struct mlx5_ifc_modify_esw_vport_context_out_bits {
+ u8 status[0x8];
+ u8 reserved_0[0x18];
+
+ u8 syndrome[0x20];
+
+ u8 reserved_1[0x40];
+};
+
+struct mlx5_ifc_esw_vport_context_fields_select_bits {
+ u8 reserved[0x1c];
+ u8 vport_cvlan_insert[0x1];
+ u8 vport_svlan_insert[0x1];
+ u8 vport_cvlan_strip[0x1];
+ u8 vport_svlan_strip[0x1];
+};
+
+struct mlx5_ifc_modify_esw_vport_context_in_bits {
+ u8 opcode[0x10];
+ u8 reserved_0[0x10];
+
+ u8 reserved_1[0x10];
+ u8 op_mod[0x10];
+
+ u8 other_vport[0x1];
+ u8 reserved_2[0xf];
+ u8 vport_number[0x10];
+
+ struct mlx5_ifc_esw_vport_context_fields_select_bits field_select;
+
+ struct mlx5_ifc_esw_vport_context_bits esw_vport_context;
+};
+
struct mlx5_ifc_query_eq_out_bits {
u8 status[0x8];
u8 reserved_0[0x18];
--
2.3.7
next prev parent reply other threads:[~2015-11-29 15:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-29 15:37 [PATCH net-next V1 00/18] Introducing ConnectX-4 Ethernet SRIOV Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 01/18] net/mlx5_core: Modify enable/disable hca functions Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 02/18] net/mlx5_core: Add base sriov support Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 03/18] net/mlx5: Add HW capabilities and structs for SR-IOV E-Switch Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 04/18] net/mlx5: Update access functions to Query/Modify vport MAC address Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 05/18] net/mlx5: Introduce access functions to modify/query vport mac lists Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 06/18] net/mlx5: Introduce access functions to modify/query vport state Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 07/18] net/mlx5: Introduce access functions to modify/query vport promisc mode Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 08/18] net/mlx5: Introduce access functions to modify/query vport vlans Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 09/18] net/mlx5e: Write UC/MC list and promisc mode into vport context Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 10/18] net/mlx5e: Write vlan list " Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 11/18] net/mlx5: Introducing E-Switch and l2 table Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 12/18] net/mlx5: E-Switch, Introduce FDB hardware capabilities Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 13/18] net/mlx5: E-Switch, Add SR-IOV (FDB) support Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 14/18] net/mlx5: E-Switch, Introduce Vport administration functions Or Gerlitz
2015-11-29 15:37 ` Or Gerlitz [this message]
2015-11-29 15:37 ` [PATCH net-next V1 16/18] net/mlx5: E-Switch, Introduce set vport vlan (VST mode) Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 17/18] net/mlx5: E-Switch, Introduce get vf statistics Or Gerlitz
2015-11-29 15:37 ` [PATCH net-next V1 18/18] net/mlx5e: Add support for SR-IOV ndos Or Gerlitz
2015-11-29 16:35 ` kbuild test robot
2015-11-29 16:35 ` [PATCH] net/mlx5e: fix semicolon.cocci warnings kbuild test robot
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=1448811446-18598-16-git-send-email-ogerlitz@mellanox.com \
--to=ogerlitz@mellanox.com \
--cc=davem@davemloft.net \
--cc=ddutile@redhat.com \
--cc=dledford@redhat.com \
--cc=hadarh@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ronye@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=talal@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