Message ID | 20180109113705.8464-1-mlichvar@redhat.com |
---|---|
State | Accepted |
Delegated to: | Jeff Kirsher |
Headers | show |
Series | ixgbe: Don't report unsupported timestamping filters for X550 | expand |
On Tue, Jan 09, 2018 at 12:37:05PM +0100, Miroslav Lichvar wrote: > The current code enables on X550 timestamping of all packets for any > filter, which means ethtool should not report any PTP-specific filters > as supported. Right. I keep forgetting the rule about this. It is found in the comment on ethtool_ts_info: * 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. Acked-by: Richard Cochran <richardcochran@gmail.com>
> -----Original Message----- > From: Richard Cochran [mailto:richardcochran@gmail.com] > Sent: Tuesday, January 09, 2018 7:47 AM > To: Miroslav Lichvar <mlichvar@redhat.com> > Cc: intel-wired-lan@lists.osuosl.org; Keller, Jacob E <jacob.e.keller@intel.com> > Subject: Re: [PATCH] ixgbe: Don't report unsupported timestamping filters for > X550 > > On Tue, Jan 09, 2018 at 12:37:05PM +0100, Miroslav Lichvar wrote: > > The current code enables on X550 timestamping of all packets for any > > filter, which means ethtool should not report any PTP-specific filters > > as supported. > > Right. I keep forgetting the rule about this. It is found in the > comment on ethtool_ts_info: > > * 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. > > Acked-by: Richard Cochran <richardcochran@gmail.com> Yep. Various developers had different ideas about this in the past. Acked-by: Jacob Keller <jacob.e.keller@intel.com> Thanks, Jake
> -----Original Message----- > From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On > Behalf Of Miroslav Lichvar > Sent: Tuesday, January 9, 2018 3:37 AM > To: intel-wired-lan@lists.osuosl.org > Cc: Richard Cochran <richardcochran@gmail.com> > Subject: [Intel-wired-lan] [PATCH] ixgbe: Don't report unsupported > timestamping filters for X550 > > The current code enables on X550 timestamping of all packets for any filter, > which means ethtool should not report any PTP-specific filters as supported. > > Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> > --- > drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 37 ++++++++++++------- > ----- > 1 file changed, 19 insertions(+), 18 deletions(-) Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 0aaf70b..0a5a351 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3086,26 +3086,9 @@ static int ixgbe_get_ts_info(struct net_device *dev, case ixgbe_mac_X550EM_x: case ixgbe_mac_x550em_a: info->rx_filters |= BIT(HWTSTAMP_FILTER_ALL); - /* fallthrough */ + break; case ixgbe_mac_X540: case ixgbe_mac_82599EB: - info->so_timestamping = - SOF_TIMESTAMPING_TX_SOFTWARE | - SOF_TIMESTAMPING_RX_SOFTWARE | - SOF_TIMESTAMPING_SOFTWARE | - SOF_TIMESTAMPING_TX_HARDWARE | - SOF_TIMESTAMPING_RX_HARDWARE | - SOF_TIMESTAMPING_RAW_HARDWARE; - - if (adapter->ptp_clock) - info->phc_index = ptp_clock_index(adapter->ptp_clock); - else - info->phc_index = -1; - - info->tx_types = - BIT(HWTSTAMP_TX_OFF) | - BIT(HWTSTAMP_TX_ON); - info->rx_filters |= BIT(HWTSTAMP_FILTER_PTP_V1_L4_SYNC) | BIT(HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) | @@ -3114,6 +3097,24 @@ static int ixgbe_get_ts_info(struct net_device *dev, default: return ethtool_op_get_ts_info(dev, info); } + + info->so_timestamping = + SOF_TIMESTAMPING_TX_SOFTWARE | + SOF_TIMESTAMPING_RX_SOFTWARE | + SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_TX_HARDWARE | + SOF_TIMESTAMPING_RX_HARDWARE | + SOF_TIMESTAMPING_RAW_HARDWARE; + + if (adapter->ptp_clock) + info->phc_index = ptp_clock_index(adapter->ptp_clock); + else + info->phc_index = -1; + + info->tx_types = + BIT(HWTSTAMP_TX_OFF) | + BIT(HWTSTAMP_TX_ON); + return 0; }
The current code enables on X550 timestamping of all packets for any filter, which means ethtool should not report any PTP-specific filters as supported. Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com> --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-)