netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 01/14] clarify implementation of ethtool's get_ts_info op
Date: Fri, 17 Jul 2015 07:25:10 -0700	[thread overview]
Message-ID: <1437143123-5031-2-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1437143123-5031-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Jacob Keller <jacob.e.keller@intel.com>

This patch adds some clarification about the intended way to implement
both SIOCSHWTSTAMP and ethtool's get_ts_info. The HWTSTAMP API has
several Rx filters which are very specific, as well as more general
filters. The specific filters really only exist to support some broken
hardware which can't fully implement the generic filters. This patch
adds clarification that it is okay to support the specific filters in
SIOCSHWTSTAMP by upscaling them to the generic filters. In addition,
update the header for ethtool_ts_info to specify that drivers ought to
only report the filters they support without upscaling in this manner.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Reviewed-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 Documentation/networking/timestamping.txt | 7 +++++++
 include/uapi/linux/ethtool.h              | 5 +++++
 2 files changed, 12 insertions(+)

diff --git a/Documentation/networking/timestamping.txt b/Documentation/networking/timestamping.txt
index 5f09226..a977339 100644
--- a/Documentation/networking/timestamping.txt
+++ b/Documentation/networking/timestamping.txt
@@ -359,6 +359,13 @@ the requested fine-grained filtering for incoming packets is not
 supported, the driver may time stamp more than just the requested types
 of packets.
 
+Drivers are free to use a more permissive configuration than the requested
+configuration. It is expected that drivers should only implement directly the
+most generic mode that can be supported. For example if the hardware can
+support HWTSTAMP_FILTER_V2_EVENT, then it should generally always upscale
+HWTSTAMP_FILTER_V2_L2_SYNC_MESSAGE, and so forth, as HWTSTAMP_FILTER_V2_EVENT
+is more generic (and more useful to applications).
+
 A driver which supports hardware time stamping shall update the struct
 with the actual, possibly more permissive configuration. If the
 requested packets cannot be time stamped, then nothing should be
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index cd67aec..cd16291 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -1093,6 +1093,11 @@ struct ethtool_sfeatures {
  * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values,
  * respectively.  For example, if the device supports HWTSTAMP_TX_ON,
  * then (1 << HWTSTAMP_TX_ON) in 'tx_types' will be set.
+ *
+ * Drivers should only report the filters they actually support without
+ * upscaling in the SIOCSHWTSTAMP ioctl. If the SIOCSHWSTAMP request for
+ * HWTSTAMP_FILTER_V1_SYNC is supported by HWTSTAMP_FILTER_V1_EVENT, then the
+ * driver should only report HWTSTAMP_FILTER_V1_EVENT in this op.
  */
 struct ethtool_ts_info {
 	__u32	cmd;
-- 
2.4.3

  reply	other threads:[~2015-07-17 14:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-17 14:25 [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-07-17 Jeff Kirsher
2015-07-17 14:25 ` Jeff Kirsher [this message]
2015-07-17 19:17   ` [net-next 01/14] clarify implementation of ethtool's get_ts_info op Richard Cochran
2015-07-17 14:25 ` [net-next 02/14] freescale: remove incorrect copied comment Jeff Kirsher
2015-07-17 14:25 ` [net-next 03/14] bnx2x: only report most generic filters in get_ts_info Jeff Kirsher
2015-07-17 14:25 ` [net-next 04/14] i40e: only report " Jeff Kirsher
2015-07-17 14:25 ` [net-next 05/14] igb: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 06/14] ixgbe: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 07/14] siena: " Jeff Kirsher
2015-07-17 14:25 ` [net-next 08/14] dp83640: only report generic filters in ts_info Jeff Kirsher
2015-07-17 14:25 ` [net-next 09/14] igb: Pull timestamp from fragment before adding it to skb Jeff Kirsher
2015-07-17 14:25 ` [net-next 10/14] ixgbevf: fold ixgbevf_pull_tail into ixgbevf_add_rx_frag Jeff Kirsher
2015-07-17 14:25 ` [net-next 11/14] ixgbe: Specify Rx hash type WRT Rx desc RSS type Jeff Kirsher
2015-07-17 14:25 ` [net-next 12/14] ixgbevf: Set Rx hash type for ingress packets Jeff Kirsher
2015-07-17 14:25 ` [net-next 13/14] ixgbe: Don't report flow director filter's status Jeff Kirsher
2015-07-17 14:25 ` [net-next 14/14] igb: Fix i354 88E1112 PHY on RCC boards using AutoMediaDetect Jeff Kirsher
2015-07-21  3:50 ` [net-next 00/14][pull request] Intel Wired LAN Driver Updates 2015-07-17 David Miller

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=1437143123-5031-2-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jacob.e.keller@intel.com \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).