aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r--include/linux/mlx4/cmd.h31
-rw-r--r--include/linux/mlx4/device.h127
-rw-r--r--include/linux/mlx4/qp.h4
3 files changed, 155 insertions, 7 deletions
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 379c02648ab3..64d25941b329 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -67,6 +67,8 @@ enum {
67 MLX4_CMD_MAP_ICM_AUX = 0xffc, 67 MLX4_CMD_MAP_ICM_AUX = 0xffc,
68 MLX4_CMD_UNMAP_ICM_AUX = 0xffb, 68 MLX4_CMD_UNMAP_ICM_AUX = 0xffb,
69 MLX4_CMD_SET_ICM_SIZE = 0xffd, 69 MLX4_CMD_SET_ICM_SIZE = 0xffd,
70 MLX4_CMD_ACCESS_REG = 0x3b,
71
70 /*master notify fw on finish for slave's flr*/ 72 /*master notify fw on finish for slave's flr*/
71 MLX4_CMD_INFORM_FLR_DONE = 0x5b, 73 MLX4_CMD_INFORM_FLR_DONE = 0x5b,
72 MLX4_CMD_GET_OP_REQ = 0x59, 74 MLX4_CMD_GET_OP_REQ = 0x59,
@@ -197,6 +199,33 @@ enum {
197 MLX4_CMD_NATIVE 199 MLX4_CMD_NATIVE
198}; 200};
199 201
202/*
203 * MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP -
204 * Receive checksum value is reported in CQE also for non TCP/UDP packets.
205 *
206 * MLX4_RX_CSUM_MODE_L4 -
207 * L4_CSUM bit in CQE, which indicates whether or not L4 checksum
208 * was validated correctly, is supported.
209 *
210 * MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP -
211 * IP_OK CQE's field is supported also for non TCP/UDP IP packets.
212 *
213 * MLX4_RX_CSUM_MODE_MULTI_VLAN -
214 * Receive Checksum offload is supported for packets with more than 2 vlan headers.
215 */
216enum mlx4_rx_csum_mode {
217 MLX4_RX_CSUM_MODE_VAL_NON_TCP_UDP = 1UL << 0,
218 MLX4_RX_CSUM_MODE_L4 = 1UL << 1,
219 MLX4_RX_CSUM_MODE_IP_OK_IP_NON_TCP_UDP = 1UL << 2,
220 MLX4_RX_CSUM_MODE_MULTI_VLAN = 1UL << 3
221};
222
223struct mlx4_config_dev_params {
224 u16 vxlan_udp_dport;
225 u8 rx_csum_flags_port_1;
226 u8 rx_csum_flags_port_2;
227};
228
200struct mlx4_dev; 229struct mlx4_dev;
201 230
202struct mlx4_cmd_mailbox { 231struct mlx4_cmd_mailbox {
@@ -248,6 +277,8 @@ int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos);
248int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); 277int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting);
249int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf); 278int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf);
250int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state); 279int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state);
280int mlx4_config_dev_retrieval(struct mlx4_dev *dev,
281 struct mlx4_config_dev_params *params);
251/* 282/*
252 * mlx4_get_slave_default_vlan - 283 * mlx4_get_slave_default_vlan -
253 * return true if VST ( default vlan) 284 * return true if VST ( default vlan)
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 37e4404d0227..25c791e295fd 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -95,7 +95,7 @@ enum {
95 95
96enum { 96enum {
97 MLX4_MAX_NUM_PF = 16, 97 MLX4_MAX_NUM_PF = 16,
98 MLX4_MAX_NUM_VF = 64, 98 MLX4_MAX_NUM_VF = 126,
99 MLX4_MAX_NUM_VF_P_PORT = 64, 99 MLX4_MAX_NUM_VF_P_PORT = 64,
100 MLX4_MFUNC_MAX = 80, 100 MLX4_MFUNC_MAX = 80,
101 MLX4_MAX_EQ_NUM = 1024, 101 MLX4_MAX_EQ_NUM = 1024,
@@ -117,6 +117,14 @@ enum {
117 MLX4_STEERING_MODE_DEVICE_MANAGED 117 MLX4_STEERING_MODE_DEVICE_MANAGED
118}; 118};
119 119
120enum {
121 MLX4_STEERING_DMFS_A0_DEFAULT,
122 MLX4_STEERING_DMFS_A0_DYNAMIC,
123 MLX4_STEERING_DMFS_A0_STATIC,
124 MLX4_STEERING_DMFS_A0_DISABLE,
125 MLX4_STEERING_DMFS_A0_NOT_SUPPORTED
126};
127
120static inline const char *mlx4_steering_mode_str(int steering_mode) 128static inline const char *mlx4_steering_mode_str(int steering_mode)
121{ 129{
122 switch (steering_mode) { 130 switch (steering_mode) {
@@ -186,7 +194,31 @@ enum {
186 MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10, 194 MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10,
187 MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11, 195 MLX4_DEV_CAP_FLAG2_MAD_DEMUX = 1LL << 11,
188 MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12, 196 MLX4_DEV_CAP_FLAG2_CQE_STRIDE = 1LL << 12,
189 MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13 197 MLX4_DEV_CAP_FLAG2_EQE_STRIDE = 1LL << 13,
198 MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL = 1LL << 14,
199 MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP = 1LL << 15,
200 MLX4_DEV_CAP_FLAG2_CONFIG_DEV = 1LL << 16,
201 MLX4_DEV_CAP_FLAG2_SYS_EQS = 1LL << 17,
202 MLX4_DEV_CAP_FLAG2_80_VFS = 1LL << 18,
203 MLX4_DEV_CAP_FLAG2_FS_A0 = 1LL << 19
204};
205
206enum {
207 MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0,
208 MLX4_QUERY_FUNC_FLAGS_A0_RES_QP = 1LL << 1
209};
210
211/* bit enums for an 8-bit flags field indicating special use
212 * QPs which require special handling in qp_reserve_range.
213 * Currently, this only includes QPs used by the ETH interface,
214 * where we expect to use blueflame. These QPs must not have
215 * bits 6 and 7 set in their qp number.
216 *
217 * This enum may use only bits 0..7.
218 */
219enum {
220 MLX4_RESERVE_A0_QP = 1 << 6,
221 MLX4_RESERVE_ETH_BF_QP = 1 << 7,
190}; 222};
191 223
192enum { 224enum {
@@ -202,7 +234,8 @@ enum {
202 234
203enum { 235enum {
204 MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0, 236 MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0,
205 MLX4_FUNC_CAP_EQE_CQE_STRIDE = 1L << 1 237 MLX4_FUNC_CAP_EQE_CQE_STRIDE = 1L << 1,
238 MLX4_FUNC_CAP_DMFS_A0_STATIC = 1L << 2
206}; 239};
207 240
208 241
@@ -328,6 +361,8 @@ enum {
328 361
329enum mlx4_qp_region { 362enum mlx4_qp_region {
330 MLX4_QP_REGION_FW = 0, 363 MLX4_QP_REGION_FW = 0,
364 MLX4_QP_REGION_RSS_RAW_ETH,
365 MLX4_QP_REGION_BOTTOM = MLX4_QP_REGION_RSS_RAW_ETH,
331 MLX4_QP_REGION_ETH_ADDR, 366 MLX4_QP_REGION_ETH_ADDR,
332 MLX4_QP_REGION_FC_ADDR, 367 MLX4_QP_REGION_FC_ADDR,
333 MLX4_QP_REGION_FC_EXCH, 368 MLX4_QP_REGION_FC_EXCH,
@@ -379,6 +414,13 @@ enum {
379#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \ 414#define MSTR_SM_CHANGE_MASK (MLX4_EQ_PORT_INFO_MSTR_SM_SL_CHANGE_MASK | \
380 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK) 415 MLX4_EQ_PORT_INFO_MSTR_SM_LID_CHANGE_MASK)
381 416
417enum mlx4_module_id {
418 MLX4_MODULE_ID_SFP = 0x3,
419 MLX4_MODULE_ID_QSFP = 0xC,
420 MLX4_MODULE_ID_QSFP_PLUS = 0xD,
421 MLX4_MODULE_ID_QSFP28 = 0x11,
422};
423
382static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 424static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
383{ 425{
384 return (major << 32) | (minor << 16) | subminor; 426 return (major << 32) | (minor << 16) | subminor;
@@ -433,6 +475,7 @@ struct mlx4_caps {
433 int num_cqs; 475 int num_cqs;
434 int max_cqes; 476 int max_cqes;
435 int reserved_cqs; 477 int reserved_cqs;
478 int num_sys_eqs;
436 int num_eqs; 479 int num_eqs;
437 int reserved_eqs; 480 int reserved_eqs;
438 int num_comp_vectors; 481 int num_comp_vectors;
@@ -449,6 +492,7 @@ struct mlx4_caps {
449 int reserved_mcgs; 492 int reserved_mcgs;
450 int num_qp_per_mgm; 493 int num_qp_per_mgm;
451 int steering_mode; 494 int steering_mode;
495 int dmfs_high_steer_mode;
452 int fs_log_max_ucast_qp_range_size; 496 int fs_log_max_ucast_qp_range_size;
453 int num_pds; 497 int num_pds;
454 int reserved_pds; 498 int reserved_pds;
@@ -487,6 +531,10 @@ struct mlx4_caps {
487 u16 hca_core_clock; 531 u16 hca_core_clock;
488 u64 phys_port_id[MLX4_MAX_PORTS + 1]; 532 u64 phys_port_id[MLX4_MAX_PORTS + 1];
489 int tunnel_offload_mode; 533 int tunnel_offload_mode;
534 u8 rx_checksum_flags_port[MLX4_MAX_PORTS + 1];
535 u8 alloc_res_qp_mask;
536 u32 dmfs_high_rate_qpn_base;
537 u32 dmfs_high_rate_qpn_range;
490}; 538};
491 539
492struct mlx4_buf_list { 540struct mlx4_buf_list {
@@ -607,6 +655,11 @@ struct mlx4_cq {
607 655
608 atomic_t refcount; 656 atomic_t refcount;
609 struct completion free; 657 s