From patchwork Thu Jun 6 22:46:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Brandeburg X-Patchwork-Id: 13689020 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 D64F113DDC5; Thu, 6 Jun 2024 22:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717714037; cv=none; b=HDFmAOVj7xYjlo5ErIQtouh2BPIXDjVUvaKelAFBSTwcHSLrhSoaj3pFvqk2ttVNhNzs7tczspcGxgMyT+tG3yHy7J/pe8PAcrxCsi8gufh/jTVzK7e/wunrsL55q13oKfSbcTNFwN8QdEIEONZS1VEcO0DDKOkmHaXE2ZZ4c9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717714037; c=relaxed/simple; bh=IQbaN1PyCav0Y/g6MkJYTJ58TbA4AQLCkvXvbv1VlrM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W4Q1VWdXunEgsaQnEsA9djhanCgDuxZC3d8O4eOQvNvXuFYNI/kc3rOMZoosAvmfBhYfhZ9bfuQaTjry7JqhFaR2ga8Icvv2RgDIU+RuLb4lLJ4j980pxGVvSYBuIVGLgUrG1pGZBMsmeHzab8rILrWqdM6P6Ww6E8MN63q3xkE= 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=YJH7uAu+; arc=none smtp.client-ip=192.198.163.19 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="YJH7uAu+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717714036; x=1749250036; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IQbaN1PyCav0Y/g6MkJYTJ58TbA4AQLCkvXvbv1VlrM=; b=YJH7uAu+YOHQa49nn/mHJDEnFRW0rHNKN5TGSp+ULboFZ24MvhZ2Ae/j L+Hd3Olj29V8F92WL5Occd8KT87UZLW7/q79c+hX3MA5DJ4gF0VthtOkp x3/yfgvG5vn6ajF3ptUs6rv/QLobQnsAw2dERyo4aermt73bsV1ijXyZI eD0K/C33QgUlLDD2VRkpLu2yccPta1i7Y0FVJPNgDoSmNaYPy0ncufCnI 9hmNAESFMRpQIqwRGtb1kCZaYUoTUYFStYMETORFHDgrS73x2KMKpBm/m Zas1vij6D0KrROje9l6K2kc8AZSy7oajORt2qfkiZzvB3eeVX/zVObSMq w==; X-CSE-ConnectionGUID: 1wH3fj/ySPOtYTInER4p+Q== X-CSE-MsgGUID: IPw/qyHiQm+ahikTtAxdCA== X-IronPort-AV: E=McAfee;i="6600,9927,11095"; a="14224010" X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="14224010" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 15:47:12 -0700 X-CSE-ConnectionGUID: Ka3nhXjBQ5KrvMiFuZ/iyw== X-CSE-MsgGUID: 71bnbA24R+CR341US9FiRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,219,1712646000"; d="scan'208";a="38243840" Received: from jbrandeb-spr1.jf.intel.com ([10.166.28.233]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2024 15:47:11 -0700 From: Jesse Brandeburg To: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org Cc: Jesse Brandeburg , corbet@lwn.net, linux-doc@vger.kernel.org, Jacob Keller , Jakub Kicinski Subject: [PATCH iwl-next v2 3/5] ice: add tracking of good transmit timestamps Date: Thu, 6 Jun 2024 15:46:57 -0700 Message-ID: <20240606224701.359706-4-jesse.brandeburg@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240606224701.359706-1-jesse.brandeburg@intel.com> References: <20240606224701.359706-1-jesse.brandeburg@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org As a pre-requisite to implementing timestamp statistics, start tracking successful PTP timestamps. There already existed a trace event, but add a counter as well so it can be displayed by the next patch. Good count is a u64 as it is much more likely to be incremented. The existing error stats are all u32 as before, and are less likely so will wrap less. Reviewed-by: Jacob Keller Reviewed-by: Jakub Kicinski Signed-off-by: Jesse Brandeburg Reviewed-by: Simon Horman --- drivers/net/ethernet/intel/ice/ice_ptp.c | 9 +++++++++ drivers/net/ethernet/intel/ice/ice_ptp.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 0f17fc1181d2..ff0ba81d0694 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -628,6 +628,9 @@ void ice_ptp_complete_tx_single_tstamp(struct ice_ptp_tx *tx) if (tstamp) { shhwtstamps.hwtstamp = ns_to_ktime(tstamp); ice_trace(tx_tstamp_complete, skb, idx); + + /* Count the number of Tx timestamps that succeeded */ + pf->ptp.tx_hwtstamp_good++; } skb_tstamp_tx(skb, &shhwtstamps); @@ -686,6 +689,7 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) { struct ice_ptp_port *ptp_port; unsigned long flags; + u32 tstamp_good = 0; struct ice_pf *pf; struct ice_hw *hw; u64 tstamp_ready; @@ -786,11 +790,16 @@ static void ice_ptp_process_tx_tstamp(struct ice_ptp_tx *tx) if (tstamp) { shhwtstamps.hwtstamp = ns_to_ktime(tstamp); ice_trace(tx_tstamp_complete, skb, idx); + + /* Count the number of Tx timestamps that succeeded */ + tstamp_good++; } skb_tstamp_tx(skb, &shhwtstamps); dev_kfree_skb_any(skb); } + + pf->ptp.tx_hwtstamp_good += tstamp_good; } /** diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.h b/drivers/net/ethernet/intel/ice/ice_ptp.h index 3af20025043a..2b15f2b58789 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.h +++ b/drivers/net/ethernet/intel/ice/ice_ptp.h @@ -253,6 +253,7 @@ struct ice_ptp { struct ptp_clock *clock; struct hwtstamp_config tstamp_config; u64 reset_time; + u64 tx_hwtstamp_good; u32 tx_hwtstamp_skipped; u32 tx_hwtstamp_timeouts; u32 tx_hwtstamp_flushed;