Lines Matching full:caps
295 dev->caps.reserved_uars = in mlx4_set_num_reserved_uars()
307 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) { in mlx4_check_port_params()
308 for (i = 0; i < dev->caps.num_ports - 1; i++) { in mlx4_check_port_params()
316 for (i = 0; i < dev->caps.num_ports; i++) { in mlx4_check_port_params()
317 if (!(port_type[i] & dev->caps.supported_type[i+1])) { in mlx4_check_port_params()
330 for (i = 1; i <= dev->caps.num_ports; ++i) in mlx4_set_port_mask()
331 dev->caps.port_mask[i] = dev->caps.port_type[i]; in mlx4_set_port_mask()
343 if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_SYS_EQS) { in mlx4_query_func()
359 struct mlx4_caps *dev_cap = &dev->caps; in mlx4_enable_cqe_eqe_stride()
395 dev->caps.vl_cap[port] = port_cap->max_vl; in _mlx4_dev_port()
396 dev->caps.ib_mtu_cap[port] = port_cap->ib_mtu; in _mlx4_dev_port()
402 dev->caps.gid_table_len[port] = port_cap->max_gids; in _mlx4_dev_port()
403 dev->caps.pkey_table_len[port] = port_cap->max_pkeys; in _mlx4_dev_port()
404 dev->caps.port_width_cap[port] = port_cap->max_port_width; in _mlx4_dev_port()
405 dev->caps.eth_mtu_cap[port] = port_cap->eth_mtu; in _mlx4_dev_port()
406 dev->caps.max_tc_eth = port_cap->max_tc_eth; in _mlx4_dev_port()
407 dev->caps.def_mac[port] = port_cap->def_mac; in _mlx4_dev_port()
408 dev->caps.supported_type[port] = port_cap->supported_port_types; in _mlx4_dev_port()
409 dev->caps.suggested_type[port] = port_cap->suggested_type; in _mlx4_dev_port()
410 dev->caps.default_sense[port] = port_cap->default_sense; in _mlx4_dev_port()
411 dev->caps.trans_type[port] = port_cap->trans_type; in _mlx4_dev_port()
412 dev->caps.vendor_oui[port] = port_cap->vendor_oui; in _mlx4_dev_port()
413 dev->caps.wavelength[port] = port_cap->wavelength; in _mlx4_dev_port()
414 dev->caps.trans_code[port] = port_cap->trans_code; in _mlx4_dev_port()
434 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_IGNORE_FCS)) in mlx4_enable_ignore_fcs()
439 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_IGNORE_FCS; in mlx4_enable_ignore_fcs()
443 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_FCS_KEEP)) { in mlx4_enable_ignore_fcs()
446 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_IGNORE_FCS; in mlx4_enable_ignore_fcs()
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()
486 dev->caps.num_sys_eqs : in mlx4_dev_cap()
488 for (i = 1; i <= dev->caps.num_ports; ++i) { in mlx4_dev_cap()
496 dev->caps.map_clock_to_user = dev_cap->map_clock_to_user; in mlx4_dev_cap()
497 dev->caps.uar_page_size = PAGE_SIZE; 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()
522 dev->caps.reserved_xrcds = (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) ? in mlx4_dev_cap()
524 dev->caps.max_xrcds = (dev->caps.flags & MLX4_DEV_CAP_FLAG_XRC) ? 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()
554 if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PHV_EN) { in mlx4_dev_cap()
566 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_PHV_EN; in mlx4_dev_cap()
571 dev->caps.flags |= MLX4_DEV_CAP_FLAG_SENSE_SUPPORT; in mlx4_dev_cap()
574 dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_SENSE_SUPPORT; in mlx4_dev_cap()
577 dev->caps.log_num_macs = MLX4_MIN_LOG_NUM_MAC; in mlx4_dev_cap()
578 dev->caps.log_num_vlans = MLX4_MIN_LOG_NUM_VLANS; in mlx4_dev_cap()
580 dev->caps.log_num_macs = log_num_mac; in mlx4_dev_cap()
581 dev->caps.log_num_vlans = MLX4_LOG_NUM_VLANS; in mlx4_dev_cap()
584 for (i = 1; i <= dev->caps.num_ports; ++i) { in mlx4_dev_cap()
585 dev->caps.port_type[i] = MLX4_PORT_TYPE_NONE; in mlx4_dev_cap()
586 if (dev->caps.supported_type[i]) { in mlx4_dev_cap()
588 if (dev->caps.supported_type[i] == MLX4_PORT_TYPE_ETH) in mlx4_dev_cap()
589 dev->caps.port_type[i] = MLX4_PORT_TYPE_ETH; in mlx4_dev_cap()
591 else if (dev->caps.supported_type[i] == in mlx4_dev_cap()
593 dev->caps.port_type[i] = MLX4_PORT_TYPE_IB; in mlx4_dev_cap()
599 dev->caps.port_type[i] = dev->caps.suggested_type[i] ? in mlx4_dev_cap()
602 dev->caps.port_type[i] = port_type_array[i - 1]; in mlx4_dev_cap()
612 ((dev->caps.supported_type[i] == MLX4_PORT_TYPE_AUTO) && in mlx4_dev_cap()
613 (dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) && in mlx4_dev_cap()
614 (dev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT)); in mlx4_dev_cap()
621 if (mlx4_priv(dev)->sense.sense_allowed[i] && dev->caps.default_sense[i]) { in mlx4_dev_cap()
623 dev->caps.possible_type[i] = MLX4_PORT_TYPE_AUTO; in mlx4_dev_cap()
626 dev->caps.port_type[i] = sensed_port; in mlx4_dev_cap()
628 dev->caps.possible_type[i] = dev->caps.port_type[i]; 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()
634 i, 1 << dev->caps.log_num_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()
639 i, 1 << dev->caps.log_num_vlans); in mlx4_dev_cap()
643 if (mlx4_is_master(dev) && (dev->caps.num_ports == 2) && in mlx4_dev_cap()
648 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_QOS_VPP; 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()
654 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_ETH_ADDR] = in mlx4_dev_cap()
655 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_ADDR] = in mlx4_dev_cap()
656 (1 << dev->caps.log_num_macs) * in mlx4_dev_cap()
657 (1 << dev->caps.log_num_vlans) * in mlx4_dev_cap()
658 dev->caps.num_ports; in mlx4_dev_cap()
659 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH] = MLX4_NUM_FEXCH; in mlx4_dev_cap()
662 dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FS_EN) in mlx4_dev_cap()
663 dev->caps.dmfs_high_rate_qpn_base = dev_cap->dmfs_high_rate_qpn_base; in mlx4_dev_cap()
665 dev->caps.dmfs_high_rate_qpn_base = in mlx4_dev_cap()
666 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; in mlx4_dev_cap()
669 dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_FS_EN) { in mlx4_dev_cap()
670 dev->caps.dmfs_high_rate_qpn_range = dev_cap->dmfs_high_rate_qpn_range; in mlx4_dev_cap()
671 dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_DEFAULT; in mlx4_dev_cap()
672 dev->caps.flags2 |= MLX4_DEV_CAP_FLAG2_FS_A0; in mlx4_dev_cap()
674 dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_NOT_SUPPORTED; in mlx4_dev_cap()
675 dev->caps.dmfs_high_rate_qpn_base = in mlx4_dev_cap()
676 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; in mlx4_dev_cap()
677 dev->caps.dmfs_high_rate_qpn_range = MLX4_A0_STEERING_TABLE_SIZE; in mlx4_dev_cap()
680 dev->caps.rl_caps = dev_cap->rl_caps; in mlx4_dev_cap()
682 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_RSS_RAW_ETH] = in mlx4_dev_cap()
683 dev->caps.dmfs_high_rate_qpn_range; in mlx4_dev_cap()
685 dev->caps.reserved_qps = dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW] + in mlx4_dev_cap()
686 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_ETH_ADDR] + in mlx4_dev_cap()
687 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_ADDR] + in mlx4_dev_cap()
688 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_EXCH]; in mlx4_dev_cap()
690 dev->caps.sqp_demux = (mlx4_is_master(dev)) ? MLX4_MAX_NUM_SLAVES : 0; in mlx4_dev_cap()
696 dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_CQE; in mlx4_dev_cap()
697 dev->caps.flags &= ~MLX4_DEV_CAP_FLAG_64B_EQE; in mlx4_dev_cap()
709 if ((dev->caps.flags & in mlx4_dev_cap()
712 dev->caps.function_caps |= MLX4_FUNC_CAP_64B_EQE_CQE; in mlx4_dev_cap()
716 dev->caps.alloc_res_qp_mask = in mlx4_dev_cap()
717 (dev->caps.bf_reg_size ? MLX4_RESERVE_ETH_BF_QP : 0) | in mlx4_dev_cap()
720 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG) && in mlx4_dev_cap()
721 dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) { in mlx4_dev_cap()
724 dev->caps.flags2 |= MLX4_DEV_CAP_FLAG2_ETS_CFG; in mlx4_dev_cap()
728 dev->caps.alloc_res_qp_mask = 0; in mlx4_dev_cap()
841 dev->caps.steering_mode = hca_param->steering_mode; in slave_adjust_steering_mode()
842 if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) { in slave_adjust_steering_mode()
843 dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; in slave_adjust_steering_mode()
844 dev->caps.fs_log_max_ucast_qp_range_size = in slave_adjust_steering_mode()
847 dev->caps.num_qp_per_mgm = in slave_adjust_steering_mode()
851 mlx4_steering_mode_str(dev->caps.steering_mode)); in slave_adjust_steering_mode()
856 kfree(dev->caps.spec_qps); in mlx4_slave_destroy_special_qp_cap()
857 dev->caps.spec_qps = NULL; in mlx4_slave_destroy_special_qp_cap()
863 struct mlx4_caps *caps = &dev->caps; in mlx4_slave_special_qp_cap() local
867 caps->spec_qps = kcalloc(caps->num_ports, sizeof(*caps->spec_qps), GFP_KERNEL); in mlx4_slave_special_qp_cap()
869 if (!func_cap || !caps->spec_qps) { in mlx4_slave_special_qp_cap()
875 for (i = 1; i <= caps->num_ports; ++i) { in mlx4_slave_special_qp_cap()
882 caps->spec_qps[i - 1] = func_cap->spec_qps; in mlx4_slave_special_qp_cap()
883 caps->port_mask[i] = caps->port_type[i]; in mlx4_slave_special_qp_cap()
884 caps->phys_port_id[i] = func_cap->phys_port_id; in mlx4_slave_special_qp_cap()
886 &caps->gid_table_len[i], in mlx4_slave_special_qp_cap()
887 &caps->pkey_table_len[i]); in mlx4_slave_special_qp_cap()
934 dev->caps.hca_core_clock = hca_param->hca_core_clock; in mlx4_slave_cap()
936 dev->caps.max_qp_dest_rdma = 1 << hca_param->log_rd_per_qp; in mlx4_slave_cap()
947 page_size = ~dev->caps.page_size_cap + 1; in mlx4_slave_cap()
974 dev->caps.uar_page_size = PAGE_SIZE; in mlx4_slave_cap()
992 dev->caps.num_ports = func_cap->num_ports; in mlx4_slave_cap()
998 dev->caps.num_qps = 1 << hca_param->log_num_qps; in mlx4_slave_cap()
999 dev->caps.num_srqs = 1 << hca_param->log_num_srqs; in mlx4_slave_cap()
1000 dev->caps.num_cqs = 1 << hca_param->log_num_cqs; in mlx4_slave_cap()
1001 dev->caps.num_mpts = 1 << hca_param->log_mpt_sz; in mlx4_slave_cap()
1002 dev->caps.num_eqs = func_cap->max_eq; in mlx4_slave_cap()
1003 dev->caps.reserved_eqs = func_cap->reserved_eq; in mlx4_slave_cap()
1004 dev->caps.reserved_lkey = func_cap->reserved_lkey; in mlx4_slave_cap()
1005 dev->caps.num_pds = MLX4_NUM_PDS; in mlx4_slave_cap()
1006 dev->caps.num_mgms = 0; in mlx4_slave_cap()
1007 dev->caps.num_amgms = 0; in mlx4_slave_cap()
1009 if (dev->caps.num_ports > MLX4_MAX_PORTS) { in mlx4_slave_cap()
1011 dev->caps.num_ports, MLX4_MAX_PORTS); in mlx4_slave_cap()
1020 mlx4_err(dev, "Set special QP caps failed. aborting\n"); in mlx4_slave_cap()
1024 if (dev->caps.uar_page_size * (dev->caps.num_uars - in mlx4_slave_cap()
1025 dev->caps.reserved_uars) > in mlx4_slave_cap()
1029 dev->caps.uar_page_size * dev->caps.num_uars, in mlx4_slave_cap()
1037 dev->caps.eqe_size = 64; in mlx4_slave_cap()
1038 dev->caps.eqe_factor = 1; in mlx4_slave_cap()
1040 dev->caps.eqe_size = 32; in mlx4_slave_cap()
1041 dev->caps.eqe_factor = 0; in mlx4_slave_cap()
1045 dev->caps.cqe_size = 64; in mlx4_slave_cap()
1046 dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; in mlx4_slave_cap()
1048 dev->caps.cqe_size = 32; in mlx4_slave_cap()
1052 dev->caps.eqe_size = hca_param->eqe_size; in mlx4_slave_cap()
1053 dev->caps.eqe_factor = 0; in mlx4_slave_cap()
1057 dev->caps.cqe_size = hca_param->cqe_size; in mlx4_slave_cap()
1059 dev->caps.userspace_caps |= MLX4_USER_DEV_CAP_LARGE_CQE; in mlx4_slave_cap()
1062 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; in mlx4_slave_cap()
1065 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_USER_MAC_EN; in mlx4_slave_cap()
1073 dev->caps.bf_reg_size) in mlx4_slave_cap()
1074 dev->caps.alloc_res_qp_mask |= MLX4_RESERVE_ETH_BF_QP; in mlx4_slave_cap()
1077 dev->caps.alloc_res_qp_mask |= MLX4_RESERVE_A0_QP; in mlx4_slave_cap()
1100 for (port = 0; port < dev->caps.num_ports; port++) { in mlx4_change_port_types()
1103 if (port_types[port] != dev->caps.port_type[port + 1]) in mlx4_change_port_types()
1108 for (port = 1; port <= dev->caps.num_ports; port++) { in mlx4_change_port_types()
1110 dev->caps.port_type[port] = port_types[port - 1]; in mlx4_change_port_types()
1140 (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_IB) ? in show_port_type()
1142 if (mdev->caps.possible_type[info->port] == MLX4_PORT_TYPE_AUTO) in show_port_type()
1160 if ((port_type & mdev->caps.supported_type[info->port]) != port_type) { in __set_port_type()
1172 mdev->caps.possible_type[info->port] = info->tmp_type; in __set_port_type()
1174 for (i = 0; i < mdev->caps.num_ports; i++) { in __set_port_type()
1176 mdev->caps.possible_type[i+1]; in __set_port_type()
1178 types[i] = mdev->caps.port_type[i+1]; in __set_port_type()
1181 if (!(mdev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP) && in __set_port_type()
1182 !(mdev->caps.flags & MLX4_DEV_CAP_FLAG_SENSE_SUPPORT)) { in __set_port_type()
1183 for (i = 1; i <= mdev->caps.num_ports; i++) { in __set_port_type()
1184 if (mdev->caps.possible_type[i] == MLX4_PORT_TYPE_AUTO) { in __set_port_type()
1185 mdev->caps.possible_type[i] = mdev->caps.port_type[i]; in __set_port_type()
1204 for (i = 0; i < mdev->caps.num_ports; i++) in __set_port_type()
1289 if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) in show_port_ib_mtu()
1293 ibta_mtu_to_int(mdev->caps.port_ib_mtu[info->port])); in show_port_ib_mtu()
1307 if (mdev->caps.port_type[info->port] == MLX4_PORT_TYPE_ETH) { in set_port_ib_mtu()
1321 mdev->caps.port_ib_mtu[info->port] = ibta_mtu; in set_port_ib_mtu()
1326 for (port = 1; port <= mdev->caps.num_ports; port++) { in set_port_ib_mtu()
1374 if (dev->caps.steering_mode != MLX4_STEERING_MODE_DEVICE_MANAGED) { in mlx4_mf_bond()
1479 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_PORT_REMAP)) in mlx4_port_map_set()
1615 cmpt_entry_sz, dev->caps.num_qps, in mlx4_init_cmpt_table()
1616 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], in mlx4_init_cmpt_table()
1625 cmpt_entry_sz, dev->caps.num_srqs, in mlx4_init_cmpt_table()
1626 dev->caps.reserved_srqs, 0, 0); in mlx4_init_cmpt_table()
1634 cmpt_entry_sz, dev->caps.num_cqs, in mlx4_init_cmpt_table()
1635 dev->caps.reserved_cqs, 0, 0); in mlx4_init_cmpt_table()
1714 * dev->caps.mtt_entry_sz below is really the MTT segment in mlx4_init_icm()
1717 dev->caps.reserved_mtts = in mlx4_init_icm()
1718 ALIGN(dev->caps.reserved_mtts * dev->caps.mtt_entry_sz, in mlx4_init_icm()
1719 dma_get_cache_alignment()) / dev->caps.mtt_entry_sz; in mlx4_init_icm()
1723 dev->caps.mtt_entry_sz, in mlx4_init_icm()
1724 dev->caps.num_mtts, in mlx4_init_icm()
1725 dev->caps.reserved_mtts, 1, 0); in mlx4_init_icm()
1734 dev->caps.num_mpts, in mlx4_init_icm()
1735 dev->caps.reserved_mrws, 1, 1); in mlx4_init_icm()
1744 dev->caps.num_qps, in mlx4_init_icm()
1745 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], in mlx4_init_icm()
1755 dev->caps.num_qps, in mlx4_init_icm()
1756 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], in mlx4_init_icm()
1766 dev->caps.num_qps, in mlx4_init_icm()
1767 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], in mlx4_init_icm()
1777 dev->caps.num_qps, in mlx4_init_icm()
1778 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW], in mlx4_init_icm()
1788 dev->caps.num_cqs, in mlx4_init_icm()
1789 dev->caps.reserved_cqs, 0, 0); in mlx4_init_icm()
1798 dev->caps.num_srqs, in mlx4_init_icm()
1799 dev->caps.reserved_srqs, 0, 0); in mlx4_init_icm()
1815 dev->caps.num_mgms + dev->caps.num_amgms, in mlx4_init_icm()
1816 dev->caps.num_mgms + dev->caps.num_amgms, in mlx4_init_icm()
1908 if (!dev->caps.bf_reg_size) in map_bf_area()
1912 (dev->caps.num_uars << PAGE_SHIFT); in map_bf_area()
1914 (dev->caps.num_uars << PAGE_SHIFT); in map_bf_area()
1973 if (!dev->caps.map_clock_to_user) { in mlx4_get_internal_clock_params()
2066 dev->caps.vf_caps |= MLX4_VF_CAP_FLAG_RESET; in mlx4_reset_vf_support()
2143 for (i = 1; i <= dev->caps.num_ports; i++) { in mlx4_parav_master_pf_caps()
2144 if (dev->caps.port_type[i] == MLX4_PORT_TYPE_ETH) in mlx4_parav_master_pf_caps()
2145 dev->caps.gid_table_len[i] = in mlx4_parav_master_pf_caps()
2148 dev->caps.gid_table_len[i] = 1; in mlx4_parav_master_pf_caps()
2149 dev->caps.pkey_table_len[i] = in mlx4_parav_master_pf_caps()
2197 if (dev->caps.dmfs_high_steer_mode == in choose_steering_mode()
2201 dev->caps.dmfs_high_steer_mode = in choose_steering_mode()
2215 dev->caps.steering_mode = MLX4_STEERING_MODE_DEVICE_MANAGED; in choose_steering_mode()
2216 dev->caps.num_qp_per_mgm = dev_cap->fs_max_num_qp_per_entry; in choose_steering_mode()
2217 dev->caps.fs_log_max_ucast_qp_range_size = in choose_steering_mode()
2220 if (dev->caps.dmfs_high_steer_mode != in choose_steering_mode()
2222 dev->caps.dmfs_high_steer_mode = MLX4_STEERING_DMFS_A0_DISABLE; in choose_steering_mode()
2223 if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER && in choose_steering_mode()
2224 dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) in choose_steering_mode()
2225 dev->caps.steering_mode = MLX4_STEERING_MODE_B0; in choose_steering_mode()
2227 dev->caps.steering_mode = MLX4_STEERING_MODE_A0; in choose_steering_mode()
2229 if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER || in choose_steering_mode()
2230 dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) in choose_steering_mode()
2237 dev->caps.num_qp_per_mgm = mlx4_get_qp_per_mgm(dev); in choose_steering_mode()
2240 mlx4_steering_mode_str(dev->caps.steering_mode), in choose_steering_mode()
2248 if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED && in choose_tunnel_offload_mode()
2250 dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_VXLAN; in choose_tunnel_offload_mode()
2252 dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_NONE; in choose_tunnel_offload_mode()
2254 mlx4_dbg(dev, "Tunneling offload mode is: %s\n", (dev->caps.tunnel_offload_mode in choose_tunnel_offload_mode()
2263 if (dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_NOT_SUPPORTED) in mlx4_validate_optimized_steering()
2266 for (i = 1; i <= dev->caps.num_ports; i++) { in mlx4_validate_optimized_steering()
2270 } else if ((dev->caps.dmfs_high_steer_mode != in mlx4_validate_optimized_steering()
2273 !!(dev->caps.dmfs_high_steer_mode == in mlx4_validate_optimized_steering()
2278 dev->caps.dmfs_high_steer_mode), in mlx4_validate_optimized_steering()
2347 if (dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_STATIC && in mlx4_init_hca()
2349 dev->caps.function_caps |= MLX4_FUNC_CAP_DMFS_A0_STATIC; in mlx4_init_hca()
2364 if (dev->caps.steering_mode == in mlx4_init_hca()
2376 init_hca->log_uar_sz = ilog2(dev->caps.num_uars) + in mlx4_init_hca()
2380 init_hca->log_uar_sz = ilog2(dev->caps.num_uars); in mlx4_init_hca()
2385 if (dev->caps.flags & MLX4_DEV_CAP_FLAG_MEM_WINDOW || in mlx4_init_hca()
2386 dev->caps.bmme_flags & MLX4_BMME_FLAG_TYPE_2_WIN) 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()
2415 if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) { in mlx4_init_hca()
2419 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; in mlx4_init_hca()
2421 dev->caps.hca_core_clock = in mlx4_init_hca()
2428 if (!dev->caps.hca_core_clock) { in mlx4_init_hca()
2429 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; in mlx4_init_hca()
2437 dev->caps.flags2 &= ~MLX4_DEV_CAP_FLAG2_TS; in mlx4_init_hca()
2442 if (dev->caps.dmfs_high_steer_mode != in mlx4_init_hca()
2447 if (dev->caps.dmfs_high_steer_mode == in mlx4_init_hca()
2449 dev->caps.dmfs_high_rate_qpn_base = in mlx4_init_hca()
2450 dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW]; in mlx4_init_hca()
2451 dev->caps.dmfs_high_rate_qpn_range = in mlx4_init_hca()
2457 dev->caps.dmfs_high_steer_mode)); in mlx4_init_hca()
2469 mlx4_err(dev, "Failed to obtain slave caps\n"); in mlx4_init_hca()
2492 dev->caps.rx_checksum_flags_port[1] = params.rx_csum_flags_port_1; in mlx4_init_hca()
2493 dev->caps.rx_checksum_flags_port[2] = params.rx_csum_flags_port_2; in mlx4_init_hca()
2530 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) in mlx4_init_counters_table()
2533 if (!dev->caps.max_counters) in mlx4_init_counters_table()
2536 nent_pow2 = roundup_pow_of_two(dev->caps.max_counters); in mlx4_init_counters_table()
2540 nent_pow2 - dev->caps.max_counters + 1); in mlx4_init_counters_table()
2545 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) in mlx4_cleanup_counters_table()
2548 if (!dev->caps.max_counters) in mlx4_cleanup_counters_table()
2559 for (port = 0; port < dev->caps.num_ports; port++) in mlx4_cleanup_default_counters()
2570 for (port = 0; port < dev->caps.num_ports; port++) in mlx4_allocate_default_counters()
2573 for (port = 0; port < dev->caps.num_ports; port++) { in mlx4_allocate_default_counters()
2605 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) in __mlx4_counter_alloc()
2658 if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)) in __mlx4_counter_free()
2843 for (port = 1; port <= dev->caps.num_ports; port++) { in mlx4_setup_hca()
2848 mlx4_warn(dev, "failed to get port %d default ib capabilities (%d). Continuing with caps = 0\n", in mlx4_setup_hca()
2850 dev->caps.ib_port_def_cap[port] = ib_port_default_caps; in mlx4_setup_hca()
2864 dev->caps.port_ib_mtu[port] = IB_MTU_2048; in mlx4_setup_hca()
2866 dev->caps.port_ib_mtu[port] = IB_MTU_4096; in mlx4_setup_hca()
2869 dev->caps.pkey_table_len[port] : -1); in mlx4_setup_hca()
2934 if (eqn > dev->caps.num_comp_vectors) in mlx4_init_affinity_hint()
2964 int nreq = min3(dev->caps.num_ports * in mlx4_enable_msi_x()
2966 dev->caps.num_eqs - dev->caps.reserved_eqs, in mlx4_enable_msi_x()
2987 dev->caps.num_comp_vectors = nreq - 1; in mlx4_enable_msi_x()
2991 dev->caps.num_ports); in mlx4_enable_msi_x()
2993 for (i = 0; i < dev->caps.num_comp_vectors + 1; i++) { in mlx4_enable_msi_x()
3000 if (MLX4_IS_LEGACY_EQ_MODE(dev->caps)) { in mlx4_enable_msi_x()
3002 dev->caps.num_ports); in mlx4_enable_msi_x()
3014 * (dev->caps.num_comp_vectors / dev->caps.num_ports) in mlx4_enable_msi_x()
3022 if ((dev->caps.num_comp_vectors > dev->caps.num_ports) && in mlx4_enable_msi_x()
3024 (dev->caps.num_comp_vectors / dev->caps.num_ports)) == in mlx4_enable_msi_x()
3026 /* If dev->caps.num_comp_vectors < dev->caps.num_ports, in mlx4_enable_msi_x()
3039 dev->caps.num_comp_vectors = 1; in mlx4_enable_msi_x()
3046 dev->caps.num_ports); in mlx4_enable_msi_x()
3096 dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH) in mlx4_init_port_info()
3099 dev->caps.port_type[port] == MLX4_PORT_TYPE_IB) in mlx4_init_port_info()
3177 int num_entries = dev->caps.num_ports; in mlx4_init_steering()
3198 int num_entries = dev->caps.num_ports; in mlx4_clear_steering()
3613 if (dev->caps.num_ports < 2 && in mlx4_load_one()
3618 dev->caps.num_ports); in mlx4_load_one()
3631 dev->caps.num_ports; in mlx4_load_one()
3672 dev->caps.num_comp_vectors = 1; in mlx4_load_one()
3692 for (port = 1; port <= dev->caps.num_ports; port++) { in mlx4_load_one()
4105 for (i = 0; i < dev->caps.num_ports; i++) { in mlx4_unload_one()
4106 dev->persist->curr_port_type[i] = dev->caps.port_type[i + 1]; in mlx4_unload_one()
4107 dev->persist->curr_port_poss_type[i] = dev->caps. in mlx4_unload_one()
4116 for (p = 1; p <= dev->caps.num_ports; p++) { in mlx4_unload_one()
4232 for (i = 0; i < dev->caps.num_ports; i++) in restore_current_port_types()
4233 dev->caps.possible_type[i + 1] = poss_types[i]; in restore_current_port_types()