Lines Matching full:pf

15 	struct ice_pf *pf = vsi->back;  in ice_vsi_cfg_netdev_tc()  local
31 dcbcfg = &pf->hw.port_info->local_dcbx_cfg; in ice_vsi_cfg_netdev_tc()
67 * @pf: pointer to PF structure
72 bool ice_is_pfc_causing_hung_q(struct ice_pf *pf, unsigned int txqueue) in ice_is_pfc_causing_hung_q() argument
79 vsi = ice_get_main_vsi(pf); in ice_is_pfc_causing_hung_q()
97 up2tc = rd32(&pf->hw, PRTDCB_TUP2TC); in ice_is_pfc_causing_hung_q()
111 ref_prio_xoff[i] = pf->stats.priority_xoff_rx[i]; in ice_is_pfc_causing_hung_q()
113 ice_update_dcb_stats(pf); in ice_is_pfc_causing_hung_q()
117 if (pf->stats.priority_xoff_rx[i] > ref_prio_xoff[i]) in ice_is_pfc_causing_hung_q()
231 * @pf: pointer to the PF struct
234 int ice_dcb_bwchk(struct ice_pf *pf, struct ice_dcbx_cfg *dcbcfg) in ice_dcb_bwchk() argument
259 dev_err(ice_pf_to_dev(pf), "Invalid config, total bandwidth must equal 100\n"); in ice_dcb_bwchk()
268 * @pf: pointer to the PF struct
272 int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked) in ice_pf_dcb_cfg() argument
276 struct device *dev = ice_pf_to_dev(pf); in ice_pf_dcb_cfg()
280 curr_cfg = &pf->hw.port_info->local_dcbx_cfg; in ice_pf_dcb_cfg()
283 if (!pf->hw.port_info->is_sw_lldp) in ice_pf_dcb_cfg()
289 set_bit(ICE_FLAG_DCB_ENA, pf->flags); in ice_pf_dcb_cfg()
292 clear_bit(ICE_FLAG_DCB_ENA, pf->flags); in ice_pf_dcb_cfg()
300 if (ice_dcb_bwchk(pf, new_cfg)) in ice_pf_dcb_cfg()
309 pf_vsi = ice_get_main_vsi(pf); in ice_pf_dcb_cfg()
311 dev_dbg(dev, "PF VSI doesn't exist\n"); in ice_pf_dcb_cfg()
330 if (pf->hw.port_info->is_sw_lldp) { in ice_pf_dcb_cfg()
331 ret = ice_set_dcb_cfg(pf->hw.port_info); in ice_pf_dcb_cfg()
340 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); in ice_pf_dcb_cfg()
346 ice_pf_dcb_recfg(pf); in ice_pf_dcb_cfg()
381 * @pf: board private structure
386 ice_dcb_need_recfg(struct ice_pf *pf, struct ice_dcbx_cfg *old_cfg, in ice_dcb_need_recfg() argument
389 struct device *dev = ice_pf_to_dev(pf); in ice_dcb_need_recfg()
432 * @pf: physical function instance
434 void ice_dcb_rebuild(struct ice_pf *pf) in ice_dcb_rebuild() argument
437 struct device *dev = ice_pf_to_dev(pf); in ice_dcb_rebuild()
441 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); in ice_dcb_rebuild()
447 mutex_lock(&pf->tc_mutex); in ice_dcb_rebuild()
449 if (!pf->hw.port_info->is_sw_lldp) in ice_dcb_rebuild()
450 ice_cfg_etsrec_defaults(pf->hw.port_info); in ice_dcb_rebuild()
452 ret = ice_set_dcb_cfg(pf->hw.port_info); in ice_dcb_rebuild()
458 if (!pf->hw.port_info->is_sw_lldp) { in ice_dcb_rebuild()
459 ret = ice_cfg_lldp_mib_change(&pf->hw, true); in ice_dcb_rebuild()
460 if (ret && !pf->hw.port_info->is_sw_lldp) { in ice_dcb_rebuild()
467 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); in ice_dcb_rebuild()
473 mutex_unlock(&pf->tc_mutex); in ice_dcb_rebuild()
481 mutex_unlock(&pf->tc_mutex); in ice_dcb_rebuild()
495 ice_pf_dcb_cfg(pf, err_cfg, false); in ice_dcb_rebuild()
498 mutex_unlock(&pf->tc_mutex); in ice_dcb_rebuild()
503 * @pf: PF to apply config to
506 static int ice_dcb_init_cfg(struct ice_pf *pf, bool locked) in ice_dcb_init_cfg() argument
512 pi = pf->hw.port_info; in ice_dcb_init_cfg()
519 dev_info(ice_pf_to_dev(pf), "Configuring initial DCB values\n"); in ice_dcb_init_cfg()
520 if (ice_pf_dcb_cfg(pf, newcfg, locked)) in ice_dcb_init_cfg()
530 * @pf: PF to apply config to
534 static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool ets_willing, bool locked) in ice_dcb_sw_dflt_cfg() argument
542 hw = &pf->hw; in ice_dcb_sw_dflt_cfg()
567 ret = ice_pf_dcb_cfg(pf, dcbcfg, locked); in ice_dcb_sw_dflt_cfg()
605 * @pf: pointer to the PF struct
609 static int ice_dcb_noncontig_cfg(struct ice_pf *pf) in ice_dcb_noncontig_cfg() argument
611 struct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->local_dcbx_cfg; in ice_dcb_noncontig_cfg()
612 struct device *dev = ice_pf_to_dev(pf); in ice_dcb_noncontig_cfg()
616 ret = ice_dcb_sw_dflt_cfg(pf, false, true); in ice_dcb_noncontig_cfg()
624 ret = ice_set_dcb_cfg(pf->hw.port_info); in ice_dcb_noncontig_cfg()
633 * @pf: pointer to the PF struct
639 void ice_pf_dcb_recfg(struct ice_pf *pf) in ice_pf_dcb_recfg() argument
641 struct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->local_dcbx_cfg; in ice_pf_dcb_recfg()
646 ice_for_each_vsi(pf, v) { in ice_pf_dcb_recfg()
647 struct ice_vsi *vsi = pf->vsi[v]; in ice_pf_dcb_recfg()
660 ice_dcb_noncontig_cfg(pf); in ice_pf_dcb_recfg()
668 dev_err(ice_pf_to_dev(pf), "Failed to config TC for VSI index: %d\n", in ice_pf_dcb_recfg()
680 * ice_init_pf_dcb - initialize DCB for a PF
681 * @pf: PF to initialize DCB for
684 int ice_init_pf_dcb(struct ice_pf *pf, bool locked) in ice_init_pf_dcb() argument
686 struct device *dev = ice_pf_to_dev(pf); in ice_init_pf_dcb()
688 struct ice_hw *hw = &pf->hw; in ice_init_pf_dcb()
700 pf->hw.func_caps.common_cap.maxtc); in ice_init_pf_dcb()
706 clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags); in ice_init_pf_dcb()
707 err = ice_dcb_sw_dflt_cfg(pf, true, locked); in ice_init_pf_dcb()
718 pf_vsi = ice_get_main_vsi(pf); in ice_init_pf_dcb()
727 pf->dcbx_cap = ice_dcb_get_mode(port_info, true); in ice_init_pf_dcb()
731 set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags); in ice_init_pf_dcb()
734 pf->dcbx_cap = ice_dcb_get_mode(port_info, false); in ice_init_pf_dcb()
736 err = ice_dcb_init_cfg(pf, locked); in ice_init_pf_dcb()
749 * @pf: PF whose stats needs to be updated
751 void ice_update_dcb_stats(struct ice_pf *pf) in ice_update_dcb_stats() argument
754 struct ice_hw *hw = &pf->hw; in ice_update_dcb_stats()
759 prev_ps = &pf->stats_prev; in ice_update_dcb_stats()
760 cur_ps = &pf->stats; in ice_update_dcb_stats()
764 pf->stat_prev_loaded, in ice_update_dcb_stats()
768 pf->stat_prev_loaded, in ice_update_dcb_stats()
772 pf->stat_prev_loaded, in ice_update_dcb_stats()
776 pf->stat_prev_loaded, in ice_update_dcb_stats()
780 pf->stat_prev_loaded, in ice_update_dcb_stats()
819 * @pf: ptr to ice_pf
823 ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf, in ice_dcb_process_lldp_set_mib_change() argument
827 struct device *dev = ice_pf_to_dev(pf); in ice_dcb_process_lldp_set_mib_change()
837 if (!(test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags))) in ice_dcb_process_lldp_set_mib_change()
840 if (pf->dcbx_cap & DCB_CAP_DCBX_HOST) { in ice_dcb_process_lldp_set_mib_change()
845 pi = pf->hw.port_info; in ice_dcb_process_lldp_set_mib_change()
868 mutex_lock(&pf->tc_mutex); in ice_dcb_process_lldp_set_mib_change()
871 tmp_dcbx_cfg = pf->hw.port_info->local_dcbx_cfg; in ice_dcb_process_lldp_set_mib_change()
877 ret = ice_get_dcb_cfg(pf->hw.port_info); in ice_dcb_process_lldp_set_mib_change()
889 pf->dcbx_cap = ice_dcb_get_mode(pi, false); in ice_dcb_process_lldp_set_mib_change()
891 need_reconfig = ice_dcb_need_recfg(pf, &tmp_dcbx_cfg, in ice_dcb_process_lldp_set_mib_change()
893 ice_dcbnl_flush_apps(pf, &tmp_dcbx_cfg, &pi->local_dcbx_cfg); in ice_dcb_process_lldp_set_mib_change()
900 set_bit(ICE_FLAG_DCB_ENA, pf->flags); in ice_dcb_process_lldp_set_mib_change()
903 clear_bit(ICE_FLAG_DCB_ENA, pf->flags); in ice_dcb_process_lldp_set_mib_change()
906 pf_vsi = ice_get_main_vsi(pf); in ice_dcb_process_lldp_set_mib_change()
908 dev_dbg(dev, "PF VSI doesn't exist\n"); in ice_dcb_process_lldp_set_mib_change()
915 ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); in ice_dcb_process_lldp_set_mib_change()
922 ice_pf_dcb_recfg(pf); in ice_dcb_process_lldp_set_mib_change()
928 mutex_unlock(&pf->tc_mutex); in ice_dcb_process_lldp_set_mib_change()