Skip to content

Commit aeeecb8

Browse files
menglongdongdavem330
authored andcommitted
net: snmp: add statistics for tcp small queue check
Once tcp small queue check failed in tcp_small_queue_check(), the throughput of tcp will be limited, and it's hard to distinguish whether it is out of tcp congestion control. Add statistics of LINUX_MIB_TCPSMALLQUEUEFAILURE for this scene. Signed-off-by: Menglong Dong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e9538f8 commit aeeecb8

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

include/uapi/linux/snmp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ enum
292292
LINUX_MIB_TCPDSACKIGNOREDDUBIOUS, /* TCPDSACKIgnoredDubious */
293293
LINUX_MIB_TCPMIGRATEREQSUCCESS, /* TCPMigrateReqSuccess */
294294
LINUX_MIB_TCPMIGRATEREQFAILURE, /* TCPMigrateReqFailure */
295+
LINUX_MIB_TCPSMALLQUEUEFAILURE, /* TCPSmallQueueFailure */
295296
__LINUX_MIB_MAX
296297
};
297298

net/ipv4/proc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static const struct snmp_mib snmp4_net_list[] = {
297297
SNMP_MIB_ITEM("TCPDSACKIgnoredDubious", LINUX_MIB_TCPDSACKIGNOREDDUBIOUS),
298298
SNMP_MIB_ITEM("TCPMigrateReqSuccess", LINUX_MIB_TCPMIGRATEREQSUCCESS),
299299
SNMP_MIB_ITEM("TCPMigrateReqFailure", LINUX_MIB_TCPMIGRATEREQFAILURE),
300+
SNMP_MIB_ITEM("TCPSmallQueueFailure", LINUX_MIB_TCPSMALLQUEUEFAILURE),
300301
SNMP_MIB_SENTINEL
301302
};
302303

net/ipv4/tcp_output.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2524,8 +2524,11 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
25242524
* test again the condition.
25252525
*/
25262526
smp_mb__after_atomic();
2527-
if (refcount_read(&sk->sk_wmem_alloc) > limit)
2527+
if (refcount_read(&sk->sk_wmem_alloc) > limit) {
2528+
NET_INC_STATS(sock_net(sk),
2529+
LINUX_MIB_TCPSMALLQUEUEFAILURE);
25282530
return true;
2531+
}
25292532
}
25302533
return false;
25312534
}

0 commit comments

Comments
 (0)