From: Stefan Wegrzyn <stefan.wegr...@intel.com> As per updated data sheet, add 'skip_clear_pf' field to ice_hw structure, which can be used to skip call to ice_clear_pf_cfg() in ice_init_hw(). Also, make 'fw_vsi_num' field of ice_hw structure visible to every component using shared code.
Signed-off-by: Stefan Wegrzyn <stefan.wegr...@intel.com> Signed-off-by: Ian Stokes <ian.sto...@intel.com> --- drivers/net/ice/base/ice_common.c | 10 +++++++--- drivers/net/ice/base/ice_switch.c | 4 ++++ drivers/net/ice/base/ice_type.h | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index bb845700dd..950163510e 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -1025,6 +1025,8 @@ int ice_init_hw(struct ice_hw *hw) ice_get_itr_intrl_gran(hw); + hw->fw_vsi_num = ICE_DFLT_VSI_INVAL; + status = ice_create_all_ctrlq(hw); if (status) goto err_unroll_cqinit; @@ -1036,9 +1038,11 @@ int ice_init_hw(struct ice_hw *hw) if (ice_get_fw_mode(hw) == ICE_FW_MODE_ROLLBACK) ice_print_rollback_msg(hw); - status = ice_clear_pf_cfg(hw); - if (status) - goto err_unroll_cqinit; + if (!hw->skip_clear_pf) { + status = ice_clear_pf_cfg(hw); + if (status) + goto err_unroll_cqinit; + } /* Set bit to enable Flow Director filters */ wr32(hw, PFQF_FD_ENA, PFQF_FD_ENA_FD_ENA_M); diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 54a42d2777..10121d848f 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -3883,6 +3883,10 @@ int ice_get_initial_sw_cfg(struct ice_hw *hw) switch (res_type) { case ICE_AQC_GET_SW_CONF_RESP_VSI: + if (hw->fw_vsi_num != ICE_DFLT_VSI_INVAL) + ice_debug(hw, ICE_DBG_SW, "fw_vsi_num %d -> %d\n", + hw->fw_vsi_num, vsi_port_num); + hw->fw_vsi_num = vsi_port_num; if (hw->dcf_enabled && !is_vf) hw->pf_id = pf_vf_num; break; diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index 638e812c0f..46fb5bd8c8 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -1258,6 +1258,7 @@ struct ice_hw { enum ice_mac_type mac_type; u16 fd_ctr_base; /* FD counter base index */ + u16 fw_vsi_num; /* pci info */ u16 device_id; u16 vendor_id; @@ -1404,6 +1405,8 @@ struct ice_hw { ice_declare_bitmap(hw_ptype, ICE_FLOW_PTYPE_MAX); u8 dvm_ena; u16 io_expander_handle; + + bool skip_clear_pf; }; /* Statistics collected by each port, VSI, VEB, and S-channel */ -- 2.43.0