Lines Matching refs:dev_cap

289 					      struct mlx4_dev_cap *dev_cap)  in mlx4_set_num_reserved_uars()  argument
298 dev_cap->reserved_uars / in mlx4_set_num_reserved_uars()
338 static int mlx4_query_func(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) in mlx4_query_func() argument
349 dev_cap->max_eqs = func.max_eq; in mlx4_query_func()
350 dev_cap->reserved_eqs = func.rsvd_eqs; in mlx4_query_func()
351 dev_cap->reserved_uars = func.rsvd_uars; in mlx4_query_func()
359 struct mlx4_caps *dev_cap = &dev->caps; in mlx4_enable_cqe_eqe_stride() local
362 if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_EQE_STRIDE) || in mlx4_enable_cqe_eqe_stride()
363 !(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_CQE_STRIDE)) in mlx4_enable_cqe_eqe_stride()
369 if (!(dev_cap->flags & MLX4_DEV_CAP_FLAG_64B_EQE) || in mlx4_enable_cqe_eqe_stride()
370 !(dev_cap->flags & MLX4_DEV_CAP_FLAG_64B_CQE)) { in mlx4_enable_cqe_eqe_stride()
371 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; in mlx4_enable_cqe_eqe_stride()
372 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; in mlx4_enable_cqe_eqe_stride()
379 dev_cap->flags &= ~MLX4_DEV_CAP_FLAG_64B_CQE; in mlx4_enable_cqe_eqe_stride()
380 dev_cap->flags &= ~MLX4_DEV_CAP_FLAG_64B_EQE; in mlx4_enable_cqe_eqe_stride()
383 dev_cap->function_caps |= MLX4_FUNC_CAP_EQE_CQE_STRIDE; in mlx4_enable_cqe_eqe_stride()
387 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; in mlx4_enable_cqe_eqe_stride()
388 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; in mlx4_enable_cqe_eqe_stride()
452 static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) in mlx4_dev_cap() argument
457 err = mlx4_QUERY_DEV_CAP(dev, dev_cap); in mlx4_dev_cap()
462 mlx4_dev_cap_dump(dev, dev_cap); in mlx4_dev_cap()
464 if (dev_cap->min_page_sz > PAGE_SIZE) { in mlx4_dev_cap()
466 dev_cap->min_page_sz, PAGE_SIZE); in mlx4_dev_cap()
469 if (dev_cap->num_ports > MLX4_MAX_PORTS) { in mlx4_dev_cap()
471 dev_cap->num_ports, MLX4_MAX_PORTS); in mlx4_dev_cap()
475 if (dev_cap->uar_size > pci_resource_len(dev->persist->pdev, 2)) { in mlx4_dev_cap()
477 dev_cap->uar_size, in mlx4_dev_cap()
483 dev->caps.num_ports = dev_cap->num_ports; in mlx4_dev_cap()
484 dev->caps.num_sys_eqs = dev_cap->num_sys_eqs; in mlx4_dev_cap()
485 dev->phys_caps.num_phys_eqs = dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS ? in mlx4_dev_cap()
489 err = _mlx4_dev_port(dev, i, dev_cap->port_cap + i); in mlx4_dev_cap()
496 dev->caps.map_clock_to_user = dev_cap->map_clock_to_user; in mlx4_dev_cap()
498 dev->caps.num_uars = dev_cap->uar_size / PAGE_SIZE; in mlx4_dev_cap()
499 dev->caps.local_ca_ack_delay = dev_cap->local_ca_ack_delay; in mlx4_dev_cap()
500 dev->caps.bf_reg_size = dev_cap->bf_reg_size; in mlx4_dev_cap()
501 dev->caps.bf_regs_per_page = dev_cap->bf_regs_per_page; in mlx4_dev_cap()
502 dev->caps.max_sq_sg = dev_cap->max_sq_sg; in mlx4_dev_cap()
503 dev->caps.max_rq_sg = dev_cap->max_rq_sg; in mlx4_dev_cap()
504 dev->caps.max_wqes = dev_cap->max_qp_sz; in mlx4_dev_cap()
505 dev->caps.max_qp_init_rdma = dev_cap->max_requester_per_qp; in mlx4_dev_cap()
506 dev->caps.max_srq_wqes = dev_cap->max_srq_sz; in mlx4_dev_cap()
507 dev->caps.max_srq_sge = dev_cap->max_rq_sg - 1; in mlx4_dev_cap()
508 dev->caps.reserved_srqs = dev_cap->reserved_srqs; in mlx4_dev_cap()
509 dev->caps.max_sq_desc_sz = dev_cap->max_sq_desc_sz; in mlx4_dev_cap()
510 dev->caps.max_rq_desc_sz = dev_cap->max_rq_desc_sz; in mlx4_dev_cap()
515 dev->caps.max_cqes = dev_cap->max_cq_sz - 1; in mlx4_dev_cap()
516 dev->caps.reserved_cqs = dev_cap->reserved_cqs; in mlx4_dev_cap()
517 dev->caps.reserved_eqs = dev_cap->reserved_eqs; in mlx4_dev_cap()
518 dev->caps.reserved_mtts = dev_cap->reserved_mtts; in mlx4_dev_cap()
519 dev->caps.reserved_mrws = dev_cap->reserved_mrws; in mlx4_dev_cap()
521 dev->caps.reserved_pds = dev_cap->reserved_pds; in mlx4_dev_cap()
523 dev_cap->reserved_xrcds : 0; in mlx4_dev_cap()
525 dev_cap->max_xrcds : 0; in mlx4_dev_cap()
526 dev->caps.mtt_entry_sz = dev_cap->mtt_entry_sz; in mlx4_dev_cap()
528 dev->caps.max_msg_sz = dev_cap->max_msg_sz; in mlx4_dev_cap()
529 dev->caps.page_size_cap = ~(u32) (dev_cap->min_page_sz - 1); in mlx4_dev_cap()
530 dev->caps.flags = dev_cap->flags; in mlx4_dev_cap()
531 dev->caps.flags2 = dev_cap->flags2; in mlx4_dev_cap()
532 dev->caps.bmme_flags = dev_cap->bmme_flags; in mlx4_dev_cap()
533 dev->caps.reserved_lkey = dev_cap->reserved_lkey; in mlx4_dev_cap()
534 dev->caps.stat_rate_support = dev_cap->stat_rate_support; in mlx4_dev_cap()
535 dev->caps.max_gso_sz = dev_cap->max_gso_sz; in mlx4_dev_cap()
536 dev->caps.max_rss_tbl_sz = dev_cap->max_rss_tbl_sz; in mlx4_dev_cap()
537 dev->caps.wol_port[1] = dev_cap->wol_port[1]; in mlx4_dev_cap()
538 dev->caps.wol_port[2] = dev_cap->wol_port[2]; in mlx4_dev_cap()
539 dev->caps.health_buffer_addrs = dev_cap->health_buffer_addrs; in mlx4_dev_cap()
551 mlx4_set_num_reserved_uars(dev, dev_cap); in mlx4_dev_cap()
631 if (dev->caps.log_num_macs > dev_cap->port_cap[i].log_max_macs) { in mlx4_dev_cap()
632 dev->caps.log_num_macs = dev_cap->port_cap[i].log_max_macs; in mlx4_dev_cap()
636 if (dev->caps.log_num_vlans > dev_cap->port_cap[i].log_max_vlans) { in mlx4_dev_cap()
637 dev->caps.log_num_vlans = dev_cap->port_cap[i].log_max_vlans; in mlx4_dev_cap()
651 dev->caps.max_counters = dev_cap->max_counters; in mlx4_dev_cap()
653 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW] = dev_cap->reserved_qps; in mlx4_dev_cap()
661 if (dev_cap->dmfs_high_rate_qpn_base > 0 && in mlx4_dev_cap()
663 dev->caps.dmfs_high_rate_qpn_base = dev_cap->dmfs_high_rate_qpn_base; in mlx4_dev_cap()
668 if (dev_cap->dmfs_high_rate_qpn_range > 0 && in mlx4_dev_cap()
670 dev->caps.dmfs_high_rate_qpn_range = dev_cap->dmfs_high_rate_qpn_range; in mlx4_dev_cap()
680 dev->caps.rl_caps = dev_cap->rl_caps; in mlx4_dev_cap()
693 if (dev_cap->flags & in mlx4_dev_cap()
700 if (dev_cap->flags2 & in mlx4_dev_cap()
704 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_CQE_STRIDE; in mlx4_dev_cap()
705 dev_cap->flags2 &= ~MLX4_DEV_CAP_FLAG2_EQE_STRIDE; in mlx4_dev_cap()
838 struct mlx4_dev_cap *dev_cap, in slave_adjust_steering_mode() argument
843 dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; in slave_adjust_steering_mode()
845 dev_cap->fs_log_max_ucast_qp_range_size; in slave_adjust_steering_mode()
906 struct mlx4_dev_cap *dev_cap; in mlx4_slave_cap() local
912 dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); in mlx4_slave_cap()
913 if (!hca_param || !func_cap || !dev_cap) { in mlx4_slave_cap()
937 err = mlx4_dev_cap(dev, dev_cap); in mlx4_slave_cap()
968 mlx4_set_num_reserved_uars(dev, dev_cap); in mlx4_slave_cap()
1068 slave_adjust_steering_mode(dev, dev_cap, hca_param); in mlx4_slave_cap()
1085 kfree(dev_cap); in mlx4_slave_cap()
1663 static int mlx4_init_icm(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, in mlx4_init_icm() argument
1694 err = mlx4_init_cmpt_table(dev, init_hca->cmpt_base, dev_cap->cmpt_entry_sz); in mlx4_init_icm()
1703 init_hca->eqc_base, dev_cap->eqc_entry_sz, in mlx4_init_icm()
1733 dev_cap->dmpt_entry_sz, in mlx4_init_icm()
1743 dev_cap->qpc_entry_sz, in mlx4_init_icm()
1754 dev_cap->aux_entry_sz, in mlx4_init_icm()
1765 dev_cap->altc_entry_sz, in mlx4_init_icm()
1776 dev_cap->rdmarc_entry_sz << priv->qp_table.rdmarc_shift, in mlx4_init_icm()
1787 dev_cap->cqc_entry_sz, in mlx4_init_icm()
1797 dev_cap->srq_entry_sz, in mlx4_init_icm()
2193 struct mlx4_dev_cap *dev_cap) in choose_steering_mode() argument
2207 dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_FS_EN && in choose_steering_mode()
2209 (dev_cap->fs_max_num_qp_per_entry >= in choose_steering_mode()
2211 choose_log_fs_mgm_entry_size(dev_cap->fs_max_num_qp_per_entry) >= in choose_steering_mode()
2214 choose_log_fs_mgm_entry_size(dev_cap->fs_max_num_qp_per_entry); in choose_steering_mode()
2216 dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; in choose_steering_mode()
2218 dev_cap->fs_log_max_ucast_qp_range_size; in choose_steering_mode()
2246 struct mlx4_dev_cap *dev_cap) in choose_tunnel_offload_mode() argument
2249 dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS) in choose_tunnel_offload_mode()
2322 struct mlx4_dev_cap *dev_cap = NULL; in mlx4_init_hca() local
2330 dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); in mlx4_init_hca()
2333 if (!dev_cap || !init_hca) { in mlx4_init_hca()
2338 err = mlx4_dev_cap(dev, dev_cap); in mlx4_init_hca()
2344 choose_steering_mode(dev, dev_cap); in mlx4_init_hca()
2345 choose_tunnel_offload_mode(dev, dev_cap); in mlx4_init_hca()
2368 icm_size = mlx4_make_profile(dev, &profile, dev_cap, in mlx4_init_hca()
2389 err = mlx4_init_icm(dev, dev_cap, init_hca, icm_size); in mlx4_init_hca()
2399 if (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS) { in mlx4_init_hca()
2400 err = mlx4_query_func(dev, dev_cap); in mlx4_init_hca()
2405 dev->caps.num_eqs = dev_cap->max_eqs; in mlx4_init_hca()
2406 dev->caps.reserved_eqs = dev_cap->reserved_eqs; in mlx4_init_hca()
2407 dev->caps.reserved_uars = dev_cap->reserved_uars; in mlx4_init_hca()
2519 kfree(dev_cap); in mlx4_init_hca()
3344 static int mlx4_check_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap, in mlx4_check_dev_cap() argument
3349 if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_80_VFS) && in mlx4_check_dev_cap()
3396 struct mlx4_dev_cap *dev_cap = NULL; in mlx4_load_one() local
3500 if (!dev_cap) { in mlx4_load_one()
3501 dev_cap = kzalloc(sizeof(*dev_cap), GFP_KERNEL); in mlx4_load_one()
3503 if (!dev_cap) { in mlx4_load_one()
3508 err = mlx4_QUERY_DEV_CAP(dev, dev_cap); in mlx4_load_one()
3514 if (mlx4_check_dev_cap(dev, dev_cap, nvfs)) in mlx4_load_one()
3517 if (!(dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS)) { in mlx4_load_one()
3542 memset(dev_cap, 0, sizeof(*dev_cap)); in mlx4_load_one()
3543 err = mlx4_QUERY_DEV_CAP(dev, dev_cap); in mlx4_load_one()
3549 if (mlx4_check_dev_cap(dev, dev_cap, nvfs)) in mlx4_load_one()
3577 if (mlx4_is_master(dev) && (dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS)) { in mlx4_load_one()
3713 kfree(dev_cap); in mlx4_load_one()
3781 kfree(dev_cap); in mlx4_load_one()