linux/drivers/net/ethernet/broadcom
Guilherme G. Piccoli 3c91f25c2f bnx2x: Prevent ptp_task to be rescheduled indefinitely
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.hausman@canonical.com>
Suggested-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
Acked-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-06-29 12:19:42 -07:00
..
bnx2x bnx2x: Prevent ptp_task to be rescheduled indefinitely 2019-06-29 12:19:42 -07:00
bnxt bnxt_en: Device serial number is supported only for PFs. 2019-05-22 18:02:14 -07:00
genet treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
b44.c net: b44: replace dev_kfree_skb_xxx by dev_consume_skb_xxx for drop profiles 2019-01-29 10:11:42 -08:00
b44.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bcm63xx_enet.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 61 2019-05-24 17:36:45 +02:00
bcm63xx_enet.h bcm63xx_enet: use platform device id directly for miibus name 2017-12-19 11:07:16 -05:00
bcmsysport.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
bcmsysport.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
bgmac-bcma-mdio.c
bgmac-bcma.c net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
bgmac-platform.c net: ethernet: support of_get_mac_address new ERR_PTR error 2019-05-07 12:22:47 -07:00
bgmac.c net: phy: fixed-phy: Drop GPIO from fixed_phy_add() 2019-02-04 18:33:36 -08:00
bgmac.h net: bgmac: Correctly annotate register space 2018-04-01 22:20:48 -04:00
bnx2_fw.h
bnx2.c drivers: Remove explicit invocations of mmiowb() 2019-04-08 12:01:02 +01:00
bnx2.h
cnic_defs.h
cnic_if.h
cnic.c cnic: Refactor code and mark expected switch fall-through 2019-04-26 11:28:47 -04:00
cnic.h
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sb1250-mac.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
tg3.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2019-05-07 22:03:58 -07:00
tg3.h broadcom: tg3: fix use of SPEED_UNKNOWN ethtool constant 2019-04-08 16:30:43 -07:00