android_kernel_motorola_sm6225/drivers/net/ethernet
Guilherme G. Piccoli 51216937c3 bnx2x: Prevent ptp_task to be rescheduled indefinitely
[ Upstream commit 3c91f25c2f72ba6001775a5932857c1d2131c531 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-26 09:14:15 +02:00
..
3com net: prevent ISA drivers from building on PPC32 2018-07-22 11:12:29 -07:00
8390 net: phy: rename Asix Electronics PHY driver 2019-07-14 08:11:08 +02:00
adaptec net: adaptec: Replace mdelay() with msleep() in starfire_init_one() 2018-07-26 21:24:23 -07:00
aeroflex
agere
alacritech
allwinner
alteon alteon: acenic: mark expected switch fall-through 2018-08-07 17:54:19 -07:00
altera net: altera_tse: fix msgdma_tx_completion on non-zero fill_level case 2019-03-13 14:02:29 -07:00
amazon net: ena: gcc 8: fix compilation warning 2019-05-31 06:46:09 -07:00
amd amd-xgbe: Fix mdio access for non-zero ports and clause 45 PHYs 2019-01-31 08:14:30 +01:00
apm drivers: net: xgene: Remove unnecessary forward declarations 2019-01-13 09:51:00 +01:00
apple net: apple: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
aquantia net: aquantia: fix LRO with FCS error 2019-06-22 08:15:17 +02:00
arc
atheros net: set static variable an initial value in atl2_probe() 2019-03-23 20:09:52 +01:00
aurora
broadcom bnx2x: Prevent ptp_task to be rescheduled indefinitely 2019-07-26 09:14:15 +02:00
brocade
cadence net: macb: Change interrupt and napi enable order in open 2019-05-16 19:41:29 +02:00
calxeda Merge 4.18-rc5 into char-misc-next 2018-07-16 09:04:54 +02:00
cavium net: lio_core: fix potential sign-extension overflow on large shift 2019-07-14 08:11:14 +02:00
chelsio cxgb4: offload VLAN flows regardless of VLAN ethtype 2019-06-04 08:02:30 +02:00
cirrus net: cirrus: fix return type of ndo_start_xmit function 2018-09-21 19:15:14 -07:00
cisco enic: fix build warning without CONFIG_CPUMASK_OFFSTACK 2019-04-05 22:32:57 +02:00
cortina net: gemini: Fix copy/paste error 2018-12-05 19:31:58 +01:00
davicom
dec net: tulip: de4x5: Drop redundant MODULE_DEVICE_TABLE() 2019-06-22 08:15:17 +02:00
dlink
emulex be2net: fix link failure after ethtool offline test 2019-07-21 09:03:06 +02:00
ezchip
faraday net: faraday: ftmac100: remove netif_running(netdev) check before disabling interrupts 2018-12-13 09:16:14 +01:00
freescale net: fec: Do not use netdev messages too early 2019-07-26 09:14:04 +02:00
fujitsu
hisilicon net: hns3: add some error checking in hclge_tm module 2019-07-26 09:14:14 +02:00
hp net: hp100: fix always-true check for link up state 2018-09-17 07:55:19 -07:00
huawei hinic: remove ndo_poll_controller 2018-09-28 11:12:28 -07:00
i825xx net: i825xx: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
ibm ibmvnic: Fix unchecked return codes of memory allocations 2019-07-14 08:11:08 +02:00
intel igb: clear out skb->tstamp after reading the txtime 2019-07-26 09:14:14 +02:00
marvell net: mvpp2: prs: Don't override the sign bit in SRAM parser shift 2019-07-26 09:14:14 +02:00
mediatek net: ethernet: mediatek: Use NET_IP_ALIGN to judge if HW RX_2BYTE_OFFSET is enabled 2019-06-25 11:35:57 +08:00
mellanox mlxsw: spectrum: Disallow prio-tagged packets when PVID is removed 2019-07-14 08:11:10 +02:00
micrel net: ks8851: Set initial carrier state to down 2019-05-04 09:20:16 +02:00
microchip lan743x: Fix TX Stall Issue 2019-03-19 13:12:38 +01:00
moxa
mscc ocelot: Don't sleep in atomic context (irqs_disabled()) 2019-05-16 19:41:23 +02:00
myricom
natsemi
neterion vxge: fix return of a free'd memblock on a failed dma mapping 2019-05-16 19:41:21 +02:00
netronome nfp: flower: add rcu locks when accessing netdev for tunnels 2019-05-25 18:23:20 +02:00
ni net: nixge: Don't store skb in app4 field of descriptor 2018-08-13 08:49:37 -07:00
nuvoton w90p910_ether: remove incorrect __init annotation 2019-01-13 09:51:00 +01:00
nvidia net: nvidia: forcedeth: Replace GFP_ATOMIC with GFP_KERNEL in nv_probe() 2018-07-27 13:45:14 -07:00
nxp
oki-semi
packetengines
pasemi
qlogic qed: iWARP - Fix tc for MPA ll2 connection 2019-07-26 09:14:07 +02:00
qualcomm net: qualcomm: rmnet: Fix incorrect assignment of real_dev 2018-11-23 08:17:06 +01:00
rdc
realtek r8169: disable default rx interrupt coalescing on RTL8168 2019-04-17 08:38:44 +02:00
renesas net: sh_eth: fix mdio access in sh_eth_close() for R-Car Gen2 and RZ/A1 SoCs 2019-06-22 08:15:20 +02:00
rocker
samsung net: ethernet: sxgbe: mark expected switch fall-throughs 2018-08-07 17:54:20 -07:00
seeq net: seeq: fix crash caused by not set dev.parent 2019-05-16 19:41:30 +02:00
sfc sfc-falcon: remove ndo_poll_controller 2018-09-28 11:12:29 -07:00
sgi net: sgi: fix return type of ndo_start_xmit function 2018-09-21 19:15:14 -07:00
silan
sis sis900: fix TX completion 2019-07-21 09:03:07 +02:00
smsc ARM: 32-bit SoC platform updates 2018-08-23 13:44:43 -07:00
socionext net: ethernet: ave: Replace NET_IP_ALIGN with AVE_FRAME_HEADROOM 2018-12-21 14:15:14 +01:00
stmicro net: stmmac: sun8i: force select external PHY when no internal one 2019-07-26 09:14:11 +02:00
sun niu: fix missing checks of niu_pci_eeprom_read 2019-02-12 19:47:17 +01:00
synopsys net: ethernet: Use existing define with polynomial 2018-07-27 19:16:37 +08:00
tehuti
ti net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set 2019-06-11 12:20:48 +02:00
toshiba
tundra
via
wiznet net: wiznet: fix return type of ndo_start_xmit function 2018-09-21 19:15:15 -07:00
xilinx net: axienet: Fix race condition causing TX hang 2019-07-26 09:14:04 +02:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: jme: Replace mdelay() with msleep() and usleep_range() in jme_wait_link() 2018-07-27 13:45:14 -07:00
jme.h
Kconfig net: change Exar/Neterion menu items to be alphabetical 2018-08-01 09:49:02 -07:00
korina.c
lantiq_etop.c MIPS: lantiq: dma: add dev pointer 2018-09-11 23:33:19 -07:00
Makefile net: change Exar/Neterion menu items to be alphabetical 2018-08-01 09:49:02 -07:00
netx-eth.c