History

tcp: introduce TCPSpuriousRtxHostQueues SNMP counter

Host queues (Qdisc + NIC) can hold packets so long that TCP can eventually retransmit a packet before the first transmit even left the host. Its not clear right now if we could avoid this in the first place : - We could arm RTO timer not at the time we enqueue packets, but at the time we TX complete them (tcp_wfree()) - Cancel the sending of the new copy of the packet if prior one is still in queue. This patch adds instrumentation so that we can at least see how often this problem happens. TCPSpuriousRtxHostQueues SNMP counter is incremented every time we detect the fast clone is not yet freed in tcp_transmit_skb()

Eric Dumazet committed 13 years ago

Commit 0e280af1 parent 5a5967d3 files · +9 −0Browse files

Unified · Split

3 files
  1. include/uapi/linux/snmp.h +1 −0
  2. net/ipv4/proc.c +1 −0
  3. net/ipv4/tcp_output.c +7 −0
include/uapi/linux/snmp.h+1−0
@@ -247,6 +247,7 @@ enum · 246 unmodified lines
247247 LINUX_MIB_TCPFASTOPENPASSIVEFAIL, /* TCPFastOpenPassiveFail */
248248 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
249249 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
250+ LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
250251 __LINUX_MIB_MAX
251252 };
252253
net/ipv4/proc.c+1−0
@@ -269,6 +269,7 @@ static const struct snmp_mib snmp4_net_list[] = { · 268 unmodified lines
269269 SNMP_MIB_ITEM("TCPFastOpenPassiveFail", LINUX_MIB_TCPFASTOPENPASSIVEFAIL),
270270 SNMP_MIB_ITEM("TCPFastOpenListenOverflow", LINUX_MIB_TCPFASTOPENLISTENOVERFLOW),
271271 SNMP_MIB_ITEM("TCPFastOpenCookieReqd", LINUX_MIB_TCPFASTOPENCOOKIEREQD),
272+ SNMP_MIB_ITEM("TCPSpuriousRtxHostQueues", LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES),
272273 SNMP_MIB_SENTINEL
273274 };
274275
net/ipv4/tcp_output.c+7−0
@@ -846,6 +846,13 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, · 845 unmodified lines
846846 __net_timestamp(skb);
847847
848848 if (likely(clone_it)) {
849+ const struct sk_buff *fclone = skb + 1;
850+
851+ if (unlikely(skb->fclone == SKB_FCLONE_ORIG &&
852+ fclone->fclone == SKB_FCLONE_CLONE))
853+ NET_INC_STATS_BH(sock_net(sk),
854+ LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
855+
849856 if (unlikely(skb_cloned(skb)))
850857 skb = pskb_copy(skb, gfp_mask);
851858 else

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t