From: "Guilherme G. Piccoli" <gpicc...@canonical.com>
Date: Thu, 27 Jun 2019 13:31:33 -0300

> Currently bnx2x ptp worker tries to read a register with timestamp
> information in case of TX packet timestamping and in case it fails,
> the routine reschedules itself indefinitely. This was reported as a
> kworker always at 100% of CPU usage, which was narrowed down to be
> bnx2x ptp_task.
> 
> By following the ioctl handler, we could narrow down the problem to
> an NTP tool (chrony) requesting HW timestamping from bnx2x NIC with
> RX filter zeroed; this isn't reproducible for example with ptp4l
> (from linuxptp) since this tool requests a supported RX filter.
> It seems NIC FW timestamp mechanism cannot work well with
> RX_FILTER_NONE - driver's PTP filter init routine skips a register
> write to the adapter if there's not a supported filter request.
> 
> This patch addresses the problem of bnx2x ptp thread's everlasting
> reschedule by retrying the register read 10 times; between the read
> attempts the thread sleeps for an increasing amount of time starting
> in 1ms to give FW some time to perform the timestamping. If it still
> fails after all retries, we bail out in order to prevent an unbound
> resource consumption from bnx2x.
> 
> The patch also adds an ethtool statistic for accounting the skipped
> TX timestamp packets and it reduces the priority of timestamping
> error messages to prevent log flooding. The code was tested using
> both linuxptp and chrony.
> 
> Reported-and-tested-by: Przemyslaw Hausman <przemyslaw.haus...@canonical.com>
> Suggested-by: Sudarsana Reddy Kalluru <skall...@marvell.com>
> Signed-off-by: Guilherme G. Piccoli <gpicc...@canonical.com>

Applied and queued up for -stable.

Reply via email to