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 D4A2645500; Wed, 26 Jun 2024 13:59:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2DC4433AF; Wed, 26 Jun 2024 13:55:44 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 2080442E95 for ; Wed, 26 Jun 2024 13:44:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719402243; x=1750938243; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0rUVaGeHQxaukMvHrQ+4fTq9D21oSCIWzktCZFi+kz0=; b=P8e4BsHqEGdFdEQjklytkngM5haHa8wv48RnKanIR3YPc81f5ZPP8Rew fDxWr4M/FHRW3Ss/4kTznvsLRlZaxJqHn5TeHpy087mZwMcpZ8WnRj7gi fdufYtwwzjfPYyWtVNTupMtZYQKS3ywx2VXYhU96cCNstFfjZu9t3ffzR QtGYcH1eLOucfzVPmt7XN16Pnb9WR6S7Fd4Lr9h6Wo3aC3wZcWUQjNFMi r5jV3Bjul+aKyS4ocaIkVEWkOizhfIbee4rgJUsGjsYQfqvZD87VEf/Lt U3Sf8n7DPYtY1eHMsVTr8oIlyNJnCp5EjAdXLO8HMVsiyKmrbwk89FcnL g==; X-CSE-ConnectionGUID: Amy09jSuSR6YxxucA1UYpA== X-CSE-MsgGUID: WzakcaUNTeORqs/L0GnSPQ== X-IronPort-AV: E=McAfee;i="6700,10204,11114"; a="38979394" X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="38979394" 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:02 -0700 X-CSE-ConnectionGUID: PdIdW3lbSGONtCjgWM1lwg== X-CSE-MsgGUID: jkhWH+n+RkKeRqAFOP0DYQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,266,1712646000"; d="scan'208";a="43873785" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa010.jf.intel.com with ESMTP; 26 Jun 2024 04:44:02 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Bartosz Staszewski , ian.stokes@intel.com, bruce.richardson@intel.com Subject: [PATCH v4 037/103] net/ice/base: improve read retry value calculation Date: Wed, 26 Jun 2024 12:41:25 +0100 Message-ID: <7a2bae036b2a5ec1efa7ad57386898fae6fcfb5e.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: Bartosz Staszewski Previous implementation of PHY timestamp retry value was set to a static value that had no meaning. Change it to calculate it based on a set of meaningfully named macros, as well as adjust data type to avoid overflows. Signed-off-by: Bartosz Staszewski Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_ptp_hw.c | 2 +- drivers/net/ice/base/ice_ptp_hw.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 5037feee18..5609145b8d 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4492,7 +4492,7 @@ static int ice_write_phy_reg_e810(struct ice_hw *hw, u32 addr, u32 val) static int ice_read_phy_tstamp_ll_e810(struct ice_hw *hw, u8 idx, u8 *hi, u32 *lo) { - u8 i; + unsigned int i; /* Write TS index to read to the PF register so the FW can read it */ wr32(hw, PF_SB_ATQBAL, TS_LL_READ_TS_IDX(idx)); diff --git a/drivers/net/ice/base/ice_ptp_hw.h b/drivers/net/ice/base/ice_ptp_hw.h index 73d01a047e..7c0c5ae562 100644 --- a/drivers/net/ice/base/ice_ptp_hw.h +++ b/drivers/net/ice/base/ice_ptp_hw.h @@ -516,7 +516,11 @@ int ice_ptp_init_phy_cfg(struct ice_hw *hw); #define BYTES_PER_IDX_ADDR_L 4 /* Tx timestamp low latency read definitions */ -#define TS_LL_READ_RETRIES 200 +#define TS_LL_MAX_TIME_READ_PER_PORT 80 +#define TS_LL_MAX_PORT 8 +#define TS_LL_DELTA_TIME 360 +#define TS_LL_READ_RETRIES (TS_LL_MAX_TIME_READ_PER_PORT * \ + TS_LL_MAX_PORT) + TS_LL_DELTA_TIME #define TS_LL_READ_TS_INTR BIT(30) #define TS_LL_READ_TS BIT(31) #define TS_LL_READ_TS_IDX_S 24 -- 2.43.0