From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Vedang Patel <vedang.patel@intel.com>,
Aaron Brown <aaron.f.brown@intel.com>,
"David S . Miller" <davem@davemloft.net>,
Sasha Levin <sashal@kernel.org>,
netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.19 133/158] igb: clear out skb->tstamp after reading the txtime
Date: Mon, 15 Jul 2019 10:17:44 -0400 [thread overview]
Message-ID: <20190715141809.8445-133-sashal@kernel.org> (raw)
In-Reply-To: <20190715141809.8445-1-sashal@kernel.org>
From: Vedang Patel <vedang.patel@intel.com>
[ Upstream commit 1e08511d5d01884a3c9070afd52a47799312074a ]
If a packet which is utilizing the launchtime feature (via SO_TXTIME socket
option) also requests the hardware transmit timestamp, the hardware
timestamp is not delivered to the userspace. This is because the value in
skb->tstamp is mistaken as the software timestamp.
Applications, like ptp4l, request a hardware timestamp by setting the
SOF_TIMESTAMPING_TX_HARDWARE socket option. Whenever a new timestamp is
detected by the driver (this work is done in igb_ptp_tx_work() which calls
igb_ptp_tx_hwtstamps() in igb_ptp.c[1]), it will queue the timestamp in the
ERR_QUEUE for the userspace to read. When the userspace is ready, it will
issue a recvmsg() call to collect this timestamp. The problem is in this
recvmsg() call. If the skb->tstamp is not cleared out, it will be
interpreted as a software timestamp and the hardware tx timestamp will not
be successfully sent to the userspace. Look at skb_is_swtx_tstamp() and the
callee function __sock_recv_timestamp() in net/socket.c for more details.
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/igb/igb_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 5aa083d9a6c9..ab76a5f77cd0 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5703,6 +5703,7 @@ static void igb_tx_ctxtdesc(struct igb_ring *tx_ring,
*/
if (tx_ring->launchtime_enable) {
ts = ns_to_timespec64(first->skb->tstamp);
+ first->skb->tstamp = 0;
context_desc->seqnum_seed = cpu_to_le32(ts.tv_nsec / 32);
} else {
context_desc->seqnum_seed = 0;
--
2.20.1
next prev parent reply other threads:[~2019-07-15 14:55 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 14:15 [PATCH AUTOSEL 4.19 001/158] wil6210: fix potential out-of-bounds read Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 002/158] ath10k: Do not send probe response template for mesh Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 003/158] ath9k: Check for errors when reading SREV register Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 004/158] ath6kl: add some bounds checking Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 005/158] ath10k: add peer id check in ath10k_peer_find_by_id Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 007/158] wil6210: fix spurious interrupts in 3-msi Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 008/158] ath: DFS JP domain W56 fixed pulse type 3 RADAR detection Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 010/158] batman-adv: fix for leaked TVLV handler Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 018/158] net: stmmac: dwmac1000: Clear unused address entries Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 019/158] net: stmmac: dwmac4/5: " Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 020/158] qed: Set the doorbell address correctly Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 023/158] af_key: fix leaks in key_pol_get_resp and dump_sp Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 024/158] xfrm: Fix xfrm sel prefix length validation Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 027/158] Revert "e1000e: fix cyclic resets at link up with active tx" Sasha Levin
2019-07-15 14:15 ` [PATCH AUTOSEL 4.19 028/158] e1000e: start network tx queue only when link is up Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 032/158] net: phy: Check against net_device being NULL Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 036/158] batman-adv: Fix duplicated OGMs on NETDEV_UP Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 039/158] net: hns3: set ops to null when unregister ad_dev Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 043/158] net: stmmac: dwmac4: fix flow control issue Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 044/158] net: stmmac: modify default value of tx-frames Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 046/158] net: fec: Do not use netdev messages too early Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 047/158] net: axienet: Fix race condition causing TX hang Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 050/158] net: sfp: add mutex to prevent concurrent state checks Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 051/158] ipset: Fix memory accounting for hash types on resize Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 062/158] bpf: silence warning messages in core Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 069/158] qed: iWARP - Fix tc for MPA ll2 connection Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 070/158] net: hns3: fix for skb leak when doing selftest Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 073/158] xfrm: fix sa selector validation Sasha Levin
2019-07-15 14:16 ` [PATCH AUTOSEL 4.19 079/158] vhost_net: disable zerocopy by default Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 090/158] ipsec: select crypto ciphers for xfrm_algo Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 091/158] ipvs: defer hook registration to avoid leaks Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 102/158] net: stmmac: sun8i: force select external PHY when no internal one Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 103/158] rtlwifi: rtl8192cu: fix error handle when usb probe failed Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 104/158] mt7601u: do not schedule rx_tasklet when the device has been disconnected Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 106/158] mt7601u: fix possible memory leak when the device is disconnected Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 107/158] ipvs: fix tinfo memory leak in start_sync_thread Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 108/158] ath10k: add missing error handling Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 109/158] ath10k: fix PCIE device wake up failed Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 114/158] xsk: Properly terminate assignment in xskq_produce_flush_desc Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 117/158] ixgbe: Check DDM existence in transceiver before access Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 121/158] wil6210: drop old event after wmi_call timeout Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 129/158] net: hns3: fix a -Wformat-nonliteral compile warning Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 130/158] net: hns3: add some error checking in hclge_tm module Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 131/158] ath10k: destroy sdio workqueue while remove sdio module Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 132/158] net: mvpp2: prs: Don't override the sign bit in SRAM parser shift Sasha Levin
2019-07-15 14:17 ` Sasha Levin [this message]
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 134/158] iwlwifi: mvm: Drop large non sta frames Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 135/158] bpf: fix uapi bpf_prog_info fields alignment Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 138/158] bnx2x: Prevent ptp_task to be rescheduled indefinitely Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 139/158] net: usb: asix: init MAC address buffers Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 141/158] bpf, libbpf, smatch: Fix potential NULL pointer dereference Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 142/158] selftests: bpf: fix inlines in test_lwt_seg6local Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 143/158] bonding: validate ip header before check IPPROTO_IGMP Sasha Levin
2019-07-15 14:17 ` [PATCH AUTOSEL 4.19 145/158] tools: bpftool: Fix json dump crash on powerpc Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 149/158] Bluetooth: 6lowpan: search for destination address in all peers Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 151/158] Bluetooth: Check state in l2cap_disconnect_rsp Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 152/158] gtp: add missing gtp_encap_disable_sock() in gtp_encap_enable() Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 153/158] Bluetooth: validate BLE connection interval updates Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 154/158] gtp: fix suspicious RCU usage Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 155/158] gtp: fix Illegal context switch in RCU read-side critical section Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 156/158] gtp: fix use-after-free in gtp_encap_destroy() Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 157/158] gtp: fix use-after-free in gtp_newlink() Sasha Levin
2019-07-15 14:18 ` [PATCH AUTOSEL 4.19 158/158] net: mvmdio: defer probe of orion-mdio if a clock is not ready Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190715141809.8445-133-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=aaron.f.brown@intel.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=vedang.patel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).