From: Jacob Keller <jacob.e.keller@intel.com>
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [PATCH net-next 09/15] ice: return true if Tx tracker is uninitialized
Date: Tue, 1 Nov 2022 15:52:34 -0700 [thread overview]
Message-ID: <20221101225240.421525-10-jacob.e.keller@intel.com> (raw)
In-Reply-To: <20221101225240.421525-1-jacob.e.keller@intel.com>
If the PTP Tx timestamp tracker is not initialized, then there is no work
to complete, so the ice_ptp_tx_tstamp function should return true, rather
than false.
With this change, we also don't need to re-check the init status prior to
calling the function as it now returns the correct value.
Also update the ice_ptp_tx_tstamp function comment to properly clarify the
return value meaning.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
drivers/net/ethernet/intel/ice/ice_ptp.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index e2c2b1e52346..91ee36d3d21f 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -650,11 +650,14 @@ ice_ptp_is_tx_tracker_up(struct ice_ptp_tx *tx)
* 2) extend the 40b timestamp value to get a 64bit timestamp
* 3) send that timestamp to the stack
*
- * After looping, if we still have waiting SKBs, return true. This may cause us
- * effectively poll even when not strictly necessary. We do this because it's
- * possible a new timestamp was requested around the same time as the interrupt.
- * In some cases hardware might not interrupt us again when the timestamp is
- * captured.
+ * Returns true if all timestamps were handled, and false if any slots remain
+ * without a timestamp.
+ *
+ * After looping, if we still have waiting SKBs, return false. This may cause
+ * us effectively poll even when not strictly necessary. We do this because
+ * it's possible a new timestamp was requested around the same time as the
+ * interrupt. In some cases hardware might not interrupt us again when the
+ * timestamp is captured.
*
* Note that we only take the tracking lock when clearing the bit and when
* checking if we need to re-queue this task. The only place where bits can be
@@ -697,7 +700,7 @@ static bool ice_ptp_tx_tstamp(struct ice_ptp_tx *tx)
u8 idx;
if (!ice_ptp_is_tx_tracker_init(tx))
- return false;
+ return true;
ptp_port = container_of(tx, struct ice_ptp_port, tx);
pf = ptp_port_to_pf(ptp_port);
@@ -2449,10 +2452,7 @@ s8 ice_ptp_request_ts(struct ice_ptp_tx *tx, struct sk_buff *skb)
*/
bool ice_ptp_process_ts(struct ice_pf *pf)
{
- if (pf->ptp.port.tx.init)
- return ice_ptp_tx_tstamp(&pf->ptp.port.tx);
-
- return false;
+ return ice_ptp_tx_tstamp(&pf->ptp.port.tx);
}
static void ice_ptp_periodic_work(struct kthread_work *work)
--
2.38.0.83.gd420dda05763
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
next prev parent reply other threads:[~2022-11-01 22:53 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-01 22:52 [Intel-wired-lan] [PATCH net-next 00/15] ice: improve Tx timestamp corner cases Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 01/15] ice: Use more generic names for ice_ptp_tx fields Jacob Keller
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:50 ` Temerkhanov, Sergey
2022-11-03 20:54 ` Jacob Keller
2022-11-03 20:53 ` Jacob Keller
2022-11-17 10:40 ` G, GurucharanX
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 02/15] ice: Remove the E822 vernier "bypass" logic Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 03/15] ice: Reset TS memory for all quads Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 04/15] ice: fix misuse of "link err" with "link status" Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 05/15] ice: always call ice_ptp_link_change and make it void Jacob Keller
2022-11-02 0:01 ` Ertman, David M
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:48 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 06/15] ice: handle discarding old Tx requests in ice_ptp_tx_tstamp Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 07/15] ice: check Tx timestamp memory register for ready timestamps Jacob Keller
2022-11-03 19:23 ` Jacob Keller
2022-11-03 20:44 ` Tony Nguyen
2022-11-03 20:52 ` Jacob Keller
2022-11-03 20:45 ` Stillwell Jr, Paul M
2022-11-03 20:52 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 08/15] ice: protect init and calibrating fields with spinlock Jacob Keller
2022-11-01 22:52 ` Jacob Keller [this message]
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 10/15] ice: disable Tx timestamps while link is down Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 11/15] ice: cleanup allocations in ice_ptp_alloc_tx_tracker Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 12/15] ice: handle flushing stale Tx timestamps in ice_ptp_tx_tstamp Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 13/15] ice: only check set bits in ice_ptp_flush_tx_tracker Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 14/15] ice: make Tx and Rx vernier offset calibration independent Jacob Keller
2022-11-03 20:45 ` Tony Nguyen
2022-11-03 20:52 ` Jacob Keller
2022-11-01 22:52 ` [Intel-wired-lan] [PATCH net-next 15/15] ice: reschedule ice_ptp_wait_for_offset_valid during reset Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221101225240.421525-10-jacob.e.keller@intel.com \
--to=jacob.e.keller@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox