Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/mlx5_core: use set/get macros in device caps

Transform device capabilities related commands to use set/get macros to
manipulate command mailboxes.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eli Cohen and committed by
David S. Miller
b775516b d29b796a

+297 -167
+17
drivers/net/ethernet/mellanox/mlx5/core/cmd.c
··· 1537 1537 1538 1538 return cmd_status_to_err(hdr->status); 1539 1539 } 1540 + 1541 + int mlx5_cmd_status_to_err_v2(void *ptr) 1542 + { 1543 + u32 syndrome; 1544 + u8 status; 1545 + 1546 + status = be32_to_cpu(*(__be32 *)ptr) >> 24; 1547 + if (!status) 1548 + return 0; 1549 + 1550 + syndrome = be32_to_cpu(*(__be32 *)(ptr + 4)); 1551 + 1552 + pr_warn("command failed, status %s(0x%x), syndrome 0x%x\n", 1553 + cmd_status_str(status), status, syndrome); 1554 + 1555 + return cmd_status_to_err(status); 1556 + }
+73 -75
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 43 43 #include <linux/mlx5/qp.h> 44 44 #include <linux/mlx5/srq.h> 45 45 #include <linux/debugfs.h> 46 + #include <linux/mlx5/mlx5_ifc.h> 46 47 #include "mlx5_core.h" 47 48 48 49 #define DRIVER_NAME "mlx5_core" ··· 278 277 279 278 /* selectively copy writable fields clearing any reserved area 280 279 */ 281 - static void copy_rw_fields(struct mlx5_hca_cap *to, struct mlx5_general_caps *from) 280 + static void copy_rw_fields(void *to, struct mlx5_caps *from) 282 281 { 282 + __be64 *flags_off = (__be64 *)MLX5_ADDR_OF(cmd_hca_cap, to, reserved_22); 283 283 u64 v64; 284 284 285 - to->log_max_qp = from->log_max_qp & 0x1f; 286 - to->log_max_ra_req_dc = from->log_max_ra_req_dc & 0x3f; 287 - to->log_max_ra_res_dc = from->log_max_ra_res_dc & 0x3f; 288 - to->log_max_ra_req_qp = from->log_max_ra_req_qp & 0x3f; 289 - to->log_max_ra_res_qp = from->log_max_ra_res_qp & 0x3f; 290 - to->pkey_table_size = cpu_to_be16(to_fw_pkey_sz(from->pkey_table_size)); 291 - v64 = from->flags & MLX5_CAP_BITS_RW_MASK; 292 - to->flags = cpu_to_be64(v64); 285 + MLX5_SET(cmd_hca_cap, to, log_max_qp, from->gen.log_max_qp); 286 + MLX5_SET(cmd_hca_cap, to, log_max_ra_req_qp, from->gen.log_max_ra_req_qp); 287 + MLX5_SET(cmd_hca_cap, to, log_max_ra_res_qp, from->gen.log_max_ra_res_qp); 288 + MLX5_SET(cmd_hca_cap, to, pkey_table_size, from->gen.pkey_table_size); 289 + MLX5_SET(cmd_hca_cap, to, log_max_ra_req_dc, from->gen.log_max_ra_req_dc); 290 + MLX5_SET(cmd_hca_cap, to, log_max_ra_res_dc, from->gen.log_max_ra_res_dc); 291 + MLX5_SET(cmd_hca_cap, to, pkey_table_size, to_fw_pkey_sz(from->gen.pkey_table_size)); 292 + v64 = from->gen.flags & MLX5_CAP_BITS_RW_MASK; 293 + *flags_off = cpu_to_be64(v64); 293 294 } 294 295 295 296 static u16 get_pkey_table_size(int pkey) ··· 302 299 return MLX5_MIN_PKEY_TABLE_SIZE << pkey; 303 300 } 304 301 305 - static void fw2drv_caps(struct mlx5_caps *caps, 306 - struct mlx5_cmd_query_hca_cap_mbox_out *out) 302 + static void fw2drv_caps(struct mlx5_caps *caps, void *out) 307 303 { 308 304 struct mlx5_general_caps *gen = &caps->gen; 309 - u16 t16; 310 305 311 - gen->max_srq_wqes = 1 << out->hca_cap.log_max_srq_sz; 312 - gen->max_wqes = 1 << out->hca_cap.log_max_qp_sz; 313 - gen->log_max_qp = out->hca_cap.log_max_qp & 0x1f; 314 - gen->log_max_strq = out->hca_cap.log_max_strq_sz; 315 - gen->log_max_srq = out->hca_cap.log_max_srqs & 0x1f; 316 - gen->max_cqes = 1 << out->hca_cap.log_max_cq_sz; 317 - gen->log_max_cq = out->hca_cap.log_max_cq & 0x1f; 318 - gen->max_eqes = out->hca_cap.log_max_eq_sz; 319 - gen->log_max_mkey = out->hca_cap.log_max_mkey & 0x3f; 320 - gen->log_max_eq = out->hca_cap.log_max_eq & 0xf; 321 - gen->max_indirection = out->hca_cap.max_indirection; 322 - gen->log_max_mrw_sz = out->hca_cap.log_max_mrw_sz; 323 - gen->log_max_bsf_list_size = 0; 324 - gen->log_max_klm_list_size = 0; 325 - gen->log_max_ra_req_dc = out->hca_cap.log_max_ra_req_dc; 326 - gen->log_max_ra_res_dc = out->hca_cap.log_max_ra_res_dc; 327 - gen->log_max_ra_req_qp = out->hca_cap.log_max_ra_req_qp; 328 - gen->log_max_ra_res_qp = out->hca_cap.log_max_ra_res_qp; 329 - gen->max_qp_counters = be16_to_cpu(out->hca_cap.max_qp_count); 330 - gen->pkey_table_size = get_pkey_table_size(be16_to_cpu(out->hca_cap.pkey_table_size)); 331 - gen->local_ca_ack_delay = out->hca_cap.local_ca_ack_delay & 0x1f; 332 - gen->num_ports = out->hca_cap.num_ports & 0xf; 333 - gen->log_max_msg = out->hca_cap.log_max_msg & 0x1f; 334 - gen->stat_rate_support = be16_to_cpu(out->hca_cap.stat_rate_support); 335 - gen->flags = be64_to_cpu(out->hca_cap.flags); 306 + gen->max_srq_wqes = 1 << MLX5_GET_PR(cmd_hca_cap, out, log_max_srq_sz); 307 + gen->max_wqes = 1 << MLX5_GET_PR(cmd_hca_cap, out, log_max_qp_sz); 308 + gen->log_max_qp = MLX5_GET_PR(cmd_hca_cap, out, log_max_qp); 309 + gen->log_max_strq = MLX5_GET_PR(cmd_hca_cap, out, log_max_strq_sz); 310 + gen->log_max_srq = MLX5_GET_PR(cmd_hca_cap, out, log_max_srqs); 311 + gen->max_cqes = 1 << MLX5_GET_PR(cmd_hca_cap, out, log_max_cq_sz); 312 + gen->log_max_cq = MLX5_GET_PR(cmd_hca_cap, out, log_max_cq); 313 + gen->max_eqes = 1 << MLX5_GET_PR(cmd_hca_cap, out, log_max_eq_sz); 314 + gen->log_max_mkey = MLX5_GET_PR(cmd_hca_cap, out, log_max_mkey); 315 + gen->log_max_eq = MLX5_GET_PR(cmd_hca_cap, out, log_max_eq); 316 + gen->max_indirection = MLX5_GET_PR(cmd_hca_cap, out, max_indirection); 317 + gen->log_max_mrw_sz = MLX5_GET_PR(cmd_hca_cap, out, log_max_mrw_sz); 318 + gen->log_max_bsf_list_size = MLX5_GET_PR(cmd_hca_cap, out, log_max_bsf_list_size); 319 + gen->log_max_klm_list_size = MLX5_GET_PR(cmd_hca_cap, out, log_max_klm_list_size); 320 + gen->log_max_ra_req_dc = MLX5_GET_PR(cmd_hca_cap, out, log_max_ra_req_dc); 321 + gen->log_max_ra_res_dc = MLX5_GET_PR(cmd_hca_cap, out, log_max_ra_res_dc); 322 + gen->log_max_ra_req_qp = MLX5_GET_PR(cmd_hca_cap, out, log_max_ra_req_qp); 323 + gen->log_max_ra_res_qp = MLX5_GET_PR(cmd_hca_cap, out, log_max_ra_res_qp); 324 + gen->max_qp_counters = MLX5_GET_PR(cmd_hca_cap, out, max_qp_cnt); 325 + gen->pkey_table_size = get_pkey_table_size(MLX5_GET_PR(cmd_hca_cap, out, pkey_table_size)); 326 + gen->local_ca_ack_delay = MLX5_GET_PR(cmd_hca_cap, out, local_ca_ack_delay); 327 + gen->num_ports = MLX5_GET_PR(cmd_hca_cap, out, num_ports); 328 + gen->log_max_msg = MLX5_GET_PR(cmd_hca_cap, out, log_max_msg); 329 + gen->stat_rate_support = MLX5_GET_PR(cmd_hca_cap, out, stat_rate_support); 330 + gen->flags = be64_to_cpu(*(__be64 *)MLX5_ADDR_OF(cmd_hca_cap, out, reserved_22)); 336 331 pr_debug("flags = 0x%llx\n", gen->flags); 337 - gen->uar_sz = out->hca_cap.uar_sz; 338 - gen->min_log_pg_sz = out->hca_cap.log_pg_sz; 339 - 340 - t16 = be16_to_cpu(out->hca_cap.bf_log_bf_reg_size); 341 - if (t16 & 0x8000) { 342 - gen->bf_reg_size = 1 << (t16 & 0x1f); 343 - gen->bf_regs_per_page = MLX5_BF_REGS_PER_PAGE; 344 - } else { 345 - gen->bf_reg_size = 0; 346 - gen->bf_regs_per_page = 0; 347 - } 348 - gen->max_sq_desc_sz = be16_to_cpu(out->hca_cap.max_desc_sz_sq); 349 - gen->max_rq_desc_sz = be16_to_cpu(out->hca_cap.max_desc_sz_rq); 350 - gen->max_qp_mcg = be32_to_cpu(out->hca_cap.max_qp_mcg) & 0xffffff; 351 - gen->log_max_pd = out->hca_cap.log_max_pd & 0x1f; 352 - gen->log_max_xrcd = out->hca_cap.log_max_xrcd; 353 - gen->log_uar_page_sz = be16_to_cpu(out->hca_cap.log_uar_page_sz); 332 + gen->uar_sz = MLX5_GET_PR(cmd_hca_cap, out, uar_sz); 333 + gen->min_log_pg_sz = MLX5_GET_PR(cmd_hca_cap, out, log_pg_sz); 334 + gen->bf_reg_size = MLX5_GET_PR(cmd_hca_cap, out, bf); 335 + gen->bf_reg_size = 1 << MLX5_GET_PR(cmd_hca_cap, out, log_bf_reg_size); 336 + gen->max_sq_desc_sz = MLX5_GET_PR(cmd_hca_cap, out, max_wqe_sz_sq); 337 + gen->max_rq_desc_sz = MLX5_GET_PR(cmd_hca_cap, out, max_wqe_sz_rq); 338 + gen->max_dc_sq_desc_sz = MLX5_GET_PR(cmd_hca_cap, out, max_wqe_sz_sq_dc); 339 + gen->max_qp_mcg = MLX5_GET_PR(cmd_hca_cap, out, max_qp_mcg); 340 + gen->log_max_pd = MLX5_GET_PR(cmd_hca_cap, out, log_max_pd); 341 + gen->log_max_xrcd = MLX5_GET_PR(cmd_hca_cap, out, log_max_xrcd); 342 + gen->log_uar_page_sz = MLX5_GET_PR(cmd_hca_cap, out, log_uar_page_sz); 354 343 } 355 344 356 345 static const char *caps_opmod_str(u16 opmod) ··· 360 365 int mlx5_core_get_caps(struct mlx5_core_dev *dev, struct mlx5_caps *caps, 361 366 u16 opmod) 362 367 { 363 - struct mlx5_cmd_query_hca_cap_mbox_out *out; 364 - struct mlx5_cmd_query_hca_cap_mbox_in in; 368 + u8 in[MLX5_ST_SZ_BYTES(query_hca_cap_in)]; 369 + int out_sz = MLX5_ST_SZ_BYTES(query_hca_cap_out); 370 + void *out; 365 371 int err; 366 372 367 - memset(&in, 0, sizeof(in)); 368 - out = kzalloc(sizeof(*out), GFP_KERNEL); 373 + memset(in, 0, sizeof(in)); 374 + out = kzalloc(out_sz, GFP_KERNEL); 369 375 if (!out) 370 376 return -ENOMEM; 377 + MLX5_SET(query_hca_cap_in, in, opcode, MLX5_CMD_OP_QUERY_HCA_CAP); 378 + MLX5_SET(query_hca_cap_in, in, op_mod, opmod); 379 + err = mlx5_cmd_exec(dev, in, sizeof(in), out, out_sz); 380 + if (err) 381 + goto query_ex; 371 382 372 - in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_QUERY_HCA_CAP); 373 - in.hdr.opmod = cpu_to_be16(opmod); 374 - err = mlx5_cmd_exec(dev, &in, sizeof(in), out, sizeof(*out)); 375 - 376 - err = mlx5_cmd_status_to_err(&out->hdr); 383 + err = mlx5_cmd_status_to_err_v2(out); 377 384 if (err) { 378 385 mlx5_core_warn(dev, "query max hca cap failed, %d\n", err); 379 386 goto query_ex; 380 387 } 381 388 mlx5_core_dbg(dev, "%s\n", caps_opmod_str(opmod)); 382 - fw2drv_caps(caps, out); 389 + fw2drv_caps(caps, MLX5_ADDR_OF(query_hca_cap_out, out, capability_struct)); 383 390 384 391 query_ex: 385 392 kfree(out); 386 393 return err; 387 394 } 388 395 389 - static int set_caps(struct mlx5_core_dev *dev, 390 - struct mlx5_cmd_set_hca_cap_mbox_in *in) 396 + static int set_caps(struct mlx5_core_dev *dev, void *in, int in_sz) 391 397 { 392 - struct mlx5_cmd_set_hca_cap_mbox_out out; 398 + u32 out[MLX5_ST_SZ_DW(set_hca_cap_out)]; 393 399 int err; 394 400 395 - memset(&out, 0, sizeof(out)); 401 + memset(out, 0, sizeof(out)); 396 402 397 - in->hdr.opcode = cpu_to_be16(MLX5_CMD_OP_SET_HCA_CAP); 398 - err = mlx5_cmd_exec(dev, in, sizeof(*in), &out, sizeof(out)); 403 + MLX5_SET(set_hca_cap_in, in, opcode, MLX5_CMD_OP_SET_HCA_CAP); 404 + err = mlx5_cmd_exec(dev, in, in_sz, out, sizeof(out)); 399 405 if (err) 400 406 return err; 401 407 402 - err = mlx5_cmd_status_to_err(&out.hdr); 408 + err = mlx5_cmd_status_to_err_v2(out); 403 409 404 410 return err; 405 411 } 406 412 407 413 static int handle_hca_cap(struct mlx5_core_dev *dev) 408 414 { 409 - struct mlx5_cmd_set_hca_cap_mbox_in *set_ctx = NULL; 415 + void *set_ctx = NULL; 410 416 struct mlx5_profile *prof = dev->profile; 411 417 struct mlx5_caps *cur_caps = NULL; 412 418 struct mlx5_caps *max_caps = NULL; 413 419 int err = -ENOMEM; 420 + int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in); 414 421 415 - set_ctx = kzalloc(sizeof(*set_ctx), GFP_KERNEL); 422 + set_ctx = kzalloc(set_sz, GFP_KERNEL); 416 423 if (!set_ctx) 417 424 goto query_ex; 418 425 ··· 443 446 /* disable checksum */ 444 447 cur_caps->gen.flags &= ~MLX5_DEV_CAP_FLAG_CMDIF_CSUM; 445 448 446 - copy_rw_fields(&set_ctx->hca_cap, &cur_caps->gen); 447 - err = set_caps(dev, set_ctx); 449 + copy_rw_fields(MLX5_ADDR_OF(set_hca_cap_in, set_ctx, hca_capability_struct), 450 + cur_caps); 451 + err = set_caps(dev, set_ctx, set_sz); 448 452 449 453 query_ex: 450 454 kfree(cur_caps);
-92
include/linux/mlx5/device.h
··· 327 327 u8 vsd_psid[16]; 328 328 }; 329 329 330 - struct mlx5_hca_cap { 331 - u8 rsvd1[16]; 332 - u8 log_max_srq_sz; 333 - u8 log_max_qp_sz; 334 - u8 rsvd2; 335 - u8 log_max_qp; 336 - u8 log_max_strq_sz; 337 - u8 log_max_srqs; 338 - u8 rsvd4[2]; 339 - u8 rsvd5; 340 - u8 log_max_cq_sz; 341 - u8 rsvd6; 342 - u8 log_max_cq; 343 - u8 log_max_eq_sz; 344 - u8 log_max_mkey; 345 - u8 rsvd7; 346 - u8 log_max_eq; 347 - u8 max_indirection; 348 - u8 log_max_mrw_sz; 349 - u8 log_max_bsf_list_sz; 350 - u8 log_max_klm_list_sz; 351 - u8 rsvd_8_0; 352 - u8 log_max_ra_req_dc; 353 - u8 rsvd_8_1; 354 - u8 log_max_ra_res_dc; 355 - u8 rsvd9; 356 - u8 log_max_ra_req_qp; 357 - u8 rsvd10; 358 - u8 log_max_ra_res_qp; 359 - u8 pad_cap; 360 - u8 rsvd11[3]; 361 - __be16 max_qp_count; 362 - __be16 pkey_table_size; 363 - u8 rsvd13; 364 - u8 local_ca_ack_delay; 365 - u8 rsvd14; 366 - u8 num_ports; 367 - u8 log_max_msg; 368 - u8 rsvd15[3]; 369 - __be16 stat_rate_support; 370 - u8 rsvd16[2]; 371 - __be64 flags; 372 - u8 rsvd17; 373 - u8 uar_sz; 374 - u8 rsvd18; 375 - u8 log_pg_sz; 376 - __be16 bf_log_bf_reg_size; 377 - u8 rsvd19[4]; 378 - __be16 max_desc_sz_sq; 379 - u8 rsvd20[2]; 380 - __be16 max_desc_sz_rq; 381 - u8 rsvd21[2]; 382 - __be16 max_desc_sz_sq_dc; 383 - __be32 max_qp_mcg; 384 - u8 rsvd22[3]; 385 - u8 log_max_mcg; 386 - u8 rsvd23; 387 - u8 log_max_pd; 388 - u8 rsvd24; 389 - u8 log_max_xrcd; 390 - u8 rsvd25[42]; 391 - __be16 log_uar_page_sz; 392 - u8 rsvd26[108]; 393 - }; 394 - 395 - 396 - struct mlx5_cmd_query_hca_cap_mbox_in { 397 - struct mlx5_inbox_hdr hdr; 398 - u8 rsvd[8]; 399 - }; 400 - 401 - 402 - struct mlx5_cmd_query_hca_cap_mbox_out { 403 - struct mlx5_outbox_hdr hdr; 404 - u8 rsvd0[8]; 405 - struct mlx5_hca_cap hca_cap; 406 - }; 407 - 408 - 409 - struct mlx5_cmd_set_hca_cap_mbox_in { 410 - struct mlx5_inbox_hdr hdr; 411 - u8 rsvd[8]; 412 - struct mlx5_hca_cap hca_cap; 413 - }; 414 - 415 - 416 - struct mlx5_cmd_set_hca_cap_mbox_out { 417 - struct mlx5_outbox_hdr hdr; 418 - u8 rsvd0[8]; 419 - }; 420 - 421 - 422 330 struct mlx5_cmd_init_hca_mbox_in { 423 331 struct mlx5_inbox_hdr hdr; 424 332 u8 rsvd0[2];
+1
include/linux/mlx5/driver.h
··· 641 641 void mlx5_cmd_use_events(struct mlx5_core_dev *dev); 642 642 void mlx5_cmd_use_polling(struct mlx5_core_dev *dev); 643 643 int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); 644 + int mlx5_cmd_status_to_err_v2(void *ptr); 644 645 int mlx5_core_get_caps(struct mlx5_core_dev *dev, struct mlx5_caps *caps, 645 646 u16 opmod); 646 647 int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out,
+206
include/linux/mlx5/mlx5_ifc.h
··· 140 140 MLX5_CMD_OP_MAX = 0x911 141 141 }; 142 142 143 + struct mlx5_ifc_cmd_hca_cap_bits { 144 + u8 reserved_0[0x80]; 145 + 146 + u8 log_max_srq_sz[0x8]; 147 + u8 log_max_qp_sz[0x8]; 148 + u8 reserved_1[0xb]; 149 + u8 log_max_qp[0x5]; 150 + 151 + u8 log_max_strq_sz[0x8]; 152 + u8 reserved_2[0x3]; 153 + u8 log_max_srqs[0x5]; 154 + u8 reserved_3[0x10]; 155 + 156 + u8 reserved_4[0x8]; 157 + u8 log_max_cq_sz[0x8]; 158 + u8 reserved_5[0xb]; 159 + u8 log_max_cq[0x5]; 160 + 161 + u8 log_max_eq_sz[0x8]; 162 + u8 reserved_6[0x2]; 163 + u8 log_max_mkey[0x6]; 164 + u8 reserved_7[0xc]; 165 + u8 log_max_eq[0x4]; 166 + 167 + u8 max_indirection[0x8]; 168 + u8 reserved_8[0x1]; 169 + u8 log_max_mrw_sz[0x7]; 170 + u8 reserved_9[0x2]; 171 + u8 log_max_bsf_list_size[0x6]; 172 + u8 reserved_10[0x2]; 173 + u8 log_max_klm_list_size[0x6]; 174 + 175 + u8 reserved_11[0xa]; 176 + u8 log_max_ra_req_dc[0x6]; 177 + u8 reserved_12[0xa]; 178 + u8 log_max_ra_res_dc[0x6]; 179 + 180 + u8 reserved_13[0xa]; 181 + u8 log_max_ra_req_qp[0x6]; 182 + u8 reserved_14[0xa]; 183 + u8 log_max_ra_res_qp[0x6]; 184 + 185 + u8 pad_cap[0x1]; 186 + u8 cc_query_allowed[0x1]; 187 + u8 cc_modify_allowed[0x1]; 188 + u8 reserved_15[0x1d]; 189 + 190 + u8 reserved_16[0x6]; 191 + u8 max_qp_cnt[0xa]; 192 + u8 pkey_table_size[0x10]; 193 + 194 + u8 eswitch_owner[0x1]; 195 + u8 reserved_17[0xa]; 196 + u8 local_ca_ack_delay[0x5]; 197 + u8 reserved_18[0x8]; 198 + u8 num_ports[0x8]; 199 + 200 + u8 reserved_19[0x3]; 201 + u8 log_max_msg[0x5]; 202 + u8 reserved_20[0x18]; 203 + 204 + u8 stat_rate_support[0x10]; 205 + u8 reserved_21[0x10]; 206 + 207 + u8 reserved_22[0x10]; 208 + u8 cmdif_checksum[0x2]; 209 + u8 sigerr_cqe[0x1]; 210 + u8 reserved_23[0x1]; 211 + u8 wq_signature[0x1]; 212 + u8 sctr_data_cqe[0x1]; 213 + u8 reserved_24[0x1]; 214 + u8 sho[0x1]; 215 + u8 tph[0x1]; 216 + u8 rf[0x1]; 217 + u8 dc[0x1]; 218 + u8 reserved_25[0x2]; 219 + u8 roce[0x1]; 220 + u8 atomic[0x1]; 221 + u8 rsz_srq[0x1]; 222 + 223 + u8 cq_oi[0x1]; 224 + u8 cq_resize[0x1]; 225 + u8 cq_moderation[0x1]; 226 + u8 sniffer_rule_flow[0x1]; 227 + u8 sniffer_rule_vport[0x1]; 228 + u8 sniffer_rule_phy[0x1]; 229 + u8 reserved_26[0x1]; 230 + u8 pg[0x1]; 231 + u8 block_lb_mc[0x1]; 232 + u8 reserved_27[0x3]; 233 + u8 cd[0x1]; 234 + u8 reserved_28[0x1]; 235 + u8 apm[0x1]; 236 + u8 reserved_29[0x7]; 237 + u8 qkv[0x1]; 238 + u8 pkv[0x1]; 239 + u8 reserved_30[0x4]; 240 + u8 xrc[0x1]; 241 + u8 ud[0x1]; 242 + u8 uc[0x1]; 243 + u8 rc[0x1]; 244 + 245 + u8 reserved_31[0xa]; 246 + u8 uar_sz[0x6]; 247 + u8 reserved_32[0x8]; 248 + u8 log_pg_sz[0x8]; 249 + 250 + u8 bf[0x1]; 251 + u8 reserved_33[0xa]; 252 + u8 log_bf_reg_size[0x5]; 253 + u8 reserved_34[0x10]; 254 + 255 + u8 reserved_35[0x10]; 256 + u8 max_wqe_sz_sq[0x10]; 257 + 258 + u8 reserved_36[0x10]; 259 + u8 max_wqe_sz_rq[0x10]; 260 + 261 + u8 reserved_37[0x10]; 262 + u8 max_wqe_sz_sq_dc[0x10]; 263 + 264 + u8 reserved_38[0x7]; 265 + u8 max_qp_mcg[0x19]; 266 + 267 + u8 reserved_39[0x18]; 268 + u8 log_max_mcg[0x8]; 269 + 270 + u8 reserved_40[0xb]; 271 + u8 log_max_pd[0x5]; 272 + u8 reserved_41[0xb]; 273 + u8 log_max_xrcd[0x5]; 274 + 275 + u8 reserved_42[0x20]; 276 + 277 + u8 reserved_43[0x3]; 278 + u8 log_max_rq[0x5]; 279 + u8 reserved_44[0x3]; 280 + u8 log_max_sq[0x5]; 281 + u8 reserved_45[0x3]; 282 + u8 log_max_tir[0x5]; 283 + u8 reserved_46[0x3]; 284 + u8 log_max_tis[0x5]; 285 + 286 + u8 reserved_47[0x13]; 287 + u8 log_max_rq_per_tir[0x5]; 288 + u8 reserved_48[0x3]; 289 + u8 log_max_tis_per_sq[0x5]; 290 + 291 + u8 reserved_49[0xe0]; 292 + 293 + u8 reserved_50[0x10]; 294 + u8 log_uar_page_sz[0x10]; 295 + 296 + u8 reserved_51[0x100]; 297 + 298 + u8 reserved_52[0x1f]; 299 + u8 cqe_zip[0x1]; 300 + 301 + u8 cqe_zip_timeout[0x10]; 302 + u8 cqe_zip_max_num[0x10]; 303 + 304 + u8 reserved_53[0x220]; 305 + }; 306 + 307 + struct mlx5_ifc_set_hca_cap_in_bits { 308 + u8 opcode[0x10]; 309 + u8 reserved_0[0x10]; 310 + 311 + u8 reserved_1[0x10]; 312 + u8 op_mod[0x10]; 313 + 314 + u8 reserved_2[0x40]; 315 + 316 + struct mlx5_ifc_cmd_hca_cap_bits hca_capability_struct; 317 + }; 318 + 319 + struct mlx5_ifc_query_hca_cap_in_bits { 320 + u8 opcode[0x10]; 321 + u8 reserved_0[0x10]; 322 + 323 + u8 reserved_1[0x10]; 324 + u8 op_mod[0x10]; 325 + 326 + u8 reserved_2[0x40]; 327 + }; 328 + 329 + struct mlx5_ifc_query_hca_cap_out_bits { 330 + u8 status[0x8]; 331 + u8 reserved_0[0x18]; 332 + 333 + u8 syndrome[0x20]; 334 + 335 + u8 reserved_1[0x40]; 336 + 337 + u8 capability_struct[256][0x8]; 338 + }; 339 + 340 + struct mlx5_ifc_set_hca_cap_out_bits { 341 + u8 status[0x8]; 342 + u8 reserved_0[0x18]; 343 + 344 + u8 syndrome[0x20]; 345 + 346 + u8 reserved_1[0x40]; 347 + }; 348 + 143 349 #endif /* MLX5_IFC_H */