Lines Matching refs:pf
34 static void ice_info_get_dsn(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_get_dsn() argument
39 put_unaligned_be64(pci_get_dsn(pf->pdev), dsn); in ice_info_get_dsn()
44 static void ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_pba() argument
46 struct ice_hw *hw = &pf->hw; in ice_info_pba()
52 dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %d\n", in ice_info_pba()
56 static void ice_info_fw_mgmt(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_fw_mgmt() argument
58 struct ice_hw *hw = &pf->hw; in ice_info_fw_mgmt()
64 static void ice_info_fw_api(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_fw_api() argument
66 struct ice_hw *hw = &pf->hw; in ice_info_fw_api()
72 static void ice_info_fw_build(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_fw_build() argument
74 struct ice_hw *hw = &pf->hw; in ice_info_fw_build()
79 static void ice_info_orom_ver(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_orom_ver() argument
81 struct ice_orom_info *orom = &pf->hw.flash.orom; in ice_info_orom_ver()
88 ice_info_pending_orom_ver(struct ice_pf __always_unused *pf, in ice_info_pending_orom_ver() argument
98 static void ice_info_nvm_ver(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_nvm_ver() argument
100 struct ice_nvm_info *nvm = &pf->hw.flash.nvm; in ice_info_nvm_ver()
106 ice_info_pending_nvm_ver(struct ice_pf __always_unused *pf, in ice_info_pending_nvm_ver() argument
116 static void ice_info_eetrack(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_eetrack() argument
118 struct ice_nvm_info *nvm = &pf->hw.flash.nvm; in ice_info_eetrack()
124 ice_info_pending_eetrack(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_pending_eetrack() argument
132 static void ice_info_ddp_pkg_name(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_ddp_pkg_name() argument
134 struct ice_hw *hw = &pf->hw; in ice_info_ddp_pkg_name()
140 ice_info_ddp_pkg_version(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_ddp_pkg_version() argument
142 struct ice_pkg_ver *pkg = &pf->hw.active_pkg_ver; in ice_info_ddp_pkg_version()
149 ice_info_ddp_pkg_bundle_id(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_ddp_pkg_bundle_id() argument
151 snprintf(ctx->buf, sizeof(ctx->buf), "0x%08x", pf->hw.active_track_id); in ice_info_ddp_pkg_bundle_id()
154 static void ice_info_netlist_ver(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_netlist_ver() argument
156 struct ice_netlist_info *netlist = &pf->hw.flash.netlist; in ice_info_netlist_ver()
165 static void ice_info_netlist_build(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_netlist_build() argument
167 struct ice_netlist_info *netlist = &pf->hw.flash.netlist; in ice_info_netlist_build()
173 ice_info_pending_netlist_ver(struct ice_pf __always_unused *pf, in ice_info_pending_netlist_ver() argument
187 ice_info_pending_netlist_build(struct ice_pf __always_unused *pf, in ice_info_pending_netlist_build() argument
196 static void ice_info_cgu_fw_build(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_cgu_fw_build() argument
200 if (!ice_is_feature_supported(pf, ICE_F_CGU)) in ice_info_cgu_fw_build()
202 if (ice_aq_get_cgu_info(&pf->hw, &id, &cfg_ver, &fw_ver)) in ice_info_cgu_fw_build()
207 static void ice_info_cgu_id(struct ice_pf *pf, struct ice_info_ctx *ctx) in ice_info_cgu_id() argument
209 if (!ice_is_feature_supported(pf, ICE_F_CGU)) in ice_info_cgu_id()
211 snprintf(ctx->buf, sizeof(ctx->buf), "%u", pf->hw.cgu_part_number); in ice_info_cgu_id()
241 void (*getter)(struct ice_pf *pf, struct ice_info_ctx *ctx);
242 void (*fallback)(struct ice_pf *pf, struct ice_info_ctx *ctx);
275 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_info_get() local
276 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_info_get()
277 struct ice_hw *hw = &pf->hw; in ice_devlink_info_get()
282 err = ice_wait_for_reset(pf, 10 * HZ); in ice_devlink_info_get()
334 ice_info_get_dsn(pf, ctx); in ice_devlink_info_get()
348 ice_devlink_versions[i].getter(pf, ctx); in ice_devlink_info_get()
356 ice_devlink_versions[i].fallback(pf, ctx); in ice_devlink_info_get()
411 ice_devlink_reload_empr_start(struct ice_pf *pf, in ice_devlink_reload_empr_start() argument
414 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_reload_empr_start()
415 struct ice_hw *hw = &pf->hw; in ice_devlink_reload_empr_start()
419 err = ice_get_pending_updates(pf, &pending, extack); in ice_devlink_reload_empr_start()
433 if (pf->fw_emp_reset_disabled) { in ice_devlink_reload_empr_start()
455 static void ice_devlink_reinit_down(struct ice_pf *pf) in ice_devlink_reinit_down() argument
458 ice_unload(pf); in ice_devlink_reinit_down()
460 ice_vsi_decfg(ice_get_main_vsi(pf)); in ice_devlink_reinit_down()
462 ice_deinit_pf(pf); in ice_devlink_reinit_down()
463 ice_deinit_hw(&pf->hw); in ice_devlink_reinit_down()
464 ice_deinit_dev(pf); in ice_devlink_reinit_down()
481 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_down() local
485 if (ice_is_eswitch_mode_switchdev(pf)) { in ice_devlink_reload_down()
490 if (ice_is_adq_active(pf)) { in ice_devlink_reload_down()
495 if (ice_has_vfs(pf)) { in ice_devlink_reload_down()
500 ice_devlink_reinit_down(pf); in ice_devlink_reload_down()
503 return ice_devlink_reload_empr_start(pf, extack); in ice_devlink_reload_down()
520 ice_devlink_reload_empr_finish(struct ice_pf *pf, in ice_devlink_reload_empr_finish() argument
525 err = ice_wait_for_reset(pf, 60 * HZ); in ice_devlink_reload_empr_finish()
543 static int ice_get_tx_topo_user_sel(struct ice_pf *pf, uint8_t *layers) in ice_get_tx_topo_user_sel() argument
546 struct ice_hw *hw = &pf->hw; in ice_get_tx_topo_user_sel()
580 static int ice_update_tx_topo_user_sel(struct ice_pf *pf, int layers) in ice_update_tx_topo_user_sel() argument
583 struct ice_hw *hw = &pf->hw; in ice_update_tx_topo_user_sel()
600 err = ice_write_one_nvm_block(pf, ICE_AQC_NVM_TX_TOPO_MOD_ID, 2, in ice_update_tx_topo_user_sel()
622 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_get() local
625 err = ice_get_tx_topo_user_sel(pf, &ctx->val.vu8); in ice_devlink_tx_sched_layers_get()
645 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_set() local
648 err = ice_update_tx_topo_user_sel(pf, ctx->val.vu8); in ice_devlink_tx_sched_layers_set()
692 void ice_tear_down_devlink_rate_tree(struct ice_pf *pf) in ice_tear_down_devlink_rate_tree() argument
698 devlink = priv_to_devlink(pf); in ice_tear_down_devlink_rate_tree()
701 mutex_lock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
702 ice_for_each_vf(pf, bkt, vf) { in ice_tear_down_devlink_rate_tree()
706 mutex_unlock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
719 static bool ice_enable_custom_tx(struct ice_pf *pf) in ice_enable_custom_tx() argument
721 struct ice_port_info *pi = ice_get_main_vsi(pf)->port_info; in ice_enable_custom_tx()
722 struct device *dev = ice_pf_to_dev(pf); in ice_enable_custom_tx()
728 if (ice_is_adq_active(pf)) { in ice_enable_custom_tx()
733 if (ice_is_dcb_active(pf)) { in ice_enable_custom_tx()
754 struct ice_sched_node *tc_node, struct ice_pf *pf) in ice_traverse_tx_tree() argument
769 pf->vsi[node->vsi_handle]->type == ICE_VSI_VF && in ice_traverse_tx_tree()
770 pf->vsi[node->vsi_handle]->vf) { in ice_traverse_tx_tree()
771 vf = pf->vsi[node->vsi_handle]->vf; in ice_traverse_tx_tree()
779 pf->vsi[node->vsi_handle]->type == ICE_VSI_SF && in ice_traverse_tx_tree()
780 pf->vsi[node->vsi_handle]->sf) { in ice_traverse_tx_tree()
781 sf = pf->vsi[node->vsi_handle]->sf; in ice_traverse_tx_tree()
799 ice_traverse_tx_tree(devlink, node->children[i], tc_node, pf); in ice_traverse_tx_tree()
814 struct ice_pf *pf = vsi->back; in ice_devlink_rate_init_tx_topology() local
820 ice_traverse_tx_tree(devlink, tc_node->children[i], tc_node, pf); in ice_devlink_rate_init_tx_topology()
970 struct ice_pf *pf = devlink_priv(rate_node->devlink); in ice_get_pi_from_dev_rate() local
972 return ice_get_main_vsi(pf)->port_info; in ice_get_pi_from_dev_rate()
1212 static void ice_set_min_max_msix(struct ice_pf *pf) in ice_set_min_max_msix() argument
1214 struct devlink *devlink = priv_to_devlink(pf); in ice_set_min_max_msix()
1222 pf->msix.min = val.vu32; in ice_set_min_max_msix()
1228 pf->msix.max = val.vu32; in ice_set_min_max_msix()
1235 static int ice_devlink_reinit_up(struct ice_pf *pf) in ice_devlink_reinit_up() argument
1237 struct ice_vsi *vsi = ice_get_main_vsi(pf); in ice_devlink_reinit_up()
1238 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_reinit_up()
1242 err = ice_init_hw(&pf->hw); in ice_devlink_reinit_up()
1249 ice_set_min_max_msix(pf); in ice_devlink_reinit_up()
1251 err = ice_init_dev(pf); in ice_devlink_reinit_up()
1255 err = ice_init_pf(pf); in ice_devlink_reinit_up()
1270 err = ice_load(pf); in ice_devlink_reinit_up()
1281 ice_deinit_pf(pf); in ice_devlink_reinit_up()
1285 ice_deinit_hw(&pf->hw); in ice_devlink_reinit_up()
1287 ice_deinit_dev(pf); in ice_devlink_reinit_up()
1306 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_up() local
1311 return ice_devlink_reinit_up(pf); in ice_devlink_reload_up()
1314 return ice_devlink_reload_empr_finish(pf, extack); in ice_devlink_reload_up()
1358 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_get() local
1361 cdev = pf->cdev_info; in ice_devlink_enable_roce_get()
1374 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_set() local
1379 cdev = pf->cdev_info; in ice_devlink_enable_roce_set()
1384 ice_unplug_aux_dev(pf); in ice_devlink_enable_roce_set()
1390 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_roce_set()
1402 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_validate() local
1405 cdev = pf->cdev_info; in ice_devlink_enable_roce_validate()
1409 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_roce_validate()
1425 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_get() local
1428 cdev = pf->cdev_info; in ice_devlink_enable_iw_get()
1441 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_set() local
1446 cdev = pf->cdev_info; in ice_devlink_enable_iw_set()
1451 ice_unplug_aux_dev(pf); in ice_devlink_enable_iw_set()
1457 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_iw_set()
1469 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_validate() local
1471 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_iw_validate()
1474 if (pf->cdev_info->rdma_protocol & IIDC_RDMA_PROTOCOL_ROCEV2) { in ice_devlink_enable_iw_validate()
1538 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_get() local
1542 pi = pf->hw.port_info; in ice_devlink_local_fwd_get()
1563 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_set() local
1564 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_local_fwd_set()
1567 pi = pf->hw.port_info; in ice_devlink_local_fwd_set()
1571 ice_schedule_reset(pf, ICE_RESET_CORER); in ice_devlink_local_fwd_set()
1608 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_msix_max_pf_validate() local
1610 if (val.vu32 > pf->hw.func_caps.common_cap.num_msix_vectors) in ice_devlink_msix_max_pf_validate()
1631 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_rdma_validate() local
1634 if (new_state && !test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_rdma_validate()
1721 struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf *pf) in ice_allocate_sf() argument
1731 err = devl_nested_devlink_set(priv_to_devlink(pf), devlink); in ice_allocate_sf()
1748 void ice_devlink_register(struct ice_pf *pf) in ice_devlink_register() argument
1750 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register()
1761 void ice_devlink_unregister(struct ice_pf *pf) in ice_devlink_unregister() argument
1763 devl_unregister(priv_to_devlink(pf)); in ice_devlink_unregister()
1766 int ice_devlink_register_params(struct ice_pf *pf) in ice_devlink_register_params() argument
1768 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register_params()
1770 struct ice_hw *hw = &pf->hw; in ice_devlink_register_params()
1789 value.vu32 = pf->msix.max; in ice_devlink_register_params()
1793 value.vu32 = pf->msix.min; in ice_devlink_register_params()
1798 value.vbool = test_bit(ICE_FLAG_RDMA_ENA, pf->flags); in ice_devlink_register_params()
1814 void ice_devlink_unregister_params(struct ice_pf *pf) in ice_devlink_unregister_params() argument
1816 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_unregister_params()
1817 struct ice_hw *hw = &pf->hw; in ice_devlink_unregister_params()
1855 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_snapshot() local
1856 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_snapshot()
1857 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_snapshot()
1944 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_read() local
1945 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_read()
1946 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_read()
2008 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_devcaps_snapshot() local
2009 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_devcaps_snapshot()
2010 struct ice_hw *hw = &pf->hw; in ice_devlink_devcaps_snapshot()
2060 void ice_devlink_init_regions(struct ice_pf *pf) in ice_devlink_init_regions() argument
2062 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_init_regions()
2063 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_init_regions()
2066 nvm_size = pf->hw.flash.flash_size; in ice_devlink_init_regions()
2067 pf->nvm_region = devl_region_create(devlink, &ice_nvm_region_ops, 1, in ice_devlink_init_regions()
2069 if (IS_ERR(pf->nvm_region)) { in ice_devlink_init_regions()
2071 PTR_ERR(pf->nvm_region)); in ice_devlink_init_regions()
2072 pf->nvm_region = NULL; in ice_devlink_init_regions()
2075 sram_size = pf->hw.flash.sr_words * 2u; in ice_devlink_init_regions()
2076 pf->sram_region = devl_region_create(devlink, &ice_sram_region_ops, in ice_devlink_init_regions()
2078 if (IS_ERR(pf->sram_region)) { in ice_devlink_init_regions()
2080 PTR_ERR(pf->sram_region)); in ice_devlink_init_regions()
2081 pf->sram_region = NULL; in ice_devlink_init_regions()
2084 pf->devcaps_region = devl_region_create(devlink, in ice_devlink_init_regions()
2087 if (IS_ERR(pf->devcaps_region)) { in ice_devlink_init_regions()
2089 PTR_ERR(pf->devcaps_region)); in ice_devlink_init_regions()
2090 pf->devcaps_region = NULL; in ice_devlink_init_regions()
2100 void ice_devlink_destroy_regions(struct ice_pf *pf) in ice_devlink_destroy_regions() argument
2102 if (pf->nvm_region) in ice_devlink_destroy_regions()
2103 devl_region_destroy(pf->nvm_region); in ice_devlink_destroy_regions()
2105 if (pf->sram_region) in ice_devlink_destroy_regions()
2106 devl_region_destroy(pf->sram_region); in ice_devlink_destroy_regions()
2108 if (pf->devcaps_region) in ice_devlink_destroy_regions()
2109 devl_region_destroy(pf->devcaps_region); in ice_devlink_destroy_regions()