[Intel-wired-lan] [PATCH net] ixgbe: fix timestamp configuration code
Pucha, HimasekharX Reddy
himasekharx.reddy.pucha at intel.com
Thu Sep 7 06:39:46 UTC 2023
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces at osuosl.org> On Behalf Of Vadim Fedorenko
> Sent: Thursday, August 24, 2023 3:46 AM
> To: Brandeburg, Jesse <jesse.brandeburg at intel.com>; Nguyen, Anthony L <anthony.l.nguyen at intel.com>; Jakub Kicinski <kuba at kernel.org>; Alexander Duyck <alexander.duyck at gmail.com>; Rustad, Mark D <mark.d.rustad at intel.com>; Darin Miller <darin.j.miller at intel.com>; Jeff Kirsher <jeffrey.t.kirsher at intel.com>; Richard Cochran <richardcochran at gmail.com>
> Cc: netdev at vger.kernel.org; intel-wired-lan at lists.osuosl.org; Vadim Fedorenko <vadim.fedorenko at linux.dev>
> Subject: [Intel-wired-lan] [PATCH net] ixgbe: fix timestamp configuration code
>
> The commit in fixes introduced flags to control the status of hardware
> configuration while processing packets. At the same time another structure
> is used to provide configuration of timestamper to user-space applications.
> The way it was coded makes this structures go out of sync easily. The
> repro is easy for 82599 chips:
>
> [root at hostname ~]# hwstamp_ctl -i eth0 -r 12 -t 1
> current settings:
> tx_type 0
> rx_filter 0
> new settings:
> tx_type 1
> rx_filter 12
>
> The eth0 device is properly configured to timestamp any PTPv2 events.
>
> [root at hostname ~]# hwstamp_ctl -i eth0 -r 1 -t 1
> current settings:
> tx_type 1
> rx_filter 12
> SIOCSHWTSTAMP failed: Numerical result out of range
> The requested time stamping mode is not supported by the hardware.
>
> The error is properly returned because HW doesn't support all packets
> timestamping. But the adapter->flags is cleared of timestamp flags
> even though no HW configuration was done. From that point no RX timestamps
> are received by user-space application. But configuration shows good
> values:
>
> [root at hostname ~]# hwstamp_ctl -i eth0
> current settings:
> tx_type 1
> rx_filter 12
>
> Fix the issue by applying new flags only when the HW was actually
> configured.
>
> Fixes: a9763f3cb54c ("ixgbe: Update PTP to support X550EM_x devices")
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko at linux.dev>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 28 +++++++++++---------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha at intel.com> (A Contingent worker at Intel)
More information about the Intel-wired-lan
mailing list