tcp: add some mibs to track collapsing
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Tue, 25 Nov 2008 05:27:22 +0000 (21:27 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Nov 2008 05:27:22 +0000 (21:27 -0800)
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/snmp.h
net/ipv4/proc.c
net/ipv4/tcp_input.c

index 7a6e6bba4a71d5a3a18ac3151e61d4c28b82737f..aee3f1e1d1ce18405626b9adf80e820193259a63 100644 (file)
@@ -216,6 +216,9 @@ enum
        LINUX_MIB_TCPSPURIOUSRTOS,              /* TCPSpuriousRTOs */
        LINUX_MIB_TCPMD5NOTFOUND,               /* TCPMD5NotFound */
        LINUX_MIB_TCPMD5UNEXPECTED,             /* TCPMD5Unexpected */
+       LINUX_MIB_SACKSHIFTED,
+       LINUX_MIB_SACKMERGED,
+       LINUX_MIB_SACKSHIFTFALLBACK,
        __LINUX_MIB_MAX
 };
 
index a631a1f110caab546d4d5e46aff34d7f67c66f03..731789bb499feee9af50211c16cd35a89308215c 100644 (file)
@@ -234,6 +234,9 @@ static const struct snmp_mib snmp4_net_list[] = {
        SNMP_MIB_ITEM("TCPSpuriousRTOs", LINUX_MIB_TCPSPURIOUSRTOS),
        SNMP_MIB_ITEM("TCPMD5NotFound", LINUX_MIB_TCPMD5NOTFOUND),
        SNMP_MIB_ITEM("TCPMD5Unexpected", LINUX_MIB_TCPMD5UNEXPECTED),
+       SNMP_MIB_ITEM("TCPSackShifted", LINUX_MIB_SACKSHIFTED),
+       SNMP_MIB_ITEM("TCPSackMerged", LINUX_MIB_SACKMERGED),
+       SNMP_MIB_ITEM("TCPSackShiftFallback", LINUX_MIB_SACKSHIFTFALLBACK),
        SNMP_MIB_SENTINEL
 };
 
index e6291dde33486021039c1eff3fe9764da81feed8..9f8a80ba17bd3ba9f55d84d5b9491e9e34cf4446 100644 (file)
@@ -1415,6 +1415,7 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
 
        if (skb->len > 0) {
                BUG_ON(!tcp_skb_pcount(skb));
+               NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKSHIFTED);
                return 0;
        }
 
@@ -1436,6 +1437,8 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
        tcp_unlink_write_queue(skb, sk);
        sk_wmem_free_skb(sk, skb);
 
+       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKMERGED);
+
        return 1;
 }
 
@@ -1594,6 +1597,7 @@ noop:
        return skb;
 
 fallback:
+       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SACKSHIFTFALLBACK);
        return NULL;
 }