linux_dsm_epyc7002/drivers/net/ethernet
Jacob Keller aaebaf50b5 ixgbe: fix race condition with PTP_TX_IN_PROGRESS bits
Hardware related to the ixgbe driver is limited to handling a single Tx
timestamp request at a time. Thus, the driver ignores requests for Tx
timestamp while waiting for the current request to finish. It uses
a state bit lock which enforces that only one timestamp request is
honored at a time.

Unfortunately this suffers from a simple race condition. The bit lock is
not cleared until after skb_tstamp_tx() is called notifying applications
of a new Tx timestamp. Even a well behaved application sending only one
packet at a time and waiting for a response can wake up and send a new
packet before the bit lock is cleared. This results in needlessly
dropping some Tx timestamp requests.

We can fix this by unlocking the state bit as soon as we read the
Timestamp register, as this is the first point at which it is safe to
unlock.

To avoid issues with the skb pointer, we'll use a copy of the pointer
and set the global variable in the driver structure to NULL first. This
ensures that the next timestamp request does not modify our local copy
of the skb pointer.

This ensures that well behaved applications do not accidentally race
with the unlock bit. Obviously an application which sends multiple Tx
timestamp requests at once will still only timestamp one packet at
a time. Unfortunately there is nothing we can do about this.

Reported-by: David Mirabito <davidm@metamako.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2017-06-13 16:11:47 -07:00
..
3com net/3com: Make el3_netdev_get_ecmd return void 2017-06-05 11:00:43 -04:00
8390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-26 20:46:35 -04:00
adaptec
adi
aeroflex
agere
alacritech
allwinner
alteon
altera
amazon
amd net: propagate tc filter chain index down the ndo_setup_tc call 2017-06-08 09:55:53 -04:00
apm net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
apple networking: use skb_put_zero() 2017-06-13 13:54:03 -04:00
aquantia sk_buff: remove support for csum_bad in sk_buff 2017-05-19 19:21:29 -04:00
arc
atheros net: atheros: atl2: don't return zero on failure path in atl2_probe() 2017-05-22 12:05:01 -04:00
aurora
broadcom networking: use skb_put_zero() 2017-06-13 13:54:03 -04:00
brocade bna: ethtool: Avoid reading past end of buffer 2017-05-08 14:41:42 -04:00
cadence net: macb: fix phy interrupt parsing 2017-04-30 22:21:49 -04:00
calxeda
cavium liquidio: disallow enabling firmware debug from a VF 2017-06-09 12:50:55 -04:00
chelsio cxgb4: handle serial flash interrupt 2017-06-13 15:57:32 -04:00
cirrus net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
cisco enic: unmask intr only when napi is complete 2017-05-23 11:05:45 -04:00
davicom
dec net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
dlink
emulex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2017-05-26 20:46:35 -04:00
ezchip
faraday net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
freescale net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
fujitsu
hisilicon net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
hp
i825xx
ibm ibmvnic: Remove netdev notify for failover resets 2017-06-13 12:53:36 -04:00
intel ixgbe: fix race condition with PTP_TX_IN_PROGRESS bits 2017-06-13 16:11:47 -07:00
marvell net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
mediatek net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
mellanox mlx5-updates-2017-06-11 2017-06-11 18:10:42 -04:00
micrel net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
microchip
moxa
myricom
natsemi format-security: move static strings to const 2017-05-08 17:15:14 -07:00
neterion net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
netronome nfp: report application FW build name in ethtool -i 2017-06-09 12:52:09 -04:00
nuvoton net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
nvidia forcedeth: remove unnecessary carrier status check 2017-05-04 10:57:41 -04:00
nxp
oki-semi net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
packetengines
pasemi
qlogic qed: add qed_int_sb_init() stub function 2017-06-09 15:51:45 -04:00
qualcomm networking: use skb_put_zero() 2017-06-13 13:54:03 -04:00
rdc
realtek net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
renesas net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
rocker rocker: Remove support bridge bypass FDB 2017-06-08 14:16:30 -04:00
samsung net: ethernet: update drivers to make both SW and HW TX timestamps 2017-05-21 13:37:32 -04:00
seeq
sfc net: propagate tc filter chain index down the ndo_setup_tc call 2017-06-08 09:55:53 -04:00
sgi net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
silan
sis net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
smsc net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
stmicro net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
sun ldmvsw: stop the clean timer at beginning of remove 2017-05-15 15:36:08 -04:00
synopsys
tehuti
ti net: phy: Make phy_ethtool_ksettings_get return void 2017-06-13 12:59:06 -04:00
tile net: ethernet: update drivers to handle HWTSTAMP_FILTER_NTP_ALL 2017-05-21 13:37:32 -04:00
toshiba format-security: move static strings to const 2017-05-08 17:15:14 -07:00
tundra net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
via net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
wiznet
xilinx
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethoc: enable NAPI before poll may be scheduled 2017-06-06 16:22:51 -04:00
fealnx.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
jme.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
jme.h
Kconfig
korina.c net/{mii, smsc}: Make mii_ethtool_get_link_ksettings and smc_netdev_get_ecmd return void 2017-06-05 11:00:42 -04:00
lantiq_etop.c
Makefile
netx-eth.c