net: track success and failure of TCP PMTU probing
authorRick Jones <rick.jones2@hp.com>
Tue, 21 Jul 2015 23:14:13 +0000 (16:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jul 2015 05:36:33 +0000 (22:36 -0700)
Track success and failure of TCP PMTU probing.

Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/uapi/linux/snmp.h
net/ipv4/proc.c
net/ipv4/tcp_input.c

index eee8968407f063b5d9c4776a30ebe45e5b782f2d..25a9ad8bcef1240915f2553a8acade447186d869 100644 (file)
@@ -278,6 +278,8 @@ enum
        LINUX_MIB_TCPACKSKIPPEDCHALLENGE,       /* TCPACKSkippedChallenge */
        LINUX_MIB_TCPWINPROBE,                  /* TCPWinProbe */
        LINUX_MIB_TCPKEEPALIVE,                 /* TCPKeepAlive */
+       LINUX_MIB_TCPMTUPFAIL,                  /* TCPMTUPFail */
+       LINUX_MIB_TCPMTUPSUCCESS,               /* TCPMTUPSuccess */
        __LINUX_MIB_MAX
 };
 
index da5d483e236ac1e37b631c6091219fbefbe497b4..3abd9d7a3adf323bd688b1ab6dabda1248c67be1 100644 (file)
@@ -300,6 +300,8 @@ static const struct snmp_mib snmp4_net_list[] = {
        SNMP_MIB_ITEM("TCPACKSkippedChallenge", LINUX_MIB_TCPACKSKIPPEDCHALLENGE),
        SNMP_MIB_ITEM("TCPWinProbe", LINUX_MIB_TCPWINPROBE),
        SNMP_MIB_ITEM("TCPKeepAlive", LINUX_MIB_TCPKEEPALIVE),
+       SNMP_MIB_ITEM("TCPMTUPFail", LINUX_MIB_TCPMTUPFAIL),
+       SNMP_MIB_ITEM("TCPMTUPSuccess", LINUX_MIB_TCPMTUPSUCCESS),
        SNMP_MIB_SENTINEL
 };
 
index 1578fc2a6f39b276ef7e2538d4ff4bc6d8054c22..cda3ffedadb632b5f0963d84b8fe4fdc2f5c20cb 100644 (file)
@@ -2593,6 +2593,7 @@ static void tcp_mtup_probe_failed(struct sock *sk)
 
        icsk->icsk_mtup.search_high = icsk->icsk_mtup.probe_size - 1;
        icsk->icsk_mtup.probe_size = 0;
+       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMTUPFAIL);
 }
 
 static void tcp_mtup_probe_success(struct sock *sk)
@@ -2612,6 +2613,7 @@ static void tcp_mtup_probe_success(struct sock *sk)
        icsk->icsk_mtup.search_low = icsk->icsk_mtup.probe_size;
        icsk->icsk_mtup.probe_size = 0;
        tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
+       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPMTUPSUCCESS);
 }
 
 /* Do a simple retransmit without using the backoff mechanisms in