All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Brelinski, TonyX <tonyx.brelinski@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH v2 8/8] ice: enable transmit timestamps for E810 devices
Date: Thu, 10 Jun 2021 21:34:33 +0000	[thread overview]
Message-ID: <CO1PR11MB5105C3616AD5C6957D5B3A37FA359@CO1PR11MB5105.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210609163953.52440-9-anthony.l.nguyen@intel.com>

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Tony Nguyen
> Sent: Wednesday, June 9, 2021 9:40 AM
> To: intel-wired-lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH v2 8/8] ice: enable transmit timestamps for
> E810 devices
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> Add support for enabling Tx timestamp requests for outgoing packets on
> E810 devices.
> 
> The ice hardware can support multiple outstanding Tx timestamp requests.
> When sending a descriptor to hardware, a Tx timestamp request is made by
> setting a request bit, and assigning an index that represents which Tx
> timestamp index to store the timestamp in.
> 
> Hardware makes no effort to synchronize the index use, so it is up to
> software to ensure that Tx timestamp indexes are not re-used before the
> timestamp is reported back.
> 
> To do this, introduce a Tx timestamp tracker which will keep track of currently
> in-use indexes.
> 
> In the hot path, if a packet has a timestamp request, an index will be
> requested from the tracker. Unfortunately, this does require a lock as the
> indexes are shared across all queues on a PHY. There are not enough indexes
> to reliably assign only 1 to each queue.
> 
> For the E810 devices, the timestamp indexes are not shared across PHYs, so
> each port can have its own tracking.
> 
> Once hardware captures a timestamp, an interrupt is fired. In this interrupt,
> trigger a new work item that will figure out which timestamp was completed,
> and report the timestamp back to the stack.
> 
> This function loops through the Tx timestamp indexes and checks whether
> there is now a valid timestamp. If so, it clears the PHY timestamp indication in
> the PHY memory, locks and removes the SKB and bit in the tracker, then
> reports the timestamp to the stack.
> 
> It is possible in some cases that a timestamp request will be initiated but
> never completed. This might occur if the packet is dropped by software or
> hardware before it reaches the PHY.
> 
> Add a task to the periodic work function that will check whether a timestamp
> request is more than a few seconds old. If so, the timestamp index is cleared
> in the PHY, and the SKB is released.
> 
> Just as with Rx timestamps, the Tx timestamps are only 40 bits wide, and use
> the same overall logic for extending to 64 bits of nanoseconds.
> 
> With this change, E810 devices should be able to perform basic PTP
> functionality.
> 
> Future changes will extend the support to cover the E822-based devices.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_base.c     |   9 +
>  drivers/net/ethernet/intel/ice/ice_ethtool.c  |   6 +-
>  .../net/ethernet/intel/ice/ice_hw_autogen.h   |   1 +
>  drivers/net/ethernet/intel/ice/ice_lib.c      |   1 +
>  drivers/net/ethernet/intel/ice/ice_main.c     |   5 +
>  drivers/net/ethernet/intel/ice/ice_ptp.c      | 369 +++++++++++++++++-
>  drivers/net/ethernet/intel/ice/ice_ptp.h      |  91 +++++
>  drivers/net/ethernet/intel/ice/ice_txrx.c     |  37 ++
>  drivers/net/ethernet/intel/ice/ice_txrx.h     |   3 +
>  9 files changed, 518 insertions(+), 4 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> (A Contingent Worker at Intel)



      reply	other threads:[~2021-06-10 21:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 16:39 [Intel-wired-lan] [PATCH v2 0/8] ice: implement PTP clock for E810 devices Tony Nguyen
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 1/8] ice: add support for sideband messages Tony Nguyen
2021-06-10 20:03   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 2/8] ice: process 1588 PTP capabilities during initialization Tony Nguyen
2021-06-10 20:04   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 3/8] ice: add support for set/get of driver-stored firmware parameters Tony Nguyen
2021-06-10 21:16   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 4/8] ice: add low level PTP clock access functions Tony Nguyen
2021-06-10 21:19   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 5/8] ice: register 1588 PTP clock device object for E810 devices Tony Nguyen
2021-06-10 21:19   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 6/8] ice: report the PTP clock index in ethtool .get_ts_info Tony Nguyen
2021-06-10 21:20   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 7/8] ice: enable receive hardware timestamping Tony Nguyen
2021-06-10 21:21   ` Brelinski, TonyX
2021-06-09 16:39 ` [Intel-wired-lan] [PATCH v2 8/8] ice: enable transmit timestamps for E810 devices Tony Nguyen
2021-06-10 21:34   ` Brelinski, TonyX [this message]

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=CO1PR11MB5105C3616AD5C6957D5B3A37FA359@CO1PR11MB5105.namprd11.prod.outlook.com \
    --to=tonyx.brelinski@intel.com \
    --cc=intel-wired-lan@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.