From: Richard Cochran <richardcochran@gmail.com> Date: 2011-06-19 13:31:43
As Eric Dumazet helpfully pointed out, the placing the transmit time
stamp hook after giving the skb to hardware races with the completion
ISR, for those drivers which free the buffer in the ISR.
This series fixes up the first batch of time stamping hook patches.
Richard Cochran (7):
net: correct comment on where to place transmit time stamp hook.
fec: fix race in transmit time stamping.
tg3: fix race in transmit time stamping.
r6040: fix race in transmit time stamping.
stmmac: fix race in transmit time stamping.
smsc9420: fix race in transmit time stamping.
davinci_emac: fix race in transmit time stamping.
drivers/net/davinci_emac.c | 3 ++-
drivers/net/fec.c | 4 ++--
drivers/net/r6040.c | 5 +++--
drivers/net/smsc9420.c | 4 ++--
drivers/net/stmmac/stmmac_main.c | 4 ++--
drivers/net/tg3.c | 4 ++--
include/linux/skbuff.h | 3 +--
7 files changed, 14 insertions(+), 13 deletions(-)
From: Richard Cochran <richardcochran@gmail.com> Date: 2011-06-19 13:31:49
The comment for the skb_tx_timestamp() function suggests calling it just
after a buffer is released to the hardware for transmission. However,
for drivers that free the buffer in an ISR, this produces a race between
the time stamp code and the ISR. This commit changes the comment to advise
placing the call just before handing the buffer over to the hardware.
Signed-off-by: Richard Cochran <redacted>
---
include/linux/skbuff.h | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
@@ -836,6 +836,9 @@ static netdev_tx_t r6040_start_xmit(struct sk_buff *skb,descptr->buf=cpu_to_le32(pci_map_single(lp->pdev,skb->data,skb->len,PCI_DMA_TODEVICE));descptr->status=DSC_OWNER_MAC;++skb_tx_timestamp(skb);+/* Trigger the MAC to check the TX descriptor */iowrite16(0x01,ioaddr+MTPR);lp->tx_insert_ptr=descptr->vndescp;
From: David Miller <davem@davemloft.net> Date: 2011-06-19 23:36:12
From: Richard Cochran <richardcochran@gmail.com>
Date: Sun, 19 Jun 2011 15:31:38 +0200
As Eric Dumazet helpfully pointed out, the placing the transmit time
stamp hook after giving the skb to hardware races with the completion
ISR, for those drivers which free the buffer in the ISR.
This series fixes up the first batch of time stamping hook patches.