From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91D1045501; Wed, 26 Jun 2024 14:00:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65796433DC; Wed, 26 Jun 2024 13:55:57 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 57E9C42E95 for ; Wed, 26 Jun 2024 13:44:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402262; x=1750938262; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wDQZtyvG6ByF9VzAwOedp3KLEVuesUcL6IWxdxOiIfA=; b=cNg8n60HKjDv4wu7hfj9DaHP44meCiObIGwLykaOni4lYF3gsjWGlUA8 hrRwb6YrNvuKxNHOFSkJEULaXM7wfMJaq2xvFdQGb19UhDNayBqMHydRf sipu3yU9QamDgQ3qq9sw+7D3rYTEW/OD0gth4Ah2Ivs7WNnn9HyK3qp9h nVrTdBsx4OVRoDVle1QWPNbGtWGpnLEH7KQCIoERy93cyF0sElzoFTzvV DAXeggFR6fOXfz4xgKrCILxntq7KI+Yr97V1trb/l3vQuNAQHfLyIw1bg qJgxJMgghTgWdRixIPlD2ZwSKSpGW3THK6GuUkmsbwO4u8yrvlNerxNRx A==; X-CSE-ConnectionGUID: 6VAheDkPSNeCZicUaGhZpA== X-CSE-MsgGUID: hgSJTTVFR0eFqcBpYKvtOg== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979431" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979431" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2024 04:44:22 -0700 X-CSE-ConnectionGUID: r5zcXGiFQZKo8YKhUSioFA== X-CSE-MsgGUID: GvUk6W16QSucMDfmTuw7vw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873943" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:44:21 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Stefan Wegrzyn , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 049/103] net/ice/base: allow skipping PF clear Date: Wed, 26 Jun 2024 12:41:37 +0100 Message-ID: <24cb9b4a05276b09806cfac888c838f5ee6e217d.1719401848.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Stefan Wegrzyn 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 Signed-off-by: Ian Stokes --- 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