linux/drivers/net/ethernet
Claudiu Manoil d145c90313 gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP
When PTP timestamping is enabled on Tx, the controller
inserts the Tx timestamp at the beginning of the frame
buffer, between SFD and the L2 frame header.  This means
that the skb provided by the stack is required to have
enough headroom otherwise a new skb needs to be created
by the driver to accommodate the timestamp inserted by h/w.
Up until now the driver was relying on skb_realloc_headroom()
to create new skbs to accommodate PTP frames.  Turns out that
this method is not reliable in this context at least, as
skb_realloc_headroom() for PTP frames can cause random crashes,
mostly in subsequent skb_*() calls, when multiple concurrent
TCP streams are run at the same time with the PTP flow
on the same device (as seen in James' report).  I also noticed
that when the system is loaded by sending multiple TCP streams,
the driver receives cloned skbs in large numbers.
skb_cow_head() instead proves to be stable in this scenario,
and not only handles cloned skbs too but it's also more efficient
and widely used in other drivers.
The commit introducing skb_realloc_headroom in the driver
goes back to 2009, commit 93c1285c5d
("gianfar: reallocate skb when headroom is not enough for fcb").
For practical purposes I'm referencing a newer commit (from 2012)
that brings the code to its current structure (and fixes the PTP
case).

Fixes: 9c4886e5e6 ("gianfar: Fix invalid TX frames returned on error queue when time stamping")
Reported-by: James Jurack <james.jurack@ametek.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Link: https://lore.kernel.org/r/20201029081057.8506-1-claudiu.manoil@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-30 09:35:51 -07:00
..
3com networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
8390 lib8390: Use netif_msg_init to initialize msg_enable bits 2020-10-01 19:08:46 -07:00
adaptec
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon
amd networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
apm
apple
aquantia net: remove unneeded break 2020-10-20 10:28:21 -07:00
arc
atheros net: atheros: Remove WARN_ON(in_interrupt()) 2020-09-29 14:02:53 -07:00
aurora
broadcom bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally. 2020-10-26 18:26:35 -07:00
brocade net: bna: Use fallthrough pseudo-keyword 2020-10-03 17:33:23 -07:00
cadence macb: support the two tx descriptors on at91rm9200 2020-10-13 16:57:12 -07:00
calxeda
cavium net: thunderx: Use struct_size() helper in kmalloc() 2020-10-10 10:34:03 -07:00
chelsio chelsio/chtls: fix memory leaks in CPL handlers 2020-10-27 16:54:30 -07:00
cirrus
cisco net: remove unneeded break 2020-10-20 10:28:21 -07:00
cortina
davicom
dec
dlink
emulex
ezchip
faraday net: ftgmac100: Fix Aspeed ast2600 TX hang issue 2020-10-16 15:36:34 -07:00
freescale gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP 2020-10-30 09:35:51 -07:00
fujitsu
google
hisilicon net: hns3: Clear the CMDQ registers before unmapping BAR region 2020-10-26 20:25:04 -07:00
huawei Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
i825xx
ibm ibmvnic: fix ibmvnic_set_mac 2020-10-29 11:33:03 -07:00
intel net: remove unneeded break 2020-10-20 10:28:21 -07:00
marvell pci-v5.10-changes 2020-10-22 12:41:00 -07:00
mediatek net: ethernet: mtk-star-emac: select REGMAP_MMIO 2020-10-21 18:11:17 -07:00
mellanox Networking fixes for 5.10-rc2. 2020-10-29 12:55:02 -07:00
micrel net: ksz884x: Use fallthrough pseudo-keyword 2020-10-03 17:33:23 -07:00
microchip
moxa
mscc net: mscc: ocelot: remove duplicate ocelot_port_dev_check 2020-10-13 17:04:43 -07:00
myricom
natsemi net: natsemi: Replace in_interrupt() usage. 2020-09-29 14:02:54 -07:00
neterion net: vxge: Remove in_interrupt() conditionals 2020-09-29 14:02:54 -07:00
netronome
ni
nvidia
nxp
oki-semi
packetengines
pasemi
pensando ionic: fix mem leak in rx_empty 2020-10-23 18:37:23 -07:00
qlogic RDMA 5.10 pull request 2020-10-17 11:18:18 -07:00
qualcomm
rdc
realtek r8169: fix issue with forced threading in combination with shared interrupts 2020-10-29 11:49:04 -07:00
renesas ravb: Fix bit fields checking in ravb_hwtstamp_get() 2020-10-27 17:14:33 -07:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
samsung
seeq
sfc sfc: move initialisation of efx->filter_sem to efx_init_struct() 2020-10-20 21:22:23 -07:00
sgi
silan
sis
smsc
socionext netsec: ignore 'phy-mode' device property on ACPI systems 2020-10-20 15:59:43 -07:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
sun networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
synopsys
tehuti
ti Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-15 12:43:21 -07:00
toshiba
tundra
via Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
wiznet
xilinx
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c
jme.h
Kconfig
korina.c net: korina: cast KSEG0 address to pointer in kfree 2020-10-19 17:00:00 -07:00
lantiq_etop.c
lantiq_xrx200.c
Makefile