Lines Matching refs:ppd
103 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in hfi1_lookup_pkey_value() local
105 if (pkey_idx < ARRAY_SIZE(ppd->pkeys)) in hfi1_lookup_pkey_value()
106 return ppd->pkeys[pkey_idx]; in hfi1_lookup_pkey_value()
298 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in hfi1_create_qp0_ah() local
299 struct hfi1_devdata *dd = dd_from_ppd(ppd); in hfi1_create_qp0_ah()
300 u8 port_num = ppd->port; in hfi1_create_qp0_ah()
677 static void set_link_width_enabled(struct hfi1_pportdata *ppd, u32 w) in set_link_width_enabled() argument
679 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_LWID_ENB, w); in set_link_width_enabled()
682 static void set_link_width_downgrade_enabled(struct hfi1_pportdata *ppd, u32 w) in set_link_width_downgrade_enabled() argument
684 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_LWID_DG_ENB, w); in set_link_width_downgrade_enabled()
687 static void set_link_speed_enabled(struct hfi1_pportdata *ppd, u32 s) in set_link_speed_enabled() argument
689 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_SPD_ENB, s); in set_link_speed_enabled()
802 struct hfi1_pportdata *ppd; in __subn_get_opa_portinfo() local
821 ppd = dd->pport + (port - 1); in __subn_get_opa_portinfo()
822 ibp = &ppd->ibport_data; in __subn_get_opa_portinfo()
824 if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || in __subn_get_opa_portinfo()
825 ppd->vls_supported > ARRAY_SIZE(dd->vld)) { in __subn_get_opa_portinfo()
830 pi->lid = cpu_to_be32(ppd->lid); in __subn_get_opa_portinfo()
842 pi->sm_trap_qp = cpu_to_be32(ppd->sm_trap_qp); in __subn_get_opa_portinfo()
843 pi->sa_qp = cpu_to_be32(ppd->sa_qp); in __subn_get_opa_portinfo()
845 pi->link_width.enabled = cpu_to_be16(ppd->link_width_enabled); in __subn_get_opa_portinfo()
846 pi->link_width.supported = cpu_to_be16(ppd->link_width_supported); in __subn_get_opa_portinfo()
847 pi->link_width.active = cpu_to_be16(ppd->link_width_active); in __subn_get_opa_portinfo()
850 cpu_to_be16(ppd->link_width_downgrade_supported); in __subn_get_opa_portinfo()
852 cpu_to_be16(ppd->link_width_downgrade_enabled); in __subn_get_opa_portinfo()
854 cpu_to_be16(ppd->link_width_downgrade_tx_active); in __subn_get_opa_portinfo()
856 cpu_to_be16(ppd->link_width_downgrade_rx_active); in __subn_get_opa_portinfo()
858 pi->link_speed.supported = cpu_to_be16(ppd->link_speed_supported); in __subn_get_opa_portinfo()
859 pi->link_speed.active = cpu_to_be16(ppd->link_speed_active); in __subn_get_opa_portinfo()
860 pi->link_speed.enabled = cpu_to_be16(ppd->link_speed_enabled); in __subn_get_opa_portinfo()
862 state = driver_lstate(ppd); in __subn_get_opa_portinfo()
865 ppd->is_sm_config_started = 1; in __subn_get_opa_portinfo()
867 pi->port_phys_conf = (ppd->port_type & 0xf); in __subn_get_opa_portinfo()
869 pi->port_states.ledenable_offlinereason = ppd->neighbor_normal << 4; in __subn_get_opa_portinfo()
871 ppd->is_sm_config_started << 5; in __subn_get_opa_portinfo()
878 is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active); in __subn_get_opa_portinfo()
881 ppd->offline_disabled_reason; in __subn_get_opa_portinfo()
884 (driver_pstate(ppd) << 4) | state; in __subn_get_opa_portinfo()
886 pi->mkeyprotect_lmc = (ibp->rvp.mkeyprot << 6) | ppd->lmc; in __subn_get_opa_portinfo()
889 for (i = 0; i < ppd->vls_supported; i++) { in __subn_get_opa_portinfo()
900 pi->operational_vls = hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS); in __subn_get_opa_portinfo()
902 (ppd->linkinit_reason & OPA_PI_MASK_LINKINIT_REASON); in __subn_get_opa_portinfo()
903 if (ppd->part_enforce & HFI1_PART_ENFORCE_IN) in __subn_get_opa_portinfo()
905 if (ppd->part_enforce & HFI1_PART_ENFORCE_OUT) in __subn_get_opa_portinfo()
912 pi->vl.cap = ppd->vls_supported; in __subn_get_opa_portinfo()
914 pi->vl.arb_high_cap = (u8)hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_CAP); in __subn_get_opa_portinfo()
915 pi->vl.arb_low_cap = (u8)hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_VL_LOW_CAP); in __subn_get_opa_portinfo()
923 pi->port_ltp_crc_mode = cpu_to_be16(ppd->port_ltp_crc_mode); in __subn_get_opa_portinfo()
926 ppd->is_active_optimize_enabled ? in __subn_get_opa_portinfo()
951 pi->link_down_reason = ppd->local_link_down_reason.sma; in __subn_get_opa_portinfo()
952 pi->neigh_link_down_reason = ppd->neigh_link_down_reason.sma; in __subn_get_opa_portinfo()
953 pi->port_error_action = cpu_to_be32(ppd->port_error_action); in __subn_get_opa_portinfo()
964 pi->neigh_node_guid = cpu_to_be64(ppd->neighbor_guid); in __subn_get_opa_portinfo()
965 pi->neigh_port_num = ppd->neighbor_port_number; in __subn_get_opa_portinfo()
967 (ppd->neighbor_type & OPA_PI_MASK_NEIGH_NODE_TYPE) | in __subn_get_opa_portinfo()
968 (ppd->mgmt_allowed ? OPA_PI_MASK_NEIGH_MGMT_ALLOWED : 0) | in __subn_get_opa_portinfo()
969 (ppd->neighbor_fm_security ? in __subn_get_opa_portinfo()
1014 struct hfi1_pportdata *ppd = dd->pport + port - 1; in get_pkeys() local
1016 memcpy(pkeys, ppd->pkeys, sizeof(ppd->pkeys)); in get_pkeys()
1192 static int port_states_transition_allowed(struct hfi1_pportdata *ppd, in port_states_transition_allowed() argument
1195 u32 physical_old = driver_pstate(ppd); in port_states_transition_allowed()
1196 u32 logical_old = driver_lstate(ppd); in port_states_transition_allowed()
1240 static int set_port_states(struct hfi1_pportdata *ppd, struct opa_smp *smp, in set_port_states() argument
1243 struct hfi1_devdata *dd = ppd->dd; in set_port_states()
1247 ret = port_states_transition_allowed(ppd, logical_state, phys_state); in set_port_states()
1281 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_FM_BOUNCE, in set_port_states()
1301 set_link_state(ppd, HLS_DN_OFFLINE); in set_port_states()
1302 start_link(ppd); in set_port_states()
1304 set_link_state(ppd, link_state); in set_port_states()
1307 (ppd->offline_disabled_reason > in set_port_states()
1309 ppd->offline_disabled_reason == in set_port_states()
1311 ppd->offline_disabled_reason = in set_port_states()
1321 ret = set_link_state(ppd, HLS_UP_ARMED); in set_port_states()
1326 if (ppd->neighbor_normal) { in set_port_states()
1327 ret = set_link_state(ppd, HLS_UP_ACTIVE); in set_port_states()
1358 struct hfi1_pportdata *ppd; in __subn_set_opa_portinfo() local
1400 ppd = dd->pport + (port - 1); in __subn_set_opa_portinfo()
1401 ibp = &ppd->ibport_data; in __subn_set_opa_portinfo()
1405 ls_old = driver_lstate(ppd); in __subn_set_opa_portinfo()
1421 } else if (ppd->lid != lid || in __subn_set_opa_portinfo()
1422 ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC)) { in __subn_set_opa_portinfo()
1423 if (ppd->lid != lid) in __subn_set_opa_portinfo()
1424 hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LID_CHANGE_BIT); in __subn_set_opa_portinfo()
1425 if (ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC)) in __subn_set_opa_portinfo()
1426 hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LMC_CHANGE_BIT); in __subn_set_opa_portinfo()
1427 hfi1_set_lid(ppd, lid, pi->mkeyprotect_lmc & OPA_PI_MASK_LMC); in __subn_set_opa_portinfo()
1435 ppd->guids[HFI1_PORT_GUID_INDEX + 1] = in __subn_set_opa_portinfo()
1444 ppd->linkinit_reason = in __subn_set_opa_portinfo()
1472 ppd->local_link_down_reason.sma = 0; in __subn_set_opa_portinfo()
1473 ppd->local_link_down_reason.latest = 0; in __subn_set_opa_portinfo()
1477 ppd->neigh_link_down_reason.sma = 0; in __subn_set_opa_portinfo()
1478 ppd->neigh_link_down_reason.latest = 0; in __subn_set_opa_portinfo()
1481 ppd->sm_trap_qp = be32_to_cpu(pi->sm_trap_qp); in __subn_set_opa_portinfo()
1482 ppd->sa_qp = be32_to_cpu(pi->sa_qp); in __subn_set_opa_portinfo()
1484 ppd->port_error_action = be32_to_cpu(pi->port_error_action); in __subn_set_opa_portinfo()
1489 set_link_width_enabled(ppd, ppd->link_width_supported); in __subn_set_opa_portinfo()
1490 else if ((lwe & ~ppd->link_width_supported) == 0) in __subn_set_opa_portinfo()
1491 set_link_width_enabled(ppd, lwe); in __subn_set_opa_portinfo()
1499 set_link_width_downgrade_enabled(ppd, in __subn_set_opa_portinfo()
1500 ppd-> in __subn_set_opa_portinfo()
1503 } else if ((lwe & ~ppd->link_width_downgrade_supported) == 0) { in __subn_set_opa_portinfo()
1505 if (lwe != ppd->link_width_downgrade_enabled) { in __subn_set_opa_portinfo()
1506 set_link_width_downgrade_enabled(ppd, lwe); in __subn_set_opa_portinfo()
1515 set_link_speed_enabled(ppd, lse); in __subn_set_opa_portinfo()
1523 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_LIMIT, in __subn_set_opa_portinfo()
1526 if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || in __subn_set_opa_portinfo()
1527 ppd->vls_supported > ARRAY_SIZE(dd->vld)) { in __subn_set_opa_portinfo()
1531 for (i = 0; i < ppd->vls_supported; i++) { in __subn_set_opa_portinfo()
1567 set_mtu(ppd); in __subn_set_opa_portinfo()
1572 if (vls > ppd->vls_supported) { in __subn_set_opa_portinfo()
1577 if (hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS, in __subn_set_opa_portinfo()
1600 ppd->port_crc_mode_enabled = port_ltp_to_cap(crc_enabled); in __subn_set_opa_portinfo()
1602 ppd->is_active_optimize_enabled = in __subn_set_opa_portinfo()
1614 ppd->is_sm_config_started = 1; in __subn_set_opa_portinfo()
1616 if (ppd->is_sm_config_started == 0) { in __subn_set_opa_portinfo()
1637 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_portinfo()
1655 apply_link_downgrade_policy(ppd, 0); in __subn_set_opa_portinfo()
1672 struct hfi1_pportdata *ppd; in set_pkeys() local
1683 ppd = dd->pport + (port - 1); in set_pkeys()
1687 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) { in set_pkeys()
1697 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) { in set_pkeys()
1699 u16 okey = ppd->pkeys[i]; in set_pkeys()
1708 ppd->pkeys[i] = key; in set_pkeys()
1713 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); in set_pkeys()
1953 struct hfi1_pportdata *ppd; in __subn_set_opa_sc_to_vlt() local
1969 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlt()
1970 lstate = driver_lstate(ppd); in __subn_set_opa_sc_to_vlt()
1993 struct hfi1_pportdata *ppd; in __subn_get_opa_sc_to_vlnt() local
2002 ppd = dd->pport + (port - 1); in __subn_get_opa_sc_to_vlnt()
2004 fm_get_table(ppd, FM_TBL_SC2VLNT, vp); in __subn_get_opa_sc_to_vlnt()
2018 struct hfi1_pportdata *ppd; in __subn_set_opa_sc_to_vlnt() local
2029 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlnt()
2030 lstate = driver_lstate(ppd); in __subn_set_opa_sc_to_vlnt()
2036 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlnt()
2038 fm_set_table(ppd, FM_TBL_SC2VLNT, vp); in __subn_set_opa_sc_to_vlnt()
2052 struct hfi1_pportdata *ppd; in __subn_get_opa_psi() local
2061 ppd = ppd_from_ibp(ibp); in __subn_get_opa_psi()
2063 lstate = driver_lstate(ppd); in __subn_get_opa_psi()
2066 ppd->is_sm_config_started = 1; in __subn_get_opa_psi()
2068 psi->port_states.ledenable_offlinereason = ppd->neighbor_normal << 4; in __subn_get_opa_psi()
2070 ppd->is_sm_config_started << 5; in __subn_get_opa_psi()
2072 ppd->offline_disabled_reason; in __subn_get_opa_psi()
2075 (driver_pstate(ppd) << 4) | (lstate & 0xf); in __subn_get_opa_psi()
2077 cpu_to_be16(ppd->link_width_downgrade_tx_active); in __subn_get_opa_psi()
2079 cpu_to_be16(ppd->link_width_downgrade_rx_active); in __subn_get_opa_psi()
2095 struct hfi1_pportdata *ppd; in __subn_set_opa_psi() local
2105 ppd = ppd_from_ibp(ibp); in __subn_set_opa_psi()
2107 ls_old = driver_lstate(ppd); in __subn_set_opa_psi()
2115 ppd->is_sm_config_started = 1; in __subn_set_opa_psi()
2117 if (ppd->is_sm_config_started == 0) { in __subn_set_opa_psi()
2125 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_psi()
2192 struct hfi1_pportdata *ppd; in __subn_get_opa_bct() local
2201 ppd = dd->pport + (port - 1); in __subn_get_opa_bct()
2202 fm_get_table(ppd, FM_TBL_BUFFER_CONTROL, p); in __subn_get_opa_bct()
2216 struct hfi1_pportdata *ppd; in __subn_set_opa_bct() local
2223 ppd = dd->pport + (port - 1); in __subn_set_opa_bct()
2225 if (fm_set_table(ppd, FM_TBL_BUFFER_CONTROL, p) < 0) { in __subn_set_opa_bct()
2238 struct hfi1_pportdata *ppd = ppd_from_ibp(to_iport(ibdev, port)); in __subn_get_opa_vl_arb() local
2251 fm_get_table(ppd, FM_TBL_VL_LOW_ARB, p); in __subn_get_opa_vl_arb()
2254 fm_get_table(ppd, FM_TBL_VL_HIGH_ARB, p); in __subn_get_opa_vl_arb()
2257 fm_get_table(ppd, FM_TBL_VL_PREEMPT_ELEMS, p); in __subn_get_opa_vl_arb()
2260 fm_get_table(ppd, FM_TBL_VL_PREEMPT_MATRIX, p); in __subn_get_opa_vl_arb()
2280 struct hfi1_pportdata *ppd = ppd_from_ibp(to_iport(ibdev, port)); in __subn_set_opa_vl_arb() local
2293 (void)fm_set_table(ppd, FM_TBL_VL_LOW_ARB, p); in __subn_set_opa_vl_arb()
2296 (void)fm_set_table(ppd, FM_TBL_VL_HIGH_ARB, p); in __subn_set_opa_vl_arb()
2626 static void a0_portstatus(struct hfi1_pportdata *ppd, in a0_portstatus() argument
2629 if (!is_bx(ppd->dd)) { in a0_portstatus()
2636 read_port_cntr(ppd, C_TX_WAIT_VL, in a0_portstatus()
2692 u64 get_xmit_wait_counters(struct hfi1_pportdata *ppd, in get_xmit_wait_counters() argument
2703 read_port_cntr(ppd, C_TX_WAIT_VL, vl); in get_xmit_wait_counters()
2706 read_port_cntr(ppd, C_TX_WAIT, CNTR_INVALID_VL); in get_xmit_wait_counters()
2710 ppd->port_vl_xmit_wait_last[vl]; in get_xmit_wait_counters()
2713 ppd->prev_link_width, in get_xmit_wait_counters()
2716 ppd->vl_xmit_flit_cnt[vl] += delta_vl_xmit_wait; in get_xmit_wait_counters()
2717 ppd->port_vl_xmit_wait_last[vl] = port_vl_xmit_wait_curr; in get_xmit_wait_counters()
2718 ppd->prev_link_width = link_width; in get_xmit_wait_counters()
2720 return ppd->vl_xmit_flit_cnt[vl]; in get_xmit_wait_counters()
2739 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_portstatus() local
2766 cpu_to_be64(read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in pma_get_opa_portstatus()
2791 tx_link_width(ppd->link_width_downgrade_tx_active); in pma_get_opa_portstatus()
2792 link_speed = get_link_speed(ppd->link_speed_active); in pma_get_opa_portstatus()
2794 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_portstatus()
2801 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD, in pma_get_opa_portstatus()
2804 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in pma_get_opa_portstatus()
2828 rsp->link_downed = cpu_to_be32(read_port_cntr(ppd, C_SW_LINK_DOWN, in pma_get_opa_portstatus()
2853 cpu_to_be64(read_port_cntr(ppd, C_TX_FLIT_VL, in pma_get_opa_portstatus()
2857 cpu_to_be64(read_port_cntr(ppd, C_TX_PKT_VL, in pma_get_opa_portstatus()
2864 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_portstatus()
2877 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_get_opa_portstatus()
2883 a0_portstatus(ppd, rsp); in pma_get_opa_portstatus()
2896 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in get_error_counter_summary() local
2899 error_counter_summary += read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in get_error_counter_summary()
2902 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_DSCD, in get_error_counter_summary()
2904 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in get_error_counter_summary()
2921 error_counter_summary += read_port_cntr(ppd, C_SW_LINK_DOWN, in get_error_counter_summary()
2930 static void a0_datacounters(struct hfi1_pportdata *ppd, struct _port_dctrs *rsp) in a0_datacounters() argument
2932 if (!is_bx(ppd->dd)) { in a0_datacounters()
2939 read_port_cntr(ppd, C_TX_WAIT_VL, in a0_datacounters()
2982 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_datacounters() local
3049 tx_link_width(ppd->link_width_downgrade_tx_active); in pma_get_opa_datacounters()
3050 link_speed = get_link_speed(ppd->link_speed_active); in pma_get_opa_datacounters()
3052 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_datacounters()
3073 cpu_to_be64(read_port_cntr(ppd, C_TX_FLIT_VL, in pma_get_opa_datacounters()
3081 cpu_to_be64(read_port_cntr(ppd, C_TX_PKT_VL, in pma_get_opa_datacounters()
3093 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_datacounters()
3117 a0_datacounters(ppd, rsp); in pma_get_opa_datacounters()
3159 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_port_ectrs() local
3171 rsp->link_downed = cpu_to_be32(read_port_cntr(ppd, C_SW_LINK_DOWN, in pma_get_opa_port_ectrs()
3180 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD, in pma_get_opa_port_ectrs()
3183 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in pma_get_opa_port_ectrs()
3186 cpu_to_be64(read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in pma_get_opa_port_ectrs()
3208 struct hfi1_pportdata *ppd; in pma_get_opa_porterrors() local
3249 ppd = ppd_from_ibp(ibp); in pma_get_opa_porterrors()
3273 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_get_opa_porterrors()
3477 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_set_opa_portstatus() local
3513 write_port_cntr(ppd, C_TX_WAIT, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3514 ppd->port_vl_xmit_wait_last[C_VL_COUNT] = 0; in pma_set_opa_portstatus()
3515 ppd->vl_xmit_flit_cnt[C_VL_COUNT] = 0; in pma_set_opa_portstatus()
3537 write_port_cntr(ppd, C_SW_RCV_CSTR_ERR, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3541 write_port_cntr(ppd, C_SW_XMIT_DSCD, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3544 write_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3570 write_port_cntr(ppd, C_SW_LINK_DOWN, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3577 write_port_cntr(ppd, C_TX_FLIT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3583 write_port_cntr(ppd, C_TX_PKT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3589 write_port_cntr(ppd, C_TX_WAIT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3590 ppd->port_vl_xmit_wait_last[idx_from_vl(vl)] = 0; in pma_set_opa_portstatus()
3591 ppd->vl_xmit_flit_cnt[idx_from_vl(vl)] = 0; in pma_set_opa_portstatus()
3611 write_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_set_opa_portstatus()
3711 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cong_info() local
3719 p->control_table_cap = ppd->cc_max_table_entries; in __subn_get_opa_cong_info()
3736 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cong_setting() local
3747 cc_state = get_cc_state(ppd); in __subn_get_opa_cong_setting()
3777 static void apply_cc_state(struct hfi1_pportdata *ppd) in apply_cc_state() argument
3789 spin_lock(&ppd->cc_state_lock); in apply_cc_state()
3791 old_cc_state = get_cc_state_protected(ppd); in apply_cc_state()
3794 spin_unlock(&ppd->cc_state_lock); in apply_cc_state()
3801 if (ppd->total_cct_entry) in apply_cc_state()
3802 new_cc_state->cct.ccti_limit = ppd->total_cct_entry - 1; in apply_cc_state()
3806 memcpy(new_cc_state->cct.entries, ppd->ccti_entries, in apply_cc_state()
3807 ppd->total_cct_entry * sizeof(struct ib_cc_table_entry)); in apply_cc_state()
3810 new_cc_state->cong_setting.control_map = ppd->cc_sl_control_map; in apply_cc_state()
3811 memcpy(new_cc_state->cong_setting.entries, ppd->congestion_entries, in apply_cc_state()
3814 rcu_assign_pointer(ppd->cc_state, new_cc_state); in apply_cc_state()
3816 spin_unlock(&ppd->cc_state_lock); in apply_cc_state()
3828 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_set_opa_cong_setting() local
3841 spin_lock(&ppd->cc_state_lock); in __subn_set_opa_cong_setting()
3842 ppd->cc_sl_control_map = be32_to_cpu(p->control_map); in __subn_set_opa_cong_setting()
3844 entries = ppd->congestion_entries; in __subn_set_opa_cong_setting()
3852 spin_unlock(&ppd->cc_state_lock); in __subn_set_opa_cong_setting()
3855 apply_cc_state(ppd); in __subn_set_opa_cong_setting()
3866 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_hfi1_cong_log() local
3876 spin_lock_irq(&ppd->cc_log_lock); in __subn_get_opa_hfi1_cong_log()
3881 cpu_to_be16(ppd->threshold_event_counter); in __subn_get_opa_hfi1_cong_log()
3883 ppd->threshold_cong_event_map, in __subn_get_opa_hfi1_cong_log()
3890 &ppd->cc_events[ppd->cc_mad_idx++]; in __subn_get_opa_hfi1_cong_log()
3891 if (ppd->cc_mad_idx == OPA_CONG_LOG_ELEMS) in __subn_get_opa_hfi1_cong_log()
3892 ppd->cc_mad_idx = 0; in __subn_get_opa_hfi1_cong_log()
3915 memset(ppd->threshold_cong_event_map, 0x0, in __subn_get_opa_hfi1_cong_log()
3916 sizeof(ppd->threshold_cong_event_map)); in __subn_get_opa_hfi1_cong_log()
3917 ppd->threshold_event_counter = 0; in __subn_get_opa_hfi1_cong_log()
3919 spin_unlock_irq(&ppd->cc_log_lock); in __subn_get_opa_hfi1_cong_log()
3934 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cc_table() local
3945 start_block + n_blocks > ppd->cc_max_table_entries) { in __subn_get_opa_cc_table()
3952 cc_state = get_cc_state(ppd); in __subn_get_opa_cc_table()
3985 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_set_opa_cc_table() local
3996 start_block + n_blocks > ppd->cc_max_table_entries) { in __subn_set_opa_cc_table()
4016 spin_lock(&ppd->cc_state_lock); in __subn_set_opa_cc_table()
4017 ppd->total_cct_entry = ccti_limit + 1; in __subn_set_opa_cc_table()
4018 entries = ppd->ccti_entries; in __subn_set_opa_cc_table()
4021 spin_unlock(&ppd->cc_state_lock); in __subn_set_opa_cc_table()
4024 apply_cc_state(ppd); in __subn_set_opa_cc_table()
4043 struct hfi1_pportdata *ppd = dd->pport; in __subn_get_opa_led_info() local
4059 is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active); in __subn_get_opa_led_info()
4382 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in is_full_mgmt_pkey_in_table() local
4384 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); ++i) in is_full_mgmt_pkey_in_table()
4385 if (ppd->pkeys[i] == FULL_MGMT_P_KEY) in is_full_mgmt_pkey_in_table()
4398 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in is_local_mad() local
4407 return (in_wc->slid == ppd->lid); in is_local_mad()
4423 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in opa_local_smp_check() local
4426 if (in_wc->pkey_index >= ARRAY_SIZE(ppd->pkeys)) in opa_local_smp_check()
4429 pkey = ppd->pkeys[in_wc->pkey_index]; in opa_local_smp_check()
4450 ingress_pkey_table_fail(ppd, pkey, in_wc->slid); in opa_local_smp_check()