]> git.baikalelectronics.ru Git - kernel.git/commit
ice: report the PTP clock index in ethtool .get_ts_info
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 9 Jun 2021 16:39:51 +0000 (09:39 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 11 Jun 2021 15:47:41 +0000 (08:47 -0700)
commitfb604e1f26997d45f0bb0449df23b26c1291d472
tree5fa926de32005737ad39b7baf72cf1deff8ef5a8
parent40b7ff849b7a14d4095c9b98dd47976420b9a12f
ice: report the PTP clock index in ethtool .get_ts_info

Now that the driver registers a PTP clock device that represents the
clock hardware, it is important that the clock index is reported via the
ethtool .get_ts_info callback.

The underlying hardware resource is shared between multiple PF
functions. Only one function owns the hardware resources associated with
a timer, but multiple functions may be associated with it for the
purposes of timestamping.

To support this, the owning PF will store the clock index into the
driver shared parameters buffer in firmware. Other PFs will look up the
clock index by reading the driver shared parameter on demand when
requested via the .get_ts_info ethtool function.

In this way, all functions which are tied to the same timer are able to
report the clock index. Userspace software such as ptp4l performs
a look up on the netdev to determine the associated clock, and all
commands to control or configure the clock will be handled through the
controlling PF.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_ptp.c
drivers/net/ethernet/intel/ice/ice_ptp.h