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()
407 ice_devlink_reload_empr_start(struct ice_pf *pf, in ice_devlink_reload_empr_start() argument
410 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_reload_empr_start()
411 struct ice_hw *hw = &pf->hw; in ice_devlink_reload_empr_start()
415 err = ice_get_pending_updates(pf, &pending, extack); in ice_devlink_reload_empr_start()
429 if (pf->fw_emp_reset_disabled) { in ice_devlink_reload_empr_start()
451 static void ice_devlink_reinit_down(struct ice_pf *pf) in ice_devlink_reinit_down() argument
454 ice_unload(pf); in ice_devlink_reinit_down()
456 ice_vsi_decfg(ice_get_main_vsi(pf)); in ice_devlink_reinit_down()
458 ice_deinit_dev(pf); in ice_devlink_reinit_down()
475 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_down() local
479 if (ice_is_eswitch_mode_switchdev(pf)) { in ice_devlink_reload_down()
484 if (ice_is_adq_active(pf)) { in ice_devlink_reload_down()
489 if (ice_has_vfs(pf)) { in ice_devlink_reload_down()
494 ice_devlink_reinit_down(pf); in ice_devlink_reload_down()
497 return ice_devlink_reload_empr_start(pf, extack); in ice_devlink_reload_down()
514 ice_devlink_reload_empr_finish(struct ice_pf *pf, in ice_devlink_reload_empr_finish() argument
519 err = ice_wait_for_reset(pf, 60 * HZ); in ice_devlink_reload_empr_finish()
537 static int ice_get_tx_topo_user_sel(struct ice_pf *pf, uint8_t *layers) in ice_get_tx_topo_user_sel() argument
540 struct ice_hw *hw = &pf->hw; in ice_get_tx_topo_user_sel()
574 static int ice_update_tx_topo_user_sel(struct ice_pf *pf, int layers) in ice_update_tx_topo_user_sel() argument
577 struct ice_hw *hw = &pf->hw; in ice_update_tx_topo_user_sel()
594 err = ice_write_one_nvm_block(pf, ICE_AQC_NVM_TX_TOPO_MOD_ID, 2, in ice_update_tx_topo_user_sel()
614 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_get() local
617 err = ice_get_tx_topo_user_sel(pf, &ctx->val.vu8); in ice_devlink_tx_sched_layers_get()
637 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_set() local
640 err = ice_update_tx_topo_user_sel(pf, ctx->val.vu8); in ice_devlink_tx_sched_layers_set()
684 void ice_tear_down_devlink_rate_tree(struct ice_pf *pf) in ice_tear_down_devlink_rate_tree() argument
690 devlink = priv_to_devlink(pf); in ice_tear_down_devlink_rate_tree()
693 mutex_lock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
694 ice_for_each_vf(pf, bkt, vf) { in ice_tear_down_devlink_rate_tree()
698 mutex_unlock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
711 static bool ice_enable_custom_tx(struct ice_pf *pf) in ice_enable_custom_tx() argument
713 struct ice_port_info *pi = ice_get_main_vsi(pf)->port_info; in ice_enable_custom_tx()
714 struct device *dev = ice_pf_to_dev(pf); in ice_enable_custom_tx()
720 if (ice_is_adq_active(pf)) { in ice_enable_custom_tx()
725 if (ice_is_dcb_active(pf)) { in ice_enable_custom_tx()
746 struct ice_sched_node *tc_node, struct ice_pf *pf) in ice_traverse_tx_tree() argument
761 pf->vsi[node->vsi_handle]->type == ICE_VSI_VF && in ice_traverse_tx_tree()
762 pf->vsi[node->vsi_handle]->vf) { in ice_traverse_tx_tree()
763 vf = pf->vsi[node->vsi_handle]->vf; in ice_traverse_tx_tree()
771 pf->vsi[node->vsi_handle]->type == ICE_VSI_SF && in ice_traverse_tx_tree()
772 pf->vsi[node->vsi_handle]->sf) { in ice_traverse_tx_tree()
773 sf = pf->vsi[node->vsi_handle]->sf; in ice_traverse_tx_tree()
791 ice_traverse_tx_tree(devlink, node->children[i], tc_node, pf); in ice_traverse_tx_tree()
806 struct ice_pf *pf = vsi->back; in ice_devlink_rate_init_tx_topology() local
812 ice_traverse_tx_tree(devlink, tc_node->children[i], tc_node, pf); in ice_devlink_rate_init_tx_topology()
962 struct ice_pf *pf = devlink_priv(rate_node->devlink); in ice_get_pi_from_dev_rate() local
964 return ice_get_main_vsi(pf)->port_info; in ice_get_pi_from_dev_rate()
1205 static int ice_devlink_reinit_up(struct ice_pf *pf) in ice_devlink_reinit_up() argument
1207 struct ice_vsi *vsi = ice_get_main_vsi(pf); in ice_devlink_reinit_up()
1210 err = ice_init_dev(pf); in ice_devlink_reinit_up()
1223 err = ice_load(pf); in ice_devlink_reinit_up()
1234 ice_deinit_dev(pf); in ice_devlink_reinit_up()
1253 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_up() local
1258 return ice_devlink_reinit_up(pf); in ice_devlink_reload_up()
1261 return ice_devlink_reload_empr_finish(pf, extack); in ice_devlink_reload_up()
1304 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_get() local
1306 ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ? true : false; in ice_devlink_enable_roce_get()
1315 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_set() local
1320 ice_unplug_aux_dev(pf); in ice_devlink_enable_roce_set()
1321 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1325 pf->rdma_mode |= IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1326 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_roce_set()
1328 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1338 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_validate() local
1340 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_roce_validate()
1343 if (pf->rdma_mode & IIDC_RDMA_PROTOCOL_IWARP) { in ice_devlink_enable_roce_validate()
1355 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_get() local
1357 ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_get()
1366 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_set() local
1371 ice_unplug_aux_dev(pf); in ice_devlink_enable_iw_set()
1372 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1376 pf->rdma_mode |= IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1377 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_iw_set()
1379 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1389 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_validate() local
1391 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_iw_validate()
1394 if (pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2) { in ice_devlink_enable_iw_validate()
1456 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_get() local
1460 pi = pf->hw.port_info; in ice_devlink_local_fwd_get()
1481 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_set() local
1482 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_local_fwd_set()
1485 pi = pf->hw.port_info; in ice_devlink_local_fwd_set()
1489 ice_schedule_reset(pf, ICE_RESET_CORER); in ice_devlink_local_fwd_set()
1591 struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf *pf) in ice_allocate_sf() argument
1601 err = devl_nested_devlink_set(priv_to_devlink(pf), devlink); in ice_allocate_sf()
1618 void ice_devlink_register(struct ice_pf *pf) in ice_devlink_register() argument
1620 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register()
1631 void ice_devlink_unregister(struct ice_pf *pf) in ice_devlink_unregister() argument
1633 devl_unregister(priv_to_devlink(pf)); in ice_devlink_unregister()
1636 int ice_devlink_register_params(struct ice_pf *pf) in ice_devlink_register_params() argument
1638 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register_params()
1639 struct ice_hw *hw = &pf->hw; in ice_devlink_register_params()
1654 void ice_devlink_unregister_params(struct ice_pf *pf) in ice_devlink_unregister_params() argument
1656 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_unregister_params()
1657 struct ice_hw *hw = &pf->hw; in ice_devlink_unregister_params()
1693 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_snapshot() local
1694 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_snapshot()
1695 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_snapshot()
1782 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_read() local
1783 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_read()
1784 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_read()
1846 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_devcaps_snapshot() local
1847 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_devcaps_snapshot()
1848 struct ice_hw *hw = &pf->hw; in ice_devlink_devcaps_snapshot()
1898 void ice_devlink_init_regions(struct ice_pf *pf) in ice_devlink_init_regions() argument
1900 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_init_regions()
1901 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_init_regions()
1904 nvm_size = pf->hw.flash.flash_size; in ice_devlink_init_regions()
1905 pf->nvm_region = devl_region_create(devlink, &ice_nvm_region_ops, 1, in ice_devlink_init_regions()
1907 if (IS_ERR(pf->nvm_region)) { in ice_devlink_init_regions()
1909 PTR_ERR(pf->nvm_region)); in ice_devlink_init_regions()
1910 pf->nvm_region = NULL; in ice_devlink_init_regions()
1913 sram_size = pf->hw.flash.sr_words * 2u; in ice_devlink_init_regions()
1914 pf->sram_region = devl_region_create(devlink, &ice_sram_region_ops, in ice_devlink_init_regions()
1916 if (IS_ERR(pf->sram_region)) { in ice_devlink_init_regions()
1918 PTR_ERR(pf->sram_region)); in ice_devlink_init_regions()
1919 pf->sram_region = NULL; in ice_devlink_init_regions()
1922 pf->devcaps_region = devl_region_create(devlink, in ice_devlink_init_regions()
1925 if (IS_ERR(pf->devcaps_region)) { in ice_devlink_init_regions()
1927 PTR_ERR(pf->devcaps_region)); in ice_devlink_init_regions()
1928 pf->devcaps_region = NULL; in ice_devlink_init_regions()
1938 void ice_devlink_destroy_regions(struct ice_pf *pf) in ice_devlink_destroy_regions() argument
1940 if (pf->nvm_region) in ice_devlink_destroy_regions()
1941 devl_region_destroy(pf->nvm_region); in ice_devlink_destroy_regions()
1943 if (pf->sram_region) in ice_devlink_destroy_regions()
1944 devl_region_destroy(pf->sram_region); in ice_devlink_destroy_regions()
1946 if (pf->devcaps_region) in ice_devlink_destroy_regions()
1947 devl_region_destroy(pf->devcaps_region); in ice_devlink_destroy_regions()