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 C08B54404F; Wed, 12 Jun 2024 17:13:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2A2C42E63; Wed, 12 Jun 2024 17:05:13 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 4B11242D78 for ; Wed, 12 Jun 2024 17:05:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718204708; x=1749740708; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q9hcUfoV8CuNg/Mhrhc7+yX8Lgg4S8DL5eO2yz1h0vk=; b=XA1Nk8Xes8kQZRkBACqodPSwfUaAqwN5iQfV1aB03vWBTd3LgSMwmaNc YdxV0DI9+XDgcue3tDgPCmrPlJVlixYPAwYON5LlYHNdcJetZV/9hBDZb h7tFDLP8Ui1LWFg60m3o4QuZFvFjLpE17Fs8RXb6pYmxfMClP0hJ1AbYy KxpCbmnUhs1T5Oxt6h/Mq3NDQkwi4TqRnwUQGT9tP+zZLOWD1y6uVC1tk dEtPHrXbYMujW0VEAsXAYNQCycE46Pr3dGWxdZ2ia4X564gezZ+I7Ptjz m6tBe/4ngKr+nThi2/0PTmA5UPJ2E2r+rAg5nug00pTdUPjJj4PAOgibC w==; X-CSE-ConnectionGUID: bIwXFQPURHaHGIqI9LQXRg== X-CSE-MsgGUID: yM94lhkaRxCHDCJP9Vq51Q== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="32459561" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="32459561" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 08:04:55 -0700 X-CSE-ConnectionGUID: L7BEkqfrRGK9V+rpQekZTw== X-CSE-MsgGUID: aYb8YL/9SfmViLySozbGlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="39925416" Received: from silpixa00401119.ir.intel.com ([10.55.129.167]) by orviesa009.jf.intel.com with ESMTP; 12 Jun 2024 08:04:54 -0700 From: Anatoly Burakov To: dev@dpdk.org Cc: Ian Stokes , bruce.richardson@intel.com, Jacob Keller Subject: [PATCH v2 060/148] net/ice/base: update comments regarding clearing timestamps Date: Wed, 12 Jun 2024 16:00:54 +0100 Message-ID: <3f16c50b34605068853957bafe8832be1621f3d3.1718204528.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240430154014.1026-1-ian.stokes@intel.com> 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: Ian Stokes During upstream review of the introduction of ice_clear_phy_tstamp(), reviewers requested to clarify the comments regarding the function behavior. Signed-off-by: Jacob Keller Signed-off-by: Ian Stokes --- drivers/net/ice/base/ice_ptp_hw.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c index 22b3fe917a..07c8c65050 100644 --- a/drivers/net/ice/base/ice_ptp_hw.c +++ b/drivers/net/ice/base/ice_ptp_hw.c @@ -2825,8 +2825,21 @@ ice_read_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx, u64 *tstamp) * @quad: the quad to read from * @idx: the timestamp index to reset * - * Clear a timestamp, resetting its valid bit, from the PHY quad block that is - * shared between the internal PHYs on the E822 devices. + * Read the timestamp out of the quad to clear its timestamp status bit from + * the PHY quad block that is shared between the internal PHYs of the E822 + * devices. + * + * Note that unlike E810, software cannot directly write to the quad memory + * bank registers. E822 relies on the ice_get_phy_tx_tstamp_ready() function + * to determine which timestamps are valid. Reading a timestamp auto-clears + * the valid bit. + * + * To directly clear the contents of the timestamp block entirely, discarding + * all timestamp data at once, software should instead use + * ice_ptp_reset_ts_memory_quad_e822(). + * + * This function should only be called on an idx whose bit is set according to + * ice_get_phy_tx_tstamp_ready(). */ static int ice_clear_phy_tstamp_e822(struct ice_hw *hw, u8 quad, u8 idx) @@ -4667,13 +4680,20 @@ ice_read_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx, u64 *tstamp) } /** - * ice_clear_phy_tstamp_e810 - Clear a timestamp from the external PHY + * ice_clear_phy_tstamp - Clear a timestamp from the timestamp block * @hw: pointer to the HW struct * @lport: the lport to read from * @idx: the timestamp index to reset * - * Clear a timestamp, resetting its valid bit, from the timestamp block of the - * external PHY on the E810 device. + * Clear a timestamp from the timestamp block, discarding its value without + * returning it. This resets the memory status bit for the timestamp index + * allowing it to be reused for another timestamp in the future. + * + * For E822 devices, the block number is the PHY quad to clear from. For E810 + * devices, the block number is the logical port to clear from. + * + * This function must only be called on a timestamp index whose valid bit is + * set according to ice_get_phy_tx_tstamp_ready(). */ static int ice_clear_phy_tstamp_e810(struct ice_hw *hw, u8 lport, u8 idx) -- 2.43.0