[v2,087/148] net/ice/base: allow skipping PF clear

Message ID 14a05b36f49eb68ac2f8023bf5553635367c87e6.1718204529.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Anatoly Burakov June 12, 2024, 3:01 p.m. UTC
  From: Ian Stokes <ian.stokes@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, as well as make ice_init_fltr_mgmt_struct() and
ice_cleanup_fltr_mgmt_struct() non-static.

Signed-off-by: Stefan Wegrzyn <stefan.wegrzyn@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@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   |  2 ++
 3 files changed, 13 insertions(+), 3 deletions(-)
  

Comments

Bruce Richardson June 20, 2024, 2:56 p.m. UTC | #1
On Wed, Jun 12, 2024 at 04:01:21PM +0100, Anatoly Burakov wrote:
> From: Ian Stokes <ian.stokes@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, as well as make ice_init_fltr_mgmt_struct() and
> ice_cleanup_fltr_mgmt_struct() non-static.

Change to make functions non-static not in this patch.
  

Patch

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 550fc49e8d..3847d2d3fb 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -923,6 +923,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;
@@ -934,9 +936,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 2992b733c9..4c3e8047d1 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -4072,6 +4072,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 7feb897656..f787020a5f 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;
@@ -1407,6 +1408,7 @@  struct ice_hw {
 	u16 io_expander_handle;
 
 	bool subscribable_recipes_supported;
+	bool skip_clear_pf;
 };
 
 /* Statistics collected by each port, VSI, VEB, and S-channel */