Lines Matching full:pf
37 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_ieee_getets() local
40 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) in i40e_dcbnl_ieee_getets()
43 dcbxcfg = &pf->hw.local_dcbx_config; in i40e_dcbnl_ieee_getets()
75 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_ieee_getpfc() local
77 struct i40e_hw *hw = &pf->hw; in i40e_dcbnl_ieee_getpfc()
80 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE)) in i40e_dcbnl_ieee_getpfc()
91 pfc->requests[i] = pf->stats.priority_xoff_tx[i]; in i40e_dcbnl_ieee_getpfc()
92 pfc->indications[i] = pf->stats.priority_xoff_rx[i]; in i40e_dcbnl_ieee_getpfc()
108 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_ieee_setets() local
112 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || in i40e_dcbnl_ieee_setets()
113 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_ieee_setets()
116 old_cfg = &pf->hw.local_dcbx_config; in i40e_dcbnl_ieee_setets()
118 pf->tmp_cfg = *old_cfg; in i40e_dcbnl_ieee_setets()
121 pf->tmp_cfg.etscfg.willing = ets->willing; in i40e_dcbnl_ieee_setets()
122 pf->tmp_cfg.etscfg.maxtcs = I40E_MAX_TRAFFIC_CLASS; in i40e_dcbnl_ieee_setets()
123 pf->tmp_cfg.etscfg.cbs = ets->cbs; in i40e_dcbnl_ieee_setets()
125 pf->tmp_cfg.etscfg.tcbwtable[i] = ets->tc_tx_bw[i]; in i40e_dcbnl_ieee_setets()
126 pf->tmp_cfg.etscfg.tsatable[i] = ets->tc_tsa[i]; in i40e_dcbnl_ieee_setets()
127 pf->tmp_cfg.etscfg.prioritytable[i] = ets->prio_tc[i]; in i40e_dcbnl_ieee_setets()
128 pf->tmp_cfg.etsrec.tcbwtable[i] = ets->tc_reco_bw[i]; in i40e_dcbnl_ieee_setets()
129 pf->tmp_cfg.etsrec.tsatable[i] = ets->tc_reco_tsa[i]; in i40e_dcbnl_ieee_setets()
130 pf->tmp_cfg.etsrec.prioritytable[i] = ets->reco_prio_tc[i]; in i40e_dcbnl_ieee_setets()
134 ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); in i40e_dcbnl_ieee_setets()
136 dev_info(&pf->pdev->dev, in i40e_dcbnl_ieee_setets()
139 i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); in i40e_dcbnl_ieee_setets()
156 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_ieee_setpfc() local
160 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || in i40e_dcbnl_ieee_setpfc()
161 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_ieee_setpfc()
164 old_cfg = &pf->hw.local_dcbx_config; in i40e_dcbnl_ieee_setpfc()
166 pf->tmp_cfg = *old_cfg; in i40e_dcbnl_ieee_setpfc()
168 pf->tmp_cfg.pfc.pfccap = pfc->pfc_cap; in i40e_dcbnl_ieee_setpfc()
170 pf->tmp_cfg.pfc.pfccap = I40E_MAX_TRAFFIC_CLASS; in i40e_dcbnl_ieee_setpfc()
171 pf->tmp_cfg.pfc.pfcenable = pfc->pfc_en; in i40e_dcbnl_ieee_setpfc()
173 ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); in i40e_dcbnl_ieee_setpfc()
175 dev_info(&pf->pdev->dev, in i40e_dcbnl_ieee_setpfc()
178 i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); in i40e_dcbnl_ieee_setpfc()
195 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_ieee_setapp() local
200 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || in i40e_dcbnl_ieee_setapp()
201 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_ieee_setapp()
204 old_cfg = &pf->hw.local_dcbx_config; in i40e_dcbnl_ieee_setapp()
220 pf->tmp_cfg = *old_cfg; in i40e_dcbnl_ieee_setapp()
222 pf->tmp_cfg.app[pf->tmp_cfg.numapps++] = new_app; in i40e_dcbnl_ieee_setapp()
224 ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); in i40e_dcbnl_ieee_setapp()
226 dev_info(&pf->pdev->dev, in i40e_dcbnl_ieee_setapp()
229 i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); in i40e_dcbnl_ieee_setapp()
247 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_ieee_delapp() local
251 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) || in i40e_dcbnl_ieee_delapp()
252 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_ieee_delapp()
259 old_cfg = &pf->hw.local_dcbx_config; in i40e_dcbnl_ieee_delapp()
265 pf->tmp_cfg = *old_cfg; in i40e_dcbnl_ieee_delapp()
268 for (i = 1; i < pf->tmp_cfg.numapps; i++) { in i40e_dcbnl_ieee_delapp()
269 if (app->selector == pf->tmp_cfg.app[i].selector && in i40e_dcbnl_ieee_delapp()
270 app->protocol == pf->tmp_cfg.app[i].protocolid && in i40e_dcbnl_ieee_delapp()
271 app->priority == pf->tmp_cfg.app[i].priority) { in i40e_dcbnl_ieee_delapp()
273 pf->tmp_cfg.app[i].selector = 0; in i40e_dcbnl_ieee_delapp()
274 pf->tmp_cfg.app[i].protocolid = 0; in i40e_dcbnl_ieee_delapp()
275 pf->tmp_cfg.app[i].priority = 0; in i40e_dcbnl_ieee_delapp()
281 if (i == pf->tmp_cfg.numapps) in i40e_dcbnl_ieee_delapp()
284 pf->tmp_cfg.numapps--; in i40e_dcbnl_ieee_delapp()
286 for (j = i; j < pf->tmp_cfg.numapps; j++) in i40e_dcbnl_ieee_delapp()
287 pf->tmp_cfg.app[j] = old_cfg->app[j + 1]; in i40e_dcbnl_ieee_delapp()
289 ret = i40e_hw_dcb_config(pf, &pf->tmp_cfg); in i40e_dcbnl_ieee_delapp()
291 dev_info(&pf->pdev->dev, in i40e_dcbnl_ieee_delapp()
294 i40e_aq_str(&pf->hw, pf->hw.aq.asq_last_status)); in i40e_dcbnl_ieee_delapp()
309 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_getstate() local
311 dev_dbg(&pf->pdev->dev, "DCB state=%d\n", in i40e_dcbnl_getstate()
312 test_bit(I40E_FLAG_DCB_ENA, pf->flags) ? 1 : 0); in i40e_dcbnl_getstate()
313 return test_bit(I40E_FLAG_DCB_ENA, pf->flags) ? 1 : 0; in i40e_dcbnl_getstate()
325 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_setstate() local
328 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_setstate()
329 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_setstate()
332 dev_dbg(&pf->pdev->dev, "new state=%d current state=%d\n", in i40e_dcbnl_setstate()
333 state, test_bit(I40E_FLAG_DCB_ENA, pf->flags) ? 1 : 0); in i40e_dcbnl_setstate()
335 if (!state == !test_bit(I40E_FLAG_DCB_ENA, pf->flags)) in i40e_dcbnl_setstate()
338 if (i40e_is_sw_dcb(pf)) { in i40e_dcbnl_setstate()
340 set_bit(I40E_FLAG_DCB_ENA, pf->flags); in i40e_dcbnl_setstate()
341 memcpy(&pf->hw.desired_dcbx_config, in i40e_dcbnl_setstate()
342 &pf->hw.local_dcbx_config, in i40e_dcbnl_setstate()
345 clear_bit(I40E_FLAG_DCB_ENA, pf->flags); in i40e_dcbnl_setstate()
369 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_set_pg_tc_cfg_tx() local
372 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_set_pg_tc_cfg_tx()
373 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_set_pg_tc_cfg_tx()
385 pf->tmp_cfg.etscfg.prioritytable[i] = tc; in i40e_dcbnl_set_pg_tc_cfg_tx()
387 pf->tmp_cfg.etscfg.tsatable[tc] = I40E_IEEE_TSA_ETS; in i40e_dcbnl_set_pg_tc_cfg_tx()
388 dev_dbg(&pf->pdev->dev, in i40e_dcbnl_set_pg_tc_cfg_tx()
404 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_set_pg_bwg_cfg_tx() local
406 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_set_pg_bwg_cfg_tx()
407 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_set_pg_bwg_cfg_tx()
414 pf->tmp_cfg.etscfg.tcbwtable[pgid] = bw_pct; in i40e_dcbnl_set_pg_bwg_cfg_tx()
415 dev_dbg(&pf->pdev->dev, "Set PG BW config tc=%d bw_pct=%d\n", in i40e_dcbnl_set_pg_bwg_cfg_tx()
438 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_set_pg_tc_cfg_rx() local
440 dev_dbg(&pf->pdev->dev, "Rx TC PG Config Not Supported.\n"); in i40e_dcbnl_set_pg_tc_cfg_rx()
455 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_set_pg_bwg_cfg_rx() local
457 dev_dbg(&pf->pdev->dev, "Rx BWG PG Config Not Supported.\n"); in i40e_dcbnl_set_pg_bwg_cfg_rx()
477 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_pg_tc_cfg_tx() local
479 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_get_pg_tc_cfg_tx()
480 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_get_pg_tc_cfg_tx()
486 *pgid = pf->hw.local_dcbx_config.etscfg.prioritytable[prio]; in i40e_dcbnl_get_pg_tc_cfg_tx()
487 dev_dbg(&pf->pdev->dev, "Get PG config prio=%d tc=%d\n", in i40e_dcbnl_get_pg_tc_cfg_tx()
502 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_pg_bwg_cfg_tx() local
504 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_get_pg_bwg_cfg_tx()
505 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_get_pg_bwg_cfg_tx()
511 *bw_pct = pf->hw.local_dcbx_config.etscfg.tcbwtable[pgid]; in i40e_dcbnl_get_pg_bwg_cfg_tx()
512 dev_dbg(&pf->pdev->dev, "Get PG BW config tc=%d bw_pct=%d\n", in i40e_dcbnl_get_pg_bwg_cfg_tx()
533 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_pg_tc_cfg_rx() local
535 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_get_pg_tc_cfg_rx()
536 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_get_pg_tc_cfg_rx()
542 *pgid = pf->hw.local_dcbx_config.etscfg.prioritytable[prio]; in i40e_dcbnl_get_pg_tc_cfg_rx()
558 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_pg_bwg_cfg_rx() local
560 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_get_pg_bwg_cfg_rx()
561 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_get_pg_bwg_cfg_rx()
577 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_set_pfc_cfg() local
579 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_set_pfc_cfg()
580 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_set_pfc_cfg()
586 pf->tmp_cfg.pfc.pfccap = I40E_MAX_TRAFFIC_CLASS; in i40e_dcbnl_set_pfc_cfg()
588 pf->tmp_cfg.pfc.pfcenable |= BIT(prio); in i40e_dcbnl_set_pfc_cfg()
590 pf->tmp_cfg.pfc.pfcenable &= ~BIT(prio); in i40e_dcbnl_set_pfc_cfg()
591 dev_dbg(&pf->pdev->dev, in i40e_dcbnl_set_pfc_cfg()
593 prio, setting, pf->tmp_cfg.pfc.pfcenable); in i40e_dcbnl_set_pfc_cfg()
607 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_pfc_cfg() local
609 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_get_pfc_cfg()
610 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_get_pfc_cfg()
616 *setting = (pf->hw.local_dcbx_config.pfc.pfcenable >> prio) & 0x1; in i40e_dcbnl_get_pfc_cfg()
617 dev_dbg(&pf->pdev->dev, in i40e_dcbnl_get_pfc_cfg()
619 prio, *setting, pf->hw.local_dcbx_config.pfc.pfcenable); in i40e_dcbnl_get_pfc_cfg()
630 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_cee_set_all() local
633 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_cee_set_all()
634 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_cee_set_all()
637 dev_dbg(&pf->pdev->dev, "Commit DCB Configuration to the hardware\n"); in i40e_dcbnl_cee_set_all()
638 err = i40e_hw_dcb_config(pf, &pf->tmp_cfg); in i40e_dcbnl_cee_set_all()
653 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_get_cap() local
655 if (!test_bit(I40E_FLAG_DCB_CAPABLE, pf->flags)) in i40e_dcbnl_get_cap()
668 *cap = pf->dcbx_cap; in i40e_dcbnl_get_cap()
678 dev_dbg(&pf->pdev->dev, "Get Capability cap=%d capval=0x%x\n", in i40e_dcbnl_get_cap()
693 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_getnumtcs() local
695 if (!test_bit(I40E_FLAG_DCB_CAPABLE, pf->flags)) in i40e_dcbnl_getnumtcs()
723 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_getpfcstate() local
726 if (pf->hw.local_dcbx_config.pfc.pfcenable) in i40e_dcbnl_getpfcstate()
742 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_setpfcstate() local
744 dev_dbg(&pf->pdev->dev, "PFC State is modified via PFC config.\n"); in i40e_dcbnl_setpfcstate()
757 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_getapp() local
763 if (!(pf->dcbx_cap & DCB_CAP_DCBX_VER_CEE) || in i40e_dcbnl_getapp()
764 (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED)) in i40e_dcbnl_getapp()
779 struct i40e_pf *pf = i40e_netdev_to_pf(netdev); in i40e_dcbnl_setdcbx() local
782 if (pf->dcbx_cap & DCB_CAP_DCBX_LLD_MANAGED) in i40e_dcbnl_setdcbx()
792 if (mode == pf->dcbx_cap) in i40e_dcbnl_setdcbx()
795 pf->dcbx_cap = mode; in i40e_dcbnl_setdcbx()
797 pf->hw.local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_CEE; in i40e_dcbnl_setdcbx()
799 pf->hw.local_dcbx_config.dcbx_mode = I40E_DCBX_MODE_IEEE; in i40e_dcbnl_setdcbx()
801 dev_dbg(&pf->pdev->dev, "mode=%d\n", mode); in i40e_dcbnl_setdcbx()
813 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_getdcbx() local
815 return pf->dcbx_cap; in i40e_dcbnl_getdcbx()
828 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_get_perm_hw_addr() local
834 perm_addr[i] = pf->hw.mac.perm_addr[i]; in i40e_dcbnl_get_perm_hw_addr()
878 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_set_all() local
880 struct i40e_hw *hw = &pf->hw; in i40e_dcbnl_set_all()
886 if (pf->dcbx_cap & DCB_CAP_DCBX_HOST) in i40e_dcbnl_set_all()
890 if (!test_bit(I40E_FLAG_DCB_ENA, pf->flags)) in i40e_dcbnl_set_all()
893 /* MFP mode but not an iSCSI PF so return */ in i40e_dcbnl_set_all()
894 if (test_bit(I40E_FLAG_MFP_ENA, pf->flags) && !(hw->func_caps.iscsi)) in i40e_dcbnl_set_all()
942 * @pf: the corresponding PF
945 * Delete given APP from all the VSIs for given PF
947 static void i40e_dcbnl_del_app(struct i40e_pf *pf, in i40e_dcbnl_del_app() argument
953 i40e_pf_for_each_vsi(pf, v, vsi) in i40e_dcbnl_del_app()
956 dev_dbg(&pf->pdev->dev, "Deleting app for VSI seid=%d err=%d sel=%d proto=0x%x prio=%d\n", in i40e_dcbnl_del_app()
986 * @pf: the corresponding PF
993 void i40e_dcbnl_flush_apps(struct i40e_pf *pf, in i40e_dcbnl_flush_apps() argument
1000 /* MFP mode but not an iSCSI PF so return */ in i40e_dcbnl_flush_apps()
1001 if (test_bit(I40E_FLAG_MFP_ENA, pf->flags) && !(pf->hw.func_caps.iscsi)) in i40e_dcbnl_flush_apps()
1008 i40e_dcbnl_del_app(pf, &app); in i40e_dcbnl_flush_apps()
1021 struct i40e_pf *pf = i40e_netdev_to_pf(dev); in i40e_dcbnl_setup() local
1024 if (!test_bit(I40E_FLAG_DCB_CAPABLE, pf->flags)) in i40e_dcbnl_setup()