aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mlx5/driver.h')
-rw-r--r--include/linux/mlx5/driver.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index a0610427e168..6ed79a8a8318 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -155,6 +155,13 @@ enum mlx5_dcbx_oper_mode {
155 MLX5E_DCBX_PARAM_VER_OPER_AUTO = 0x3, 155 MLX5E_DCBX_PARAM_VER_OPER_AUTO = 0x3,
156}; 156};
157 157
158enum mlx5_dct_atomic_mode {
159 MLX5_ATOMIC_MODE_DCT_OFF = 20,
160 MLX5_ATOMIC_MODE_DCT_NONE = 0 << MLX5_ATOMIC_MODE_DCT_OFF,
161 MLX5_ATOMIC_MODE_DCT_IB_COMP = 1 << MLX5_ATOMIC_MODE_DCT_OFF,
162 MLX5_ATOMIC_MODE_DCT_CX = 2 << MLX5_ATOMIC_MODE_DCT_OFF,
163};
164
158enum { 165enum {
159 MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0, 166 MLX5_ATOMIC_OPS_CMP_SWAP = 1 << 0,
160 MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1, 167 MLX5_ATOMIC_OPS_FETCH_ADD = 1 << 1,
@@ -231,6 +238,9 @@ struct mlx5_bfreg_info {
231 u32 ver; 238 u32 ver;
232 bool lib_uar_4k; 239 bool lib_uar_4k;
233 u32 num_sys_pages; 240 u32 num_sys_pages;
241 u32 num_static_sys_pages;
242 u32 total_num_bfregs;
243 u32 num_dyn_bfregs;
234}; 244};
235 245
236struct mlx5_cmd_first { 246struct mlx5_cmd_first {
@@ -430,6 +440,7 @@ enum mlx5_res_type {
430 MLX5_RES_SRQ = 3, 440 MLX5_RES_SRQ = 3,
431 MLX5_RES_XSRQ = 4, 441 MLX5_RES_XSRQ = 4,
432 MLX5_RES_XRQ = 5, 442 MLX5_RES_XRQ = 5,
443 MLX5_RES_DCT = MLX5_EVENT_QUEUE_TYPE_DCT,
433}; 444};
434 445
435struct mlx5_core_rsc_common { 446struct mlx5_core_rsc_common {
@@ -788,6 +799,7 @@ struct mlx5_clock {
788 u32 nominal_c_mult; 799 u32 nominal_c_mult;
789 unsigned long overflow_period; 800 unsigned long overflow_period;
790 struct delayed_work overflow_work; 801 struct delayed_work overflow_work;
802 struct mlx5_core_dev *mdev;
791 struct ptp_clock *ptp; 803 struct ptp_clock *ptp;
792 struct ptp_clock_info ptp_info; 804 struct ptp_clock_info ptp_info;
793 struct mlx5_pps pps_info; 805 struct mlx5_pps pps_info;
@@ -826,7 +838,7 @@ struct mlx5_core_dev {
826 struct mlx5e_resources mlx5e_res; 838 struct mlx5e_resources mlx5e_res;
827 struct { 839 struct {
828 struct mlx5_rsvd_gids reserved_gids; 840 struct mlx5_rsvd_gids reserved_gids;
829 atomic_t roce_en; 841 u32 roce_en;
830 } roce; 842 } roce;
831#ifdef CONFIG_MLX5_FPGA 843#ifdef CONFIG_MLX5_FPGA
832 struct mlx5_fpga_device *fpga; 844 struct mlx5_fpga_device *fpga;
@@ -835,6 +847,8 @@ struct mlx5_core_dev {
835 struct cpu_rmap *rmap; 847 struct cpu_rmap *rmap;
836#endif 848#endif
837 struct mlx5_clock clock; 849 struct mlx5_clock clock;
850 struct mlx5_ib_clock_info *clock_info;
851 struct page *clock_info_page;
838}; 852};
839 853
840struct mlx5_db { 854struct mlx5_db {
@@ -1103,7 +1117,7 @@ void mlx5_free_bfreg(struct mlx5_core_dev *mdev, struct mlx5_sq_bfreg *bfreg);
1103unsigned int mlx5_core_reserved_gids_count(struct mlx5_core_dev *dev); 1117unsigned int mlx5_core_reserved_gids_count(struct mlx5_core_dev *dev);
1104int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index, 1118int mlx5_core_roce_gid_set(struct mlx5_core_dev *dev, unsigned int index,
1105 u8 roce_version, u8 roce_l3_type, const u8 *gid, 1119 u8 roce_version, u8 roce_l3_type, const u8 *gid,
1106 const u8 *mac, bool vlan, u16 vlan_id); 1120 const u8 *mac, bool vlan, u16 vlan_id, u8 port_num);
1107 1121
1108static inline int fw_initializing(struct mlx5_core_dev *dev) 1122static inline int fw_initializing(struct mlx5_core_dev *dev)
1109{ 1123{
@@ -1225,6 +1239,31 @@ static inline bool mlx5_rl_is_supported(struct mlx5_core_dev *dev)
1225 return !!(dev->priv.rl_table.max_size); 1239 return !!(dev->priv.rl_table.max_size);
1226} 1240}
1227 1241
1242static inline int mlx5_core_is_mp_slave(struct mlx5_core_dev *dev)
1243{
1244 return MLX5_CAP_GEN(dev, affiliate_nic_vport_criteria) &&
1245 MLX5_CAP_GEN(dev, num_vhca_ports) <= 1;
1246}
1247
1248static inline int mlx5_core_is_mp_master(struct mlx5_core_dev *dev)
1249{
1250 return MLX5_CAP_GEN(dev, num_vhca_ports) > 1;
1251}
1252
1253static inline int mlx5_core_mp_enabled(struct mlx5_core_dev *dev)
1254{
1255 return mlx5_core_is_mp_slave(dev) ||
1256 mlx5_core_is_mp_master(dev);
1257}
1258
1259static inline int mlx5_core_native_port_num(struct mlx5_core_dev *dev)
1260{
1261 if (!mlx5_core_mp_enabled(dev))
1262 return 1;
1263
1264 return MLX5_CAP_GEN(dev, native_port_num);
1265}
1266
1228enum { 1267enum {
1229 MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32, 1268 MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32,
1230}; 1269};
@@ -1238,7 +1277,7 @@ mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector)
1238 int eqn; 1277 int eqn;
1239 int err; 1278 int err;
1240 1279
1241 err = mlx5_vector2eqn(dev, vector, &eqn, &irq); 1280 err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq);
1242 if (err) 1281 if (err)
1243 return NULL; 1282 return NULL;
1244 1283