clarify implementation of ethtool's get_ts_info op
Subsystems (10)
PATCH 1/8 clarify implementation of ethtool's get_ts_info op
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.
--- Documentation/networking/timestamping.txt | 7 +++++++ include/uapi/linux/ethtool.h | 5 +++++ 2 files changed, 12 insertions(+)
Documentation/networking/timestamping.txt +7 -0
@@ -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
include/uapi/linux/ethtool.h +5 -0
@@ -1062,6 +1062,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;
Signature · 1 line
2.1.0
PATCH 2/8 freescale: remove incorrect copied comment
The comment in question is word-for-word copied from ixgbe, and clearly has no meaning in freescale's driver. (it even says 'return an error' when the code clearly does not). Remove the comment as it is obviously incorrect and not applicable to the code as it is today.
--- drivers/net/ethernet/freescale/fec_ptp.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/ethernet/freescale/fec_ptp.c +0 -6
@@ -505,12 +505,6 @@ int fec_ptp_set(struct net_device *ndev, struct ifreq *ifr)break ;default : -/* -* register RXMTRL must be set in order to do V1 packets, -* therefore it is not possible to time stamp both V1 Sync and -* Delay_Req messages and hardware does not support -* timestamping all packets => return error -*/ fep->hwts_rx_en =1 ; config.rx_filter =HWTSTAMP_FILTER_ALL ;break ;
Signature · 1 line
2.1.0
PATCH 3/8 bnx2x: only report most generic filters in get_ts_info
In reply to Jacob Keller--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +1 -10
@@ -3517,17 +3517,8 @@ static int bnx2x_get_ts_info(struct net_device *dev, info->rx_filters = (1 <<HWTSTAMP_FILTER_NONE ) | (1 <<HWTSTAMP_FILTER_PTP_V1_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ) | (1 <<HWTSTAMP_FILTER_PTP_V2_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_DELAY_REQ ); + (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT ); info->tx_types = (1 <<HWTSTAMP_TX_OFF )|(1 <<HWTSTAMP_TX_ON );
Signature · 1 line
2.1.0
PATCH 4/8 i40e: only report generic filters in get_ts_info
In reply to Jacob Keller--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 -11
@@ -1467,17 +1467,8 @@ static int i40e_get_ts_info(struct net_device *dev, info->tx_types = (1 <<HWTSTAMP_TX_OFF ) | (1 <<HWTSTAMP_TX_ON ); info->rx_filters = (1 <<HWTSTAMP_FILTER_NONE ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ ); + (1 <<HWTSTAMP_FILTER_PTP_V1_L4_EVENT ) | + (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT );return 0 ; }
Signature · 1 line
2.1.0
PATCH 5/8 igb: only report generic filters in get_ts_info
In reply to Jacob Keller--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +0 -4
@@ -2396,10 +2396,6 @@ static int igb_get_ts_info(struct net_device *dev, info->rx_filters |= (1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC ) | (1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ ) | (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT );return 0 ;
Signature · 1 line
2.1.0
Brown
PATCH 5/8 igb: only report generic filters in get_ts_info
Quoted 11 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, April 22, 2015 2:41 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 5/8] igb: only report generic filters inget_ts_infoSigned-off-by Jacob Keller <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 4 ---- 1 file changed, 4 deletions(-)
PATCH 6/8 ixgbe: only report generic filters in get_ts_info
In reply to Jacob Keller--- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +0 -8
@@ -2923,14 +2923,6 @@ static int ixgbe_get_ts_info(struct net_device *dev, (1 <<HWTSTAMP_FILTER_NONE ) | (1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC ) | (1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ ) | (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT );break ;default :
Signature · 1 line
2.1.0
Schmitt
PATCH 6/8 ixgbe: only report generic filters in get_ts_info
Quoted 10 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, April 22, 2015 2:41 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 6/8] ixgbe: only report generic filters inget_ts_info
Quoted 5 lines
Signed-off-by Jacob Keller <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 8 -------- 1 file changed, 8 deletions(-)
PATCH 7/8 siena: only report generic filters in get_ts_info
In reply to Jacob Keller--- drivers/net/ethernet/sfc/siena.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/sfc/siena.c +1 -5
@@ -1021,9 +1021,5 @@ const struct efx_nic_type siena_a0_nic_type = { .max_rx_ip_filters = FR_BZ_RX_FILTER_TBL0_ROWS, .hwtstamp_filters = (1 <<HWTSTAMP_FILTER_NONE |1 <<HWTSTAMP_FILTER_PTP_V1_L4_EVENT | -1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC | -1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ | -1 <<HWTSTAMP_FILTER_PTP_V2_L4_EVENT | -1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC | - 1 << HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ), + 1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT), };
Signature · 1 line
2.1.0
PATCH 8/8 dp83640: only report generic filters in ts_info
In reply to Jacob Keller--- drivers/net/phy/dp83640.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/phy/dp83640.c +1 -9
@@ -1434,17 +1434,9 @@ static int dp83640_ts_info(struct phy_device *dev, struct ethtool_ts_info *info) info->rx_filters = (1 <<HWTSTAMP_FILTER_NONE ) | (1 <<HWTSTAMP_FILTER_PTP_V1_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ ) | (1 <<HWTSTAMP_FILTER_PTP_V2_L4_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ ) | (1 <<HWTSTAMP_FILTER_PTP_V2_L2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_SYNC ) | - (1 <<HWTSTAMP_FILTER_PTP_V2_DELAY_REQ ); + (1 <<HWTSTAMP_FILTER_PTP_V2_EVENT );return 0 ; }
Signature · 1 line
2.1.0
Schmitt
PATCH 1/8 clarify implementation of ethtool's get_ts_info op
In reply to Jacob KellerQuoted 19 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, April 22, 2015 2:41 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 1/8] clarify implementation of ethtool'sget_ts_infoopThis 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 forethtool_ts_infoto specify that drivers ought to only report the filters they support without upscaling in this manner.
Quoted 5 lines
Signed-off-by Jacob Keller <[email protected]>--- Documentation/networking/timestamping.txt | 7 +++++++ include/uapi/linux/ethtool.h | 5 +++++ 2 files changed, 12 insertions(+)
Brown
PATCH 1/8 clarify implementation of ethtool's get_ts_info op
In reply to Jacob KellerQuoted 17 lines
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, April 22, 2015 2:41 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH 1/8] clarify implementation of ethtool'sget_ts_infoopThis 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 forethtool_ts_infoto specify that drivers ought to only report the filters they support without upscaling in this manner.
Quoted 6 lines
Signed-off-by Jacob Keller <[email protected]>--- Documentation/networking/timestamping.txt | 7 +++++++ include/uapi/linux/ethtool.h | 5 +++++ 2 files changed, 12 insertions(+)