Lines Matching refs:ppd

61 	struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);  in hfi1_lookup_pkey_value()  local
63 if (pkey_idx < ARRAY_SIZE(ppd->pkeys)) in hfi1_lookup_pkey_value()
64 return ppd->pkeys[pkey_idx]; in hfi1_lookup_pkey_value()
256 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in hfi1_create_qp0_ah() local
257 struct hfi1_devdata *dd = dd_from_ppd(ppd); in hfi1_create_qp0_ah()
258 u32 port_num = ppd->port; in hfi1_create_qp0_ah()
635 static void set_link_width_enabled(struct hfi1_pportdata *ppd, u32 w) in set_link_width_enabled() argument
637 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_LWID_ENB, w); in set_link_width_enabled()
640 static void set_link_width_downgrade_enabled(struct hfi1_pportdata *ppd, u32 w) in set_link_width_downgrade_enabled() argument
642 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_LWID_DG_ENB, w); in set_link_width_downgrade_enabled()
645 static void set_link_speed_enabled(struct hfi1_pportdata *ppd, u32 s) in set_link_speed_enabled() argument
647 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_SPD_ENB, s); in set_link_speed_enabled()
760 struct hfi1_pportdata *ppd; in __subn_get_opa_portinfo() local
779 ppd = dd->pport + (port - 1); in __subn_get_opa_portinfo()
780 ibp = &ppd->ibport_data; in __subn_get_opa_portinfo()
782 if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || in __subn_get_opa_portinfo()
783 ppd->vls_supported > ARRAY_SIZE(dd->vld)) { in __subn_get_opa_portinfo()
788 pi->lid = cpu_to_be32(ppd->lid); in __subn_get_opa_portinfo()
800 pi->sm_trap_qp = cpu_to_be32(ppd->sm_trap_qp); in __subn_get_opa_portinfo()
801 pi->sa_qp = cpu_to_be32(ppd->sa_qp); in __subn_get_opa_portinfo()
803 pi->link_width.enabled = cpu_to_be16(ppd->link_width_enabled); in __subn_get_opa_portinfo()
804 pi->link_width.supported = cpu_to_be16(ppd->link_width_supported); in __subn_get_opa_portinfo()
805 pi->link_width.active = cpu_to_be16(ppd->link_width_active); in __subn_get_opa_portinfo()
808 cpu_to_be16(ppd->link_width_downgrade_supported); in __subn_get_opa_portinfo()
810 cpu_to_be16(ppd->link_width_downgrade_enabled); in __subn_get_opa_portinfo()
812 cpu_to_be16(ppd->link_width_downgrade_tx_active); in __subn_get_opa_portinfo()
814 cpu_to_be16(ppd->link_width_downgrade_rx_active); in __subn_get_opa_portinfo()
816 pi->link_speed.supported = cpu_to_be16(ppd->link_speed_supported); in __subn_get_opa_portinfo()
817 pi->link_speed.active = cpu_to_be16(ppd->link_speed_active); in __subn_get_opa_portinfo()
818 pi->link_speed.enabled = cpu_to_be16(ppd->link_speed_enabled); in __subn_get_opa_portinfo()
820 state = driver_lstate(ppd); in __subn_get_opa_portinfo()
823 ppd->is_sm_config_started = 1; in __subn_get_opa_portinfo()
825 pi->port_phys_conf = (ppd->port_type & 0xf); in __subn_get_opa_portinfo()
827 pi->port_states.ledenable_offlinereason = ppd->neighbor_normal << 4; in __subn_get_opa_portinfo()
829 ppd->is_sm_config_started << 5; in __subn_get_opa_portinfo()
836 is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active); in __subn_get_opa_portinfo()
839 ppd->offline_disabled_reason; in __subn_get_opa_portinfo()
842 (driver_pstate(ppd) << 4) | state; in __subn_get_opa_portinfo()
844 pi->mkeyprotect_lmc = (ibp->rvp.mkeyprot << 6) | ppd->lmc; in __subn_get_opa_portinfo()
847 for (i = 0; i < ppd->vls_supported; i++) { in __subn_get_opa_portinfo()
858 pi->operational_vls = hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS); in __subn_get_opa_portinfo()
860 (ppd->linkinit_reason & OPA_PI_MASK_LINKINIT_REASON); in __subn_get_opa_portinfo()
861 if (ppd->part_enforce & HFI1_PART_ENFORCE_IN) in __subn_get_opa_portinfo()
863 if (ppd->part_enforce & HFI1_PART_ENFORCE_OUT) in __subn_get_opa_portinfo()
870 pi->vl.cap = ppd->vls_supported; in __subn_get_opa_portinfo()
872 pi->vl.arb_high_cap = (u8)hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_CAP); in __subn_get_opa_portinfo()
873 pi->vl.arb_low_cap = (u8)hfi1_get_ib_cfg(ppd, HFI1_IB_CFG_VL_LOW_CAP); in __subn_get_opa_portinfo()
881 pi->port_ltp_crc_mode = cpu_to_be16(ppd->port_ltp_crc_mode); in __subn_get_opa_portinfo()
884 ppd->is_active_optimize_enabled ? in __subn_get_opa_portinfo()
909 pi->link_down_reason = ppd->local_link_down_reason.sma; in __subn_get_opa_portinfo()
910 pi->neigh_link_down_reason = ppd->neigh_link_down_reason.sma; in __subn_get_opa_portinfo()
911 pi->port_error_action = cpu_to_be32(ppd->port_error_action); in __subn_get_opa_portinfo()
922 pi->neigh_node_guid = cpu_to_be64(ppd->neighbor_guid); in __subn_get_opa_portinfo()
923 pi->neigh_port_num = ppd->neighbor_port_number; in __subn_get_opa_portinfo()
925 (ppd->neighbor_type & OPA_PI_MASK_NEIGH_NODE_TYPE) | in __subn_get_opa_portinfo()
926 (ppd->mgmt_allowed ? OPA_PI_MASK_NEIGH_MGMT_ALLOWED : 0) | in __subn_get_opa_portinfo()
927 (ppd->neighbor_fm_security ? in __subn_get_opa_portinfo()
972 struct hfi1_pportdata *ppd = dd->pport + port - 1; in get_pkeys() local
974 memcpy(pkeys, ppd->pkeys, sizeof(ppd->pkeys)); in get_pkeys()
1150 static int port_states_transition_allowed(struct hfi1_pportdata *ppd, in port_states_transition_allowed() argument
1153 u32 physical_old = driver_pstate(ppd); in port_states_transition_allowed()
1154 u32 logical_old = driver_lstate(ppd); in port_states_transition_allowed()
1198 static int set_port_states(struct hfi1_pportdata *ppd, struct opa_smp *smp, in set_port_states() argument
1201 struct hfi1_devdata *dd = ppd->dd; in set_port_states()
1205 ret = port_states_transition_allowed(ppd, logical_state, phys_state); in set_port_states()
1239 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_FM_BOUNCE, in set_port_states()
1259 set_link_state(ppd, HLS_DN_OFFLINE); in set_port_states()
1260 start_link(ppd); in set_port_states()
1262 set_link_state(ppd, link_state); in set_port_states()
1265 (ppd->offline_disabled_reason > in set_port_states()
1267 ppd->offline_disabled_reason == in set_port_states()
1269 ppd->offline_disabled_reason = in set_port_states()
1279 ret = set_link_state(ppd, HLS_UP_ARMED); in set_port_states()
1284 if (ppd->neighbor_normal) { in set_port_states()
1285 ret = set_link_state(ppd, HLS_UP_ACTIVE); in set_port_states()
1316 struct hfi1_pportdata *ppd; in __subn_set_opa_portinfo() local
1358 ppd = dd->pport + (port - 1); in __subn_set_opa_portinfo()
1359 ibp = &ppd->ibport_data; in __subn_set_opa_portinfo()
1363 ls_old = driver_lstate(ppd); in __subn_set_opa_portinfo()
1379 } else if (ppd->lid != lid || in __subn_set_opa_portinfo()
1380 ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC)) { in __subn_set_opa_portinfo()
1381 if (ppd->lid != lid) in __subn_set_opa_portinfo()
1382 hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LID_CHANGE_BIT); in __subn_set_opa_portinfo()
1383 if (ppd->lmc != (pi->mkeyprotect_lmc & OPA_PI_MASK_LMC)) in __subn_set_opa_portinfo()
1384 hfi1_set_uevent_bits(ppd, _HFI1_EVENT_LMC_CHANGE_BIT); in __subn_set_opa_portinfo()
1385 hfi1_set_lid(ppd, lid, pi->mkeyprotect_lmc & OPA_PI_MASK_LMC); in __subn_set_opa_portinfo()
1393 ppd->guids[HFI1_PORT_GUID_INDEX + 1] = in __subn_set_opa_portinfo()
1402 ppd->linkinit_reason = in __subn_set_opa_portinfo()
1430 ppd->local_link_down_reason.sma = 0; in __subn_set_opa_portinfo()
1431 ppd->local_link_down_reason.latest = 0; in __subn_set_opa_portinfo()
1435 ppd->neigh_link_down_reason.sma = 0; in __subn_set_opa_portinfo()
1436 ppd->neigh_link_down_reason.latest = 0; in __subn_set_opa_portinfo()
1439 ppd->sm_trap_qp = be32_to_cpu(pi->sm_trap_qp); in __subn_set_opa_portinfo()
1440 ppd->sa_qp = be32_to_cpu(pi->sa_qp); in __subn_set_opa_portinfo()
1442 ppd->port_error_action = be32_to_cpu(pi->port_error_action); in __subn_set_opa_portinfo()
1447 set_link_width_enabled(ppd, ppd->link_width_supported); in __subn_set_opa_portinfo()
1448 else if ((lwe & ~ppd->link_width_supported) == 0) in __subn_set_opa_portinfo()
1449 set_link_width_enabled(ppd, lwe); in __subn_set_opa_portinfo()
1457 set_link_width_downgrade_enabled(ppd, in __subn_set_opa_portinfo()
1458 ppd-> in __subn_set_opa_portinfo()
1461 } else if ((lwe & ~ppd->link_width_downgrade_supported) == 0) { in __subn_set_opa_portinfo()
1463 if (lwe != ppd->link_width_downgrade_enabled) { in __subn_set_opa_portinfo()
1464 set_link_width_downgrade_enabled(ppd, lwe); in __subn_set_opa_portinfo()
1473 set_link_speed_enabled(ppd, lse); in __subn_set_opa_portinfo()
1481 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_VL_HIGH_LIMIT, in __subn_set_opa_portinfo()
1484 if (ppd->vls_supported / 2 > ARRAY_SIZE(pi->neigh_mtu.pvlx_to_mtu) || in __subn_set_opa_portinfo()
1485 ppd->vls_supported > ARRAY_SIZE(dd->vld)) { in __subn_set_opa_portinfo()
1489 for (i = 0; i < ppd->vls_supported; i++) { in __subn_set_opa_portinfo()
1525 set_mtu(ppd); in __subn_set_opa_portinfo()
1530 if (vls > ppd->vls_supported) { in __subn_set_opa_portinfo()
1535 if (hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_OP_VLS, in __subn_set_opa_portinfo()
1558 ppd->port_crc_mode_enabled = port_ltp_to_cap(crc_enabled); in __subn_set_opa_portinfo()
1560 ppd->is_active_optimize_enabled = in __subn_set_opa_portinfo()
1572 ppd->is_sm_config_started = 1; in __subn_set_opa_portinfo()
1574 if (ppd->is_sm_config_started == 0) { in __subn_set_opa_portinfo()
1595 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_portinfo()
1613 apply_link_downgrade_policy(ppd, 0); in __subn_set_opa_portinfo()
1630 struct hfi1_pportdata *ppd; in set_pkeys() local
1641 ppd = dd->pport + (port - 1); in set_pkeys()
1645 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) { in set_pkeys()
1655 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); i++) { in set_pkeys()
1657 u16 okey = ppd->pkeys[i]; in set_pkeys()
1666 ppd->pkeys[i] = key; in set_pkeys()
1671 (void)hfi1_set_ib_cfg(ppd, HFI1_IB_CFG_PKEYS, 0); in set_pkeys()
1911 struct hfi1_pportdata *ppd; in __subn_set_opa_sc_to_vlt() local
1927 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlt()
1928 lstate = driver_lstate(ppd); in __subn_set_opa_sc_to_vlt()
1951 struct hfi1_pportdata *ppd; in __subn_get_opa_sc_to_vlnt() local
1960 ppd = dd->pport + (port - 1); in __subn_get_opa_sc_to_vlnt()
1962 fm_get_table(ppd, FM_TBL_SC2VLNT, vp); in __subn_get_opa_sc_to_vlnt()
1976 struct hfi1_pportdata *ppd; in __subn_set_opa_sc_to_vlnt() local
1987 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlnt()
1988 lstate = driver_lstate(ppd); in __subn_set_opa_sc_to_vlnt()
1994 ppd = dd->pport + (port - 1); in __subn_set_opa_sc_to_vlnt()
1996 fm_set_table(ppd, FM_TBL_SC2VLNT, vp); in __subn_set_opa_sc_to_vlnt()
2010 struct hfi1_pportdata *ppd; in __subn_get_opa_psi() local
2019 ppd = ppd_from_ibp(ibp); in __subn_get_opa_psi()
2021 lstate = driver_lstate(ppd); in __subn_get_opa_psi()
2024 ppd->is_sm_config_started = 1; in __subn_get_opa_psi()
2026 psi->port_states.ledenable_offlinereason = ppd->neighbor_normal << 4; in __subn_get_opa_psi()
2028 ppd->is_sm_config_started << 5; in __subn_get_opa_psi()
2030 ppd->offline_disabled_reason; in __subn_get_opa_psi()
2033 (driver_pstate(ppd) << 4) | (lstate & 0xf); in __subn_get_opa_psi()
2035 cpu_to_be16(ppd->link_width_downgrade_tx_active); in __subn_get_opa_psi()
2037 cpu_to_be16(ppd->link_width_downgrade_rx_active); in __subn_get_opa_psi()
2053 struct hfi1_pportdata *ppd; in __subn_set_opa_psi() local
2063 ppd = ppd_from_ibp(ibp); in __subn_set_opa_psi()
2065 ls_old = driver_lstate(ppd); in __subn_set_opa_psi()
2073 ppd->is_sm_config_started = 1; in __subn_set_opa_psi()
2075 if (ppd->is_sm_config_started == 0) { in __subn_set_opa_psi()
2083 ret = set_port_states(ppd, smp, ls_new, ps_new, local_mad); in __subn_set_opa_psi()
2150 struct hfi1_pportdata *ppd; in __subn_get_opa_bct() local
2159 ppd = dd->pport + (port - 1); in __subn_get_opa_bct()
2160 fm_get_table(ppd, FM_TBL_BUFFER_CONTROL, p); in __subn_get_opa_bct()
2174 struct hfi1_pportdata *ppd; in __subn_set_opa_bct() local
2181 ppd = dd->pport + (port - 1); in __subn_set_opa_bct()
2183 if (fm_set_table(ppd, FM_TBL_BUFFER_CONTROL, p) < 0) { in __subn_set_opa_bct()
2196 struct hfi1_pportdata *ppd = ppd_from_ibp(to_iport(ibdev, port)); in __subn_get_opa_vl_arb() local
2209 fm_get_table(ppd, FM_TBL_VL_LOW_ARB, p); in __subn_get_opa_vl_arb()
2212 fm_get_table(ppd, FM_TBL_VL_HIGH_ARB, p); in __subn_get_opa_vl_arb()
2215 fm_get_table(ppd, FM_TBL_VL_PREEMPT_ELEMS, p); in __subn_get_opa_vl_arb()
2218 fm_get_table(ppd, FM_TBL_VL_PREEMPT_MATRIX, p); in __subn_get_opa_vl_arb()
2238 struct hfi1_pportdata *ppd = ppd_from_ibp(to_iport(ibdev, port)); in __subn_set_opa_vl_arb() local
2251 (void)fm_set_table(ppd, FM_TBL_VL_LOW_ARB, p); in __subn_set_opa_vl_arb()
2254 (void)fm_set_table(ppd, FM_TBL_VL_HIGH_ARB, p); in __subn_set_opa_vl_arb()
2584 static void a0_portstatus(struct hfi1_pportdata *ppd, in a0_portstatus() argument
2587 if (!is_bx(ppd->dd)) { in a0_portstatus()
2594 read_port_cntr(ppd, C_TX_WAIT_VL, in a0_portstatus()
2650 u64 get_xmit_wait_counters(struct hfi1_pportdata *ppd, in get_xmit_wait_counters() argument
2661 read_port_cntr(ppd, C_TX_WAIT_VL, vl); in get_xmit_wait_counters()
2664 read_port_cntr(ppd, C_TX_WAIT, CNTR_INVALID_VL); in get_xmit_wait_counters()
2668 ppd->port_vl_xmit_wait_last[vl]; in get_xmit_wait_counters()
2671 ppd->prev_link_width, in get_xmit_wait_counters()
2674 ppd->vl_xmit_flit_cnt[vl] += delta_vl_xmit_wait; in get_xmit_wait_counters()
2675 ppd->port_vl_xmit_wait_last[vl] = port_vl_xmit_wait_curr; in get_xmit_wait_counters()
2676 ppd->prev_link_width = link_width; in get_xmit_wait_counters()
2678 return ppd->vl_xmit_flit_cnt[vl]; in get_xmit_wait_counters()
2697 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_portstatus() local
2724 cpu_to_be64(read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in pma_get_opa_portstatus()
2749 tx_link_width(ppd->link_width_downgrade_tx_active); in pma_get_opa_portstatus()
2750 link_speed = get_link_speed(ppd->link_speed_active); in pma_get_opa_portstatus()
2752 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_portstatus()
2759 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD, in pma_get_opa_portstatus()
2762 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in pma_get_opa_portstatus()
2786 rsp->link_downed = cpu_to_be32(read_port_cntr(ppd, C_SW_LINK_DOWN, in pma_get_opa_portstatus()
2811 cpu_to_be64(read_port_cntr(ppd, C_TX_FLIT_VL, in pma_get_opa_portstatus()
2815 cpu_to_be64(read_port_cntr(ppd, C_TX_PKT_VL, in pma_get_opa_portstatus()
2822 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_portstatus()
2835 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_get_opa_portstatus()
2841 a0_portstatus(ppd, rsp); in pma_get_opa_portstatus()
2854 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in get_error_counter_summary() local
2857 error_counter_summary += read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in get_error_counter_summary()
2860 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_DSCD, in get_error_counter_summary()
2862 error_counter_summary += read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in get_error_counter_summary()
2879 error_counter_summary += read_port_cntr(ppd, C_SW_LINK_DOWN, in get_error_counter_summary()
2888 static void a0_datacounters(struct hfi1_pportdata *ppd, struct _port_dctrs *rsp) in a0_datacounters() argument
2890 if (!is_bx(ppd->dd)) { in a0_datacounters()
2897 read_port_cntr(ppd, C_TX_WAIT_VL, in a0_datacounters()
2940 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_datacounters() local
3007 tx_link_width(ppd->link_width_downgrade_tx_active); in pma_get_opa_datacounters()
3008 link_speed = get_link_speed(ppd->link_speed_active); in pma_get_opa_datacounters()
3010 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_datacounters()
3031 cpu_to_be64(read_port_cntr(ppd, C_TX_FLIT_VL, in pma_get_opa_datacounters()
3039 cpu_to_be64(read_port_cntr(ppd, C_TX_PKT_VL, in pma_get_opa_datacounters()
3051 cpu_to_be64(get_xmit_wait_counters(ppd, link_width, in pma_get_opa_datacounters()
3075 a0_datacounters(ppd, rsp); in pma_get_opa_datacounters()
3117 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_get_opa_port_ectrs() local
3129 rsp->link_downed = cpu_to_be32(read_port_cntr(ppd, C_SW_LINK_DOWN, in pma_get_opa_port_ectrs()
3138 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD, in pma_get_opa_port_ectrs()
3141 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, in pma_get_opa_port_ectrs()
3144 cpu_to_be64(read_port_cntr(ppd, C_SW_RCV_CSTR_ERR, in pma_get_opa_port_ectrs()
3166 struct hfi1_pportdata *ppd; in pma_get_opa_porterrors() local
3207 ppd = ppd_from_ibp(ibp); in pma_get_opa_porterrors()
3231 cpu_to_be64(read_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_get_opa_porterrors()
3435 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in pma_set_opa_portstatus() local
3471 write_port_cntr(ppd, C_TX_WAIT, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3472 ppd->port_vl_xmit_wait_last[C_VL_COUNT] = 0; in pma_set_opa_portstatus()
3473 ppd->vl_xmit_flit_cnt[C_VL_COUNT] = 0; in pma_set_opa_portstatus()
3495 write_port_cntr(ppd, C_SW_RCV_CSTR_ERR, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3499 write_port_cntr(ppd, C_SW_XMIT_DSCD, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3502 write_port_cntr(ppd, C_SW_XMIT_CSTR_ERR, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3528 write_port_cntr(ppd, C_SW_LINK_DOWN, CNTR_INVALID_VL, 0); in pma_set_opa_portstatus()
3535 write_port_cntr(ppd, C_TX_FLIT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3541 write_port_cntr(ppd, C_TX_PKT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3547 write_port_cntr(ppd, C_TX_WAIT_VL, idx_from_vl(vl), 0); in pma_set_opa_portstatus()
3548 ppd->port_vl_xmit_wait_last[idx_from_vl(vl)] = 0; in pma_set_opa_portstatus()
3549 ppd->vl_xmit_flit_cnt[idx_from_vl(vl)] = 0; in pma_set_opa_portstatus()
3569 write_port_cntr(ppd, C_SW_XMIT_DSCD_VL, in pma_set_opa_portstatus()
3669 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cong_info() local
3677 p->control_table_cap = ppd->cc_max_table_entries; in __subn_get_opa_cong_info()
3694 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cong_setting() local
3705 cc_state = get_cc_state(ppd); in __subn_get_opa_cong_setting()
3735 static void apply_cc_state(struct hfi1_pportdata *ppd) in apply_cc_state() argument
3747 spin_lock(&ppd->cc_state_lock); in apply_cc_state()
3749 old_cc_state = get_cc_state_protected(ppd); in apply_cc_state()
3752 spin_unlock(&ppd->cc_state_lock); in apply_cc_state()
3759 if (ppd->total_cct_entry) in apply_cc_state()
3760 new_cc_state->cct.ccti_limit = ppd->total_cct_entry - 1; in apply_cc_state()
3764 memcpy(new_cc_state->cct.entries, ppd->ccti_entries, in apply_cc_state()
3765 ppd->total_cct_entry * sizeof(struct ib_cc_table_entry)); in apply_cc_state()
3768 new_cc_state->cong_setting.control_map = ppd->cc_sl_control_map; in apply_cc_state()
3769 memcpy(new_cc_state->cong_setting.entries, ppd->congestion_entries, in apply_cc_state()
3772 rcu_assign_pointer(ppd->cc_state, new_cc_state); in apply_cc_state()
3774 spin_unlock(&ppd->cc_state_lock); in apply_cc_state()
3786 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_set_opa_cong_setting() local
3799 spin_lock(&ppd->cc_state_lock); in __subn_set_opa_cong_setting()
3800 ppd->cc_sl_control_map = be32_to_cpu(p->control_map); in __subn_set_opa_cong_setting()
3802 entries = ppd->congestion_entries; in __subn_set_opa_cong_setting()
3810 spin_unlock(&ppd->cc_state_lock); in __subn_set_opa_cong_setting()
3813 apply_cc_state(ppd); in __subn_set_opa_cong_setting()
3824 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_hfi1_cong_log() local
3834 spin_lock_irq(&ppd->cc_log_lock); in __subn_get_opa_hfi1_cong_log()
3839 cpu_to_be16(ppd->threshold_event_counter); in __subn_get_opa_hfi1_cong_log()
3841 ppd->threshold_cong_event_map, in __subn_get_opa_hfi1_cong_log()
3848 &ppd->cc_events[ppd->cc_mad_idx++]; in __subn_get_opa_hfi1_cong_log()
3849 if (ppd->cc_mad_idx == OPA_CONG_LOG_ELEMS) in __subn_get_opa_hfi1_cong_log()
3850 ppd->cc_mad_idx = 0; in __subn_get_opa_hfi1_cong_log()
3873 memset(ppd->threshold_cong_event_map, 0x0, in __subn_get_opa_hfi1_cong_log()
3874 sizeof(ppd->threshold_cong_event_map)); in __subn_get_opa_hfi1_cong_log()
3875 ppd->threshold_event_counter = 0; in __subn_get_opa_hfi1_cong_log()
3877 spin_unlock_irq(&ppd->cc_log_lock); in __subn_get_opa_hfi1_cong_log()
3892 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_get_opa_cc_table() local
3903 start_block + n_blocks > ppd->cc_max_table_entries) { in __subn_get_opa_cc_table()
3910 cc_state = get_cc_state(ppd); in __subn_get_opa_cc_table()
3943 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in __subn_set_opa_cc_table() local
3954 start_block + n_blocks > ppd->cc_max_table_entries) { in __subn_set_opa_cc_table()
3974 spin_lock(&ppd->cc_state_lock); in __subn_set_opa_cc_table()
3975 ppd->total_cct_entry = ccti_limit + 1; in __subn_set_opa_cc_table()
3976 entries = ppd->ccti_entries; in __subn_set_opa_cc_table()
3979 spin_unlock(&ppd->cc_state_lock); in __subn_set_opa_cc_table()
3982 apply_cc_state(ppd); in __subn_set_opa_cc_table()
4001 struct hfi1_pportdata *ppd = dd->pport; in __subn_get_opa_led_info() local
4017 is_beaconing_active = !!atomic_read(&ppd->led_override_timer_active); in __subn_get_opa_led_info()
4340 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in is_full_mgmt_pkey_in_table() local
4342 for (i = 0; i < ARRAY_SIZE(ppd->pkeys); ++i) in is_full_mgmt_pkey_in_table()
4343 if (ppd->pkeys[i] == FULL_MGMT_P_KEY) in is_full_mgmt_pkey_in_table()
4356 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in is_local_mad() local
4365 return (in_wc->slid == ppd->lid); in is_local_mad()
4381 struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); in opa_local_smp_check() local
4384 if (in_wc->pkey_index >= ARRAY_SIZE(ppd->pkeys)) in opa_local_smp_check()
4387 pkey = ppd->pkeys[in_wc->pkey_index]; in opa_local_smp_check()
4408 ingress_pkey_table_fail(ppd, pkey, in_wc->slid); in opa_local_smp_check()