aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-24 15:10:23 -0400
committerJason Gunthorpe <jgg@mellanox.com>2018-07-24 15:10:23 -0400
commiteda98779f7d318cf96f030bbc5b23f034b69b80a (patch)
tree4cdd7241346aca73482009b62c88a0b3cb014922 /include/linux/mlx5
parent4fca037783512cedfb23a116c66727ce40c8558a (diff)
parent664000b6bb4352295dc774108a1fc87c4a1ad0e3 (diff)
Merge branch 'mellanox/mlx5-next' into rdma.git for-next
From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux.git This is required to resolve dependencies of the next series of RDMA patches. * branch 'mellanox/mlx5-next': net/mlx5: Add support for flow table destination number net/mlx5: Add forward compatible support for the FTE match data net/mlx5: Fix tristate and description for MLX5 module net/mlx5: Better return types for CQE API net/mlx5: Use ERR_CAST() instead of coding it net/mlx5: Add missing SET_DRIVER_VERSION command translation net/mlx5: Add XRQ commands definitions net/mlx5: Add core support for double vlan push/pop steering action net/mlx5: Expose MPEGC (Management PCIe General Configuration) structures net/mlx5: FW tracer, add hardware structures net/mlx5: fix uaccess beyond "count" in debugfs read/write handlers Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r--include/linux/mlx5/device.h8
-rw-r--r--include/linux/mlx5/driver.h5
-rw-r--r--include/linux/mlx5/fs.h5
-rw-r--r--include/linux/mlx5/mlx5_ifc.h94
4 files changed, 103 insertions, 9 deletions
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index f8671c0a43aa..0566c6a94805 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -750,7 +750,7 @@ enum {
750 750
751#define MLX5_MINI_CQE_ARRAY_SIZE 8 751#define MLX5_MINI_CQE_ARRAY_SIZE 8
752 752
753static inline int mlx5_get_cqe_format(struct mlx5_cqe64 *cqe) 753static inline u8 mlx5_get_cqe_format(struct mlx5_cqe64 *cqe)
754{ 754{
755 return (cqe->op_own >> 2) & 0x3; 755 return (cqe->op_own >> 2) & 0x3;
756} 756}
@@ -770,14 +770,14 @@ static inline u8 get_cqe_l3_hdr_type(struct mlx5_cqe64 *cqe)
770 return (cqe->l4_l3_hdr_type >> 2) & 0x3; 770 return (cqe->l4_l3_hdr_type >> 2) & 0x3;
771} 771}
772 772
773static inline u8 cqe_is_tunneled(struct mlx5_cqe64 *cqe) 773static inline bool cqe_is_tunneled(struct mlx5_cqe64 *cqe)
774{ 774{
775 return cqe->outer_l3_tunneled & 0x1; 775 return cqe->outer_l3_tunneled & 0x1;
776} 776}
777 777
778static inline int cqe_has_vlan(struct mlx5_cqe64 *cqe) 778static inline bool cqe_has_vlan(struct mlx5_cqe64 *cqe)
779{ 779{
780 return !!(cqe->l4_l3_hdr_type & 0x1); 780 return cqe->l4_l3_hdr_type & 0x1;
781} 781}
782 782
783static inline u64 get_cqe_ts(struct mlx5_cqe64 *cqe) 783static inline u64 get_cqe_ts(struct mlx5_cqe64 *cqe)
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 1cb1c0317b77..957199c20a0f 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -138,9 +138,14 @@ enum {
138 MLX5_REG_HOST_ENDIANNESS = 0x7004, 138 MLX5_REG_HOST_ENDIANNESS = 0x7004,
139 MLX5_REG_MCIA = 0x9014, 139 MLX5_REG_MCIA = 0x9014,
140 MLX5_REG_MLCR = 0x902b, 140 MLX5_REG_MLCR = 0x902b,
141 MLX5_REG_MTRC_CAP = 0x9040,
142 MLX5_REG_MTRC_CONF = 0x9041,
143 MLX5_REG_MTRC_STDB = 0x9042,
144 MLX5_REG_MTRC_CTRL = 0x9043,
141 MLX5_REG_MPCNT = 0x9051, 145 MLX5_REG_MPCNT = 0x9051,
142 MLX5_REG_MTPPS = 0x9053, 146 MLX5_REG_MTPPS = 0x9053,
143 MLX5_REG_MTPPSE = 0x9054, 147 MLX5_REG_MTPPSE = 0x9054,
148 MLX5_REG_MPEGC = 0x9056,
144 MLX5_REG_MCQI = 0x9061, 149 MLX5_REG_MCQI = 0x9061,
145 MLX5_REG_MCC = 0x9062, 150 MLX5_REG_MCC = 0x9062,
146 MLX5_REG_MCDA = 0x9063, 151 MLX5_REG_MCDA = 0x9063,
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index 757b4a30281e..af0592400499 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -89,6 +89,7 @@ struct mlx5_flow_destination {
89 enum mlx5_flow_destination_type type; 89 enum mlx5_flow_destination_type type;
90 union { 90 union {
91 u32 tir_num; 91 u32 tir_num;
92 u32 ft_num;
92 struct mlx5_flow_table *ft; 93 struct mlx5_flow_table *ft;
93 struct mlx5_fc *counter; 94 struct mlx5_fc *counter;
94 struct { 95 struct {
@@ -152,6 +153,8 @@ struct mlx5_fs_vlan {
152 u8 prio; 153 u8 prio;
153}; 154};
154 155
156#define MLX5_FS_VLAN_DEPTH 2
157
155struct mlx5_flow_act { 158struct mlx5_flow_act {
156 u32 action; 159 u32 action;
157 bool has_flow_tag; 160 bool has_flow_tag;
@@ -159,7 +162,7 @@ struct mlx5_flow_act {
159 u32 encap_id; 162 u32 encap_id;
160 u32 modify_id; 163 u32 modify_id;
161 uintptr_t esp_id; 164 uintptr_t esp_id;
162 struct mlx5_fs_vlan vlan; 165 struct mlx5_fs_vlan vlan[MLX5_FS_VLAN_DEPTH];
163 struct ib_counters *counters; 166 struct ib_counters *counters;
164}; 167};
165 168
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 44a6ce01c3bb..5e04e2053fd7 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -341,7 +341,10 @@ struct mlx5_ifc_flow_table_prop_layout_bits {
341 u8 reserved_at_9[0x1]; 341 u8 reserved_at_9[0x1];
342 u8 pop_vlan[0x1]; 342 u8 pop_vlan[0x1];
343 u8 push_vlan[0x1]; 343 u8 push_vlan[0x1];
344 u8 reserved_at_c[0x14]; 344 u8 reserved_at_c[0x1];
345 u8 pop_vlan_2[0x1];
346 u8 push_vlan_2[0x1];
347 u8 reserved_at_f[0x11];
345 348
346 u8 reserved_at_20[0x2]; 349 u8 reserved_at_20[0x2];
347 u8 log_max_ft_size[0x6]; 350 u8 log_max_ft_size[0x6];
@@ -1181,6 +1184,7 @@ enum mlx5_flow_destination_type {
1181 1184
1182 MLX5_FLOW_DESTINATION_TYPE_PORT = 0x99, 1185 MLX5_FLOW_DESTINATION_TYPE_PORT = 0x99,
1183 MLX5_FLOW_DESTINATION_TYPE_COUNTER = 0x100, 1186 MLX5_FLOW_DESTINATION_TYPE_COUNTER = 0x100,
1187 MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE_NUM = 0x101,
1184}; 1188};
1185 1189
1186struct mlx5_ifc_dest_format_struct_bits { 1190struct mlx5_ifc_dest_format_struct_bits {
@@ -2390,6 +2394,8 @@ enum {
2390 MLX5_FLOW_CONTEXT_ACTION_MOD_HDR = 0x40, 2394 MLX5_FLOW_CONTEXT_ACTION_MOD_HDR = 0x40,
2391 MLX5_FLOW_CONTEXT_ACTION_VLAN_POP = 0x80, 2395 MLX5_FLOW_CONTEXT_ACTION_VLAN_POP = 0x80,
2392 MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH = 0x100, 2396 MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH = 0x100,
2397 MLX5_FLOW_CONTEXT_ACTION_VLAN_POP_2 = 0x400,
2398 MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH_2 = 0x800,
2393}; 2399};
2394 2400
2395struct mlx5_ifc_vlan_bits { 2401struct mlx5_ifc_vlan_bits {
@@ -2420,7 +2426,9 @@ struct mlx5_ifc_flow_context_bits {
2420 2426
2421 u8 modify_header_id[0x20]; 2427 u8 modify_header_id[0x20];
2422 2428
2423 u8 reserved_at_100[0x100]; 2429 struct mlx5_ifc_vlan_bits push_vlan_2;
2430
2431 u8 reserved_at_120[0xe0];
2424 2432
2425 struct mlx5_ifc_fte_match_param_bits match_value; 2433 struct mlx5_ifc_fte_match_param_bits match_value;
2426 2434
@@ -8053,6 +8061,19 @@ struct mlx5_ifc_peir_reg_bits {
8053 u8 error_type[0x8]; 8061 u8 error_type[0x8];
8054}; 8062};
8055 8063
8064struct mlx5_ifc_mpegc_reg_bits {
8065 u8 reserved_at_0[0x30];
8066 u8 field_select[0x10];
8067
8068 u8 tx_overflow_sense[0x1];
8069 u8 mark_cqe[0x1];
8070 u8 mark_cnp[0x1];
8071 u8 reserved_at_43[0x1b];
8072 u8 tx_lossy_overflow_oper[0x2];
8073
8074 u8 reserved_at_60[0x100];
8075};
8076
8056struct mlx5_ifc_pcam_enhanced_features_bits { 8077struct mlx5_ifc_pcam_enhanced_features_bits {
8057 u8 reserved_at_0[0x6d]; 8078 u8 reserved_at_0[0x6d];
8058 u8 rx_icrc_encapsulated_counter[0x1]; 8079 u8 rx_icrc_encapsulated_counter[0x1];
@@ -8101,7 +8122,11 @@ struct mlx5_ifc_pcam_reg_bits {
8101}; 8122};
8102 8123
8103struct mlx5_ifc_mcam_enhanced_features_bits { 8124struct mlx5_ifc_mcam_enhanced_features_bits {
8104 u8 reserved_at_0[0x7b]; 8125 u8 reserved_at_0[0x74];
8126 u8 mark_tx_action_cnp[0x1];
8127 u8 mark_tx_action_cqe[0x1];
8128 u8 dynamic_tx_overflow[0x1];
8129 u8 reserved_at_77[0x4];
8105 u8 pcie_outbound_stalled[0x1]; 8130 u8 pcie_outbound_stalled[0x1];
8106 u8 tx_overflow_buffer_pkt[0x1]; 8131 u8 tx_overflow_buffer_pkt[0x1];
8107 u8 mtpps_enh_out_per_adj[0x1]; 8132 u8 mtpps_enh_out_per_adj[0x1];
@@ -8116,7 +8141,11 @@ struct mlx5_ifc_mcam_access_reg_bits {
8116 u8 mcqi[0x1]; 8141 u8 mcqi[0x1];
8117 u8 reserved_at_1f[0x1]; 8142 u8 reserved_at_1f[0x1];
8118 8143
8119 u8 regs_95_to_64[0x20]; 8144 u8 regs_95_to_87[0x9];
8145 u8 mpegc[0x1];
8146 u8 regs_85_to_68[0x12];
8147 u8 tracer_registers[0x4];
8148
8120 u8 regs_63_to_32[0x20]; 8149 u8 regs_63_to_32[0x20];
8121 u8 regs_31_to_0[0x20]; 8150 u8 regs_31_to_0[0x20];
8122}; 8151};
@@ -9191,4 +9220,61 @@ struct mlx5_ifc_create_uctx_in_bits {
9191 struct mlx5_ifc_uctx_bits uctx; 9220 struct mlx5_ifc_uctx_bits uctx;
9192}; 9221};
9193 9222
9223struct mlx5_ifc_mtrc_string_db_param_bits {
9224 u8 string_db_base_address[0x20];
9225
9226 u8 reserved_at_20[0x8];
9227 u8 string_db_size[0x18];
9228};
9229
9230struct mlx5_ifc_mtrc_cap_bits {
9231 u8 trace_owner[0x1];
9232 u8 trace_to_memory[0x1];
9233 u8 reserved_at_2[0x4];
9234 u8 trc_ver[0x2];
9235 u8 reserved_at_8[0x14];
9236 u8 num_string_db[0x4];
9237
9238 u8 first_string_trace[0x8];
9239 u8 num_string_trace[0x8];
9240 u8 reserved_at_30[0x28];
9241
9242 u8 log_max_trace_buffer_size[0x8];
9243
9244 u8 reserved_at_60[0x20];
9245
9246 struct mlx5_ifc_mtrc_string_db_param_bits string_db_param[8];
9247
9248 u8 reserved_at_280[0x180];
9249};
9250
9251struct mlx5_ifc_mtrc_conf_bits {
9252 u8 reserved_at_0[0x1c];
9253 u8 trace_mode[0x4];
9254 u8 reserved_at_20[0x18];
9255 u8 log_trace_buffer_size[0x8];
9256 u8 trace_mkey[0x20];
9257 u8 reserved_at_60[0x3a0];
9258};
9259
9260struct mlx5_ifc_mtrc_stdb_bits {
9261 u8 string_db_index[0x4];
9262 u8 reserved_at_4[0x4];
9263 u8 read_size[0x18];
9264 u8 start_offset[0x20];
9265 u8 string_db_data[0];
9266};
9267
9268struct mlx5_ifc_mtrc_ctrl_bits {
9269 u8 trace_status[0x2];
9270 u8 reserved_at_2[0x2];
9271 u8 arm_event[0x1];
9272 u8 reserved_at_5[0xb];
9273 u8 modify_field_select[0x10];
9274 u8 reserved_at_20[0x2b];
9275 u8 current_timestamp52_32[0x15];
9276 u8 current_timestamp31_0[0x20];
9277 u8 reserved_at_80[0x180];
9278};
9279
9194#endif /* MLX5_IFC_H */ 9280#endif /* MLX5_IFC_H */