Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AC2113B785 for ; Thu, 25 Jan 2024 21:58:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706219888; cv=none; b=YzTO4N56wVqUMRA9kk+KQKLp3K3YKwAe645jPsR9RhTjbN3fxPqPR4UB4nEPGGE9z8J9I2myWUX9vhU3pXJtFokAq2dsxsldS0V2+sSxYtSUtoJzKcMoAMs2ULuB0OPpFU4IIIF8CSROAshAC9pJZIIjHx95MH6TE+gThEPPc0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706219888; c=relaxed/simple; bh=AuAqs3AoS/bJaAUQamSdw7BY6/34amu1XMCtQakF45A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sOKROgyr0Qm4MGmJa1oaDdVc49GuX5EyFq6VLuODhr11Q8JQTcU0DIih29/Pbyu6/vEygPsoBvDdfBs1tn6Q0bjafTvxndkkYn/0VRKBgvmpHjYCp1W71ApxV85VKhkN7MGeJrkp7no7fSaZA7w5PGogug3C8KRkZCxuYtLmi1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Gwgvdtpe; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Gwgvdtpe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706219887; x=1737755887; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AuAqs3AoS/bJaAUQamSdw7BY6/34amu1XMCtQakF45A=; b=GwgvdtpeZrT+eLLrAHbKU1hAZfnEdabjFV0UXPreR/Snnq2tOX1G/mq+ MIg1gjh95D5vhS885fxEPuKmbBMQswk5iIBVnGXdlhKn3PP4trdPx13+q Kb3vtHZQX7fjc9FvKHX03fi5ULSz2PBbGrMFgEpWdCJ6QlL92NQ7ELN6k 1PdDPBD7OdAoUX0PRc3/n/aoSaN3VJWVvJF0CaTzUJcXmQZ8O2Tp0fqJK BHndBvK449kFdHJBjjGaKJOjs63U9AC2fVOSIoU+0lMeNncGnV+/3BTMf 2DhfmaZUuQGl1/mkaJPS8ZbpwV7TgZ+OisH20cHcmMKXtjtjKGuRd0R8U A==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="9069103" X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="9069103" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2024 13:58:04 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,216,1701158400"; d="scan'208";a="35239930" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa001.jf.intel.com with ESMTP; 25 Jan 2024 13:58:03 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, netdev@vger.kernel.org Cc: Jacob Keller , anthony.l.nguyen@intel.com, richardcochran@gmail.com, Karol Kolacinski , Simon Horman , Pucha Himasekhar Reddy Subject: [PATCH net-next 4/7] ice: don't check has_ready_bitmap in E810 functions Date: Thu, 25 Jan 2024 13:57:52 -0800 Message-ID: <20240125215757.2601799-5-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240125215757.2601799-1-anthony.l.nguyen@intel.com> References: <20240125215757.2601799-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jacob Keller E810 hardware does not have a Tx timestamp ready bitmap. Don't check has_ready_bitmap in E810-specific functions. Add has_ready_bitmap check in ice_ptp_process_tx_tstamp() to stop relying on the fact that ice_get_phy_tx_tstamp_ready() returns all 1s. Signed-off-by: Jacob Keller Signed-off-by: Karol Kolacinski Reviewed-by: Jacob Keller Reviewed-by: Simon Horman Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ptp.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index a10e0018b2e2..69d11dbda22c 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -601,17 +601,13 @@ void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx) /* Read the low 32 bit value */ raw_tstamp |= (u64)rd32(&pf->hw, PF_SB_ATQBAH); - /* For PHYs which don't implement a proper timestamp ready bitmap, - * verify that the timestamp value is different from the last cached - * timestamp. If it is not, skip this for now assuming it hasn't yet - * been captured by hardware. + /* Devices using this interface always verify the timestamp differs + * relative to the last cached timestamp value. */ - if (!drop_ts && !tx->has_ready_bitmap && - raw_tstamp == tx->tstamps[idx].cached_tstamp) + if (raw_tstamp == tx->tstamps[idx].cached_tstamp) return; - if (!tx->has_ready_bitmap && raw_tstamp) - tx->tstamps[idx].cached_tstamp = raw_tstamp; + tx->tstamps[idx].cached_tstamp = raw_tstamp; clear_bit(idx, tx->in_use); skb = tx->tstamps[idx].skb; tx->tstamps[idx].skb = NULL; @@ -701,9 +697,11 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) hw = &pf->hw; /* Read the Tx ready status first */ - err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready); - if (err) - return; + if (tx->has_ready_bitmap) { + err = ice_get_phy_tx_tstamp_ready(hw, tx->block, &tstamp_ready); + if (err) + return; + } /* Drop packets if the link went down */ link_up = ptp_port->link_up; @@ -731,7 +729,8 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) * If we do not, the hardware logic for generating a new * interrupt can get stuck on some devices. */ - if (!(tstamp_ready & BIT_ULL(phy_idx))) { + if (tx->has_ready_bitmap && + !(tstamp_ready & BIT_ULL(phy_idx))) { if (drop_ts) goto skip_ts_read; -- 2.41.0