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 55C67454EF; Tue, 25 Jun 2024 13:22:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B874B42F49; Tue, 25 Jun 2024 13:18:00 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) by mails.dpdk.org (Postfix) with ESMTP id 71A65427DE for ; Tue, 25 Jun 2024 13:16:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1719314213; x=1750850213; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VFxtsiiGDS6SXl8av+QVDVE+b0//5o6t+8ai1keXeH4=; b=kE9ArSsxRnz0zu7PdNEp8qGSpB8psDn/hcCuZgj9EZMld7B7KG4+dkCC CaBhKSCB7esSco9ueDs0wROuptc8ETSHiLBJy63vWErgCIrCNoZqMR7en 6oOp8/zog1Am+xWAn6Tn5t/qsydZKbh7o1l19qWukI0NnFe1m9+wFIYfx Bw1sKMnacSy0yQC8MymYXxFosCTo760lNtc+9VtABIO7YP2yzfI5AV0iY Wqqk2pUpAQz0yEHjaEgl6YBfs2XHSkvFvsMI45AvTz0eTllZ9cIIVS6sP ROvLFwLdq1/P4A31cPlQ4uKI9TVa6g3NU4/G5ZQWuP8H2iW2Gk/b4qUUt Q==; X-CSE-ConnectionGUID: 8447BmrUQLG5K/gKSFPvZg== X-CSE-MsgGUID: rF/azufNRWicMYQZRD64rA== X-IronPort-AV: E=McAfee;i="6700,10204,11113"; a="16080268" X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="16080268" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2024 04:16:33 -0700 X-CSE-ConnectionGUID: bxVbOhd5S3yGL8OrhWvIng== X-CSE-MsgGUID: NX0FzHc6StqDoREq150hIQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,263,1712646000"; d="scan'208";a="43719244" Received: from unknown (HELO silpixa00401119.ir.intel.com) ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 25 Jun 2024 04:16:32 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Bartosz Staszewski , bruce.richardson@intel.com, ian.stokes@intel.com Subject: [PATCH v3 057/129] net/ice/base: improve read retry value calculation Date: Tue, 25 Jun 2024 12:13:02 +0100 Message-ID: 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 926cb23cf1..850cc2a57c 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -4570,7 +4570,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 2892b9ca76..11535044a8 100644 --- a/drivers/net/ice/base/ice_ptp_hw.h +++ b/drivers/net/ice/base/ice_ptp_hw.h @@ -522,7 +522,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