Lines Matching full: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()
398 * @pf: pointer to the pf instance
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()
452 * ice_devlink_reinit_down - unload given PF
453 * @pf: pointer to the PF struct
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_dev(pf); in ice_devlink_reinit_down()
479 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_down() local
483 if (ice_is_eswitch_mode_switchdev(pf)) { in ice_devlink_reload_down()
488 if (ice_is_adq_active(pf)) { in ice_devlink_reload_down()
493 if (ice_has_vfs(pf)) { in ice_devlink_reload_down()
498 ice_devlink_reinit_down(pf); in ice_devlink_reload_down()
501 return ice_devlink_reload_empr_start(pf, extack); in ice_devlink_reload_down()
510 * @pf: pointer to the pf instance
518 ice_devlink_reload_empr_finish(struct ice_pf *pf, in ice_devlink_reload_empr_finish() argument
523 err = ice_wait_for_reset(pf, 60 * HZ); in ice_devlink_reload_empr_finish()
534 * @pf: pointer to pf structure
541 static int ice_get_tx_topo_user_sel(struct ice_pf *pf, uint8_t *layers) in ice_get_tx_topo_user_sel() argument
544 struct ice_hw *hw = &pf->hw; in ice_get_tx_topo_user_sel()
569 * @pf: pointer to pf structure
578 static int ice_update_tx_topo_user_sel(struct ice_pf *pf, int layers) in ice_update_tx_topo_user_sel() argument
581 struct ice_hw *hw = &pf->hw; in ice_update_tx_topo_user_sel()
598 err = ice_write_one_nvm_block(pf, ICE_AQC_NVM_TX_TOPO_MOD_ID, 2, in ice_update_tx_topo_user_sel()
618 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_get() local
621 err = ice_get_tx_topo_user_sel(pf, &ctx->val.vu8); in ice_devlink_tx_sched_layers_get()
641 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_tx_sched_layers_set() local
644 err = ice_update_tx_topo_user_sel(pf, ctx->val.vu8); in ice_devlink_tx_sched_layers_set()
684 * @pf: pf struct
688 void ice_tear_down_devlink_rate_tree(struct ice_pf *pf) in ice_tear_down_devlink_rate_tree() argument
694 devlink = priv_to_devlink(pf); in ice_tear_down_devlink_rate_tree()
697 mutex_lock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
698 ice_for_each_vf(pf, bkt, vf) { in ice_tear_down_devlink_rate_tree()
702 mutex_unlock(&pf->vfs.table_lock); in ice_tear_down_devlink_rate_tree()
710 * @pf: pf struct
715 static bool ice_enable_custom_tx(struct ice_pf *pf) in ice_enable_custom_tx() argument
717 struct ice_port_info *pi = ice_get_main_vsi(pf)->port_info; in ice_enable_custom_tx()
718 struct device *dev = ice_pf_to_dev(pf); in ice_enable_custom_tx()
724 if (ice_is_adq_active(pf)) { in ice_enable_custom_tx()
729 if (ice_is_dcb_active(pf)) { in ice_enable_custom_tx()
744 * @pf: pf struct
750 struct ice_sched_node *tc_node, struct ice_pf *pf) in ice_traverse_tx_tree() argument
765 pf->vsi[node->vsi_handle]->type == ICE_VSI_VF && in ice_traverse_tx_tree()
766 pf->vsi[node->vsi_handle]->vf) { in ice_traverse_tx_tree()
767 vf = pf->vsi[node->vsi_handle]->vf; in ice_traverse_tx_tree()
775 pf->vsi[node->vsi_handle]->type == ICE_VSI_SF && in ice_traverse_tx_tree()
776 pf->vsi[node->vsi_handle]->sf) { in ice_traverse_tx_tree()
777 sf = pf->vsi[node->vsi_handle]->sf; in ice_traverse_tx_tree()
795 ice_traverse_tx_tree(devlink, node->children[i], tc_node, pf); in ice_traverse_tx_tree()
810 struct ice_pf *pf = vsi->back; in ice_devlink_rate_init_tx_topology() local
816 ice_traverse_tx_tree(devlink, tc_node->children[i], tc_node, pf); in ice_devlink_rate_init_tx_topology()
966 struct ice_pf *pf = devlink_priv(rate_node->devlink); in ice_get_pi_from_dev_rate() local
968 return ice_get_main_vsi(pf)->port_info; in ice_get_pi_from_dev_rate()
1209 * ice_devlink_reinit_up - do reinit of the given PF
1210 * @pf: pointer to the PF struct
1212 static int ice_devlink_reinit_up(struct ice_pf *pf) in ice_devlink_reinit_up() argument
1214 struct ice_vsi *vsi = ice_get_main_vsi(pf); in ice_devlink_reinit_up()
1217 err = ice_init_hw(&pf->hw); in ice_devlink_reinit_up()
1219 dev_err(ice_pf_to_dev(pf), "ice_init_hw failed: %d\n", err); in ice_devlink_reinit_up()
1223 err = ice_init_dev(pf); in ice_devlink_reinit_up()
1236 err = ice_load(pf); in ice_devlink_reinit_up()
1247 ice_deinit_dev(pf); in ice_devlink_reinit_up()
1249 ice_deinit_hw(&pf->hw); in ice_devlink_reinit_up()
1268 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_reload_up() local
1273 return ice_devlink_reinit_up(pf); in ice_devlink_reload_up()
1276 return ice_devlink_reload_empr_finish(pf, extack); in ice_devlink_reload_up()
1319 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_get() local
1321 ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ? true : false; in ice_devlink_enable_roce_get()
1330 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_set() local
1335 ice_unplug_aux_dev(pf); in ice_devlink_enable_roce_set()
1336 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1340 pf->rdma_mode |= IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1341 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_roce_set()
1343 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_ROCEV2; in ice_devlink_enable_roce_set()
1353 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_roce_validate() local
1355 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_roce_validate()
1358 if (pf->rdma_mode & IIDC_RDMA_PROTOCOL_IWARP) { in ice_devlink_enable_roce_validate()
1370 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_get() local
1372 ctx->val.vbool = pf->rdma_mode & IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_get()
1381 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_set() local
1386 ice_unplug_aux_dev(pf); in ice_devlink_enable_iw_set()
1387 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1391 pf->rdma_mode |= IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1392 ret = ice_plug_aux_dev(pf); in ice_devlink_enable_iw_set()
1394 pf->rdma_mode &= ~IIDC_RDMA_PROTOCOL_IWARP; in ice_devlink_enable_iw_set()
1404 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_enable_iw_validate() local
1406 if (!test_bit(ICE_FLAG_RDMA_ENA, pf->flags)) in ice_devlink_enable_iw_validate()
1409 if (pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2) { in ice_devlink_enable_iw_validate()
1471 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_get() local
1475 pi = pf->hw.port_info; in ice_devlink_local_fwd_get()
1496 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_local_fwd_set() local
1497 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_local_fwd_set()
1500 pi = pf->hw.port_info; in ice_devlink_local_fwd_set()
1504 ice_schedule_reset(pf, ICE_RESET_CORER); in ice_devlink_local_fwd_set()
1575 * ice_allocate_pf - Allocate devlink and return PF structure pointer
1579 * the PF structure. The devlink memory is kept track of through devres by
1600 * @pf: pointer to the PF structure
1606 struct ice_sf_priv *ice_allocate_sf(struct device *dev, struct ice_pf *pf) in ice_allocate_sf() argument
1616 err = devl_nested_devlink_set(priv_to_devlink(pf), devlink); in ice_allocate_sf()
1626 * ice_devlink_register - Register devlink interface for this PF
1627 * @pf: the PF to register the devlink for.
1633 void ice_devlink_register(struct ice_pf *pf) in ice_devlink_register() argument
1635 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register()
1641 * ice_devlink_unregister - Unregister devlink resources for this PF.
1642 * @pf: the PF structure to cleanup
1646 void ice_devlink_unregister(struct ice_pf *pf) in ice_devlink_unregister() argument
1648 devl_unregister(priv_to_devlink(pf)); in ice_devlink_unregister()
1651 int ice_devlink_register_params(struct ice_pf *pf) in ice_devlink_register_params() argument
1653 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_register_params()
1654 struct ice_hw *hw = &pf->hw; in ice_devlink_register_params()
1669 void ice_devlink_unregister_params(struct ice_pf *pf) in ice_devlink_unregister_params() argument
1671 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_unregister_params()
1672 struct ice_hw *hw = &pf->hw; in ice_devlink_unregister_params()
1708 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_snapshot() local
1709 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_snapshot()
1710 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_snapshot()
1797 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_nvm_read() local
1798 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_nvm_read()
1799 struct ice_hw *hw = &pf->hw; in ice_devlink_nvm_read()
1861 struct ice_pf *pf = devlink_priv(devlink); in ice_devlink_devcaps_snapshot() local
1862 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_devcaps_snapshot()
1863 struct ice_hw *hw = &pf->hw; in ice_devlink_devcaps_snapshot()
1908 * @pf: the PF device structure
1913 void ice_devlink_init_regions(struct ice_pf *pf) in ice_devlink_init_regions() argument
1915 struct devlink *devlink = priv_to_devlink(pf); in ice_devlink_init_regions()
1916 struct device *dev = ice_pf_to_dev(pf); in ice_devlink_init_regions()
1919 nvm_size = pf->hw.flash.flash_size; in ice_devlink_init_regions()
1920 pf->nvm_region = devl_region_create(devlink, &ice_nvm_region_ops, 1, in ice_devlink_init_regions()
1922 if (IS_ERR(pf->nvm_region)) { in ice_devlink_init_regions()
1924 PTR_ERR(pf->nvm_region)); in ice_devlink_init_regions()
1925 pf->nvm_region = NULL; in ice_devlink_init_regions()
1928 sram_size = pf->hw.flash.sr_words * 2u; in ice_devlink_init_regions()
1929 pf->sram_region = devl_region_create(devlink, &ice_sram_region_ops, in ice_devlink_init_regions()
1931 if (IS_ERR(pf->sram_region)) { in ice_devlink_init_regions()
1933 PTR_ERR(pf->sram_region)); in ice_devlink_init_regions()
1934 pf->sram_region = NULL; in ice_devlink_init_regions()
1937 pf->devcaps_region = devl_region_create(devlink, in ice_devlink_init_regions()
1940 if (IS_ERR(pf->devcaps_region)) { in ice_devlink_init_regions()
1942 PTR_ERR(pf->devcaps_region)); in ice_devlink_init_regions()
1943 pf->devcaps_region = NULL; in ice_devlink_init_regions()
1949 * @pf: the PF device structure
1951 * Remove previously created regions for this PF.
1953 void ice_devlink_destroy_regions(struct ice_pf *pf) in ice_devlink_destroy_regions() argument
1955 if (pf->nvm_region) in ice_devlink_destroy_regions()
1956 devl_region_destroy(pf->nvm_region); in ice_devlink_destroy_regions()
1958 if (pf->sram_region) in ice_devlink_destroy_regions()
1959 devl_region_destroy(pf->sram_region); in ice_devlink_destroy_regions()
1961 if (pf->devcaps_region) in ice_devlink_destroy_regions()
1962 devl_region_destroy(pf->devcaps_region); in ice_devlink_destroy_regions()