aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/snmp.h5
-rw-r--r--net/ipv4/proc.c3
-rw-r--r--net/ipv4/tcp_input.c7
3 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 2e68f5ba0389..6e4c51123828 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -233,7 +233,10 @@ enum
233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */ 233 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */ 234 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */ 235 LINUX_MIB_TCPRETRANSFAIL, /* TCPRetransFail */
236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */ 236 LINUX_MIB_TCPRCVCOALESCE, /* TCPRcvCoalesce */
237 LINUX_MIB_TCPOFOQUEUE, /* TCPOFOQueue */
238 LINUX_MIB_TCPOFODROP, /* TCPOFODrop */
239 LINUX_MIB_TCPOFOMERGE, /* TCPOFOMerge */
237 __LINUX_MIB_MAX 240 __LINUX_MIB_MAX
238}; 241};
239 242
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index 8af0d44e4e22..dae25e7622cf 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -258,6 +258,9 @@ static const struct snmp_mib snmp4_net_list[] = {
258 SNMP_MIB_ITEM("TCPReqQFullDrop", LINUX_MIB_TCPREQQFULLDROP), 258 SNMP_MIB_ITEM("TCPReqQFullDrop", LINUX_MIB_TCPREQQFULLDROP),
259 SNMP_MIB_ITEM("TCPRetransFail", LINUX_MIB_TCPRETRANSFAIL), 259 SNMP_MIB_ITEM("TCPRetransFail", LINUX_MIB_TCPRETRANSFAIL),
260 SNMP_MIB_ITEM("TCPRcvCoalesce", LINUX_MIB_TCPRCVCOALESCE), 260 SNMP_MIB_ITEM("TCPRcvCoalesce", LINUX_MIB_TCPRCVCOALESCE),
261 SNMP_MIB_ITEM("TCPOFOQueue", LINUX_MIB_TCPOFOQUEUE),
262 SNMP_MIB_ITEM("TCPOFODrop", LINUX_MIB_TCPOFODROP),
263 SNMP_MIB_ITEM("TCPOFOMerge", LINUX_MIB_TCPOFOMERGE),
261 SNMP_MIB_SENTINEL 264 SNMP_MIB_SENTINEL
262}; 265};
263 266
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 055ac49b8b40..cc4e12f1f2f7 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4397,8 +4397,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4397 4397
4398 TCP_ECN_check_ce(tp, skb); 4398 TCP_ECN_check_ce(tp, skb);
4399 4399
4400 if (tcp_try_rmem_schedule(sk, skb->truesize)) { 4400 if (unlikely(tcp_try_rmem_schedule(sk, skb->truesize))) {
4401 /* TODO: should increment a counter */ 4401 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFODROP);
4402 __kfree_skb(skb); 4402 __kfree_skb(skb);
4403 return; 4403 return;
4404 } 4404 }
@@ -4407,6 +4407,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4407 tp->pred_flags = 0; 4407 tp->pred_flags = 0;
4408 inet_csk_schedule_ack(sk); 4408 inet_csk_schedule_ack(sk);
4409 4409
4410 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOQUEUE);
4410 SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n", 4411 SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n",
4411 tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); 4412 tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
4412 4413
@@ -4460,6 +4461,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4460 if (skb1 && before(seq, TCP_SKB_CB(skb1)->end_seq)) { 4461 if (skb1 && before(seq, TCP_SKB_CB(skb1)->end_seq)) {
4461 if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) { 4462 if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
4462 /* All the bits are present. Drop. */ 4463 /* All the bits are present. Drop. */
4464 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOMERGE);
4463 __kfree_skb(skb); 4465 __kfree_skb(skb);
4464 skb = NULL; 4466 skb = NULL;
4465 tcp_dsack_set(sk, seq, end_seq); 4467 tcp_dsack_set(sk, seq, end_seq);
@@ -4498,6 +4500,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
4498 __skb_unlink(skb1, &tp->out_of_order_queue); 4500 __skb_unlink(skb1, &tp->out_of_order_queue);
4499 tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, 4501 tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
4500 TCP_SKB_CB(skb1)->end_seq); 4502 TCP_SKB_CB(skb1)->end_seq);
4503 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPOFOMERGE);
4501 __kfree_skb(skb1); 4504 __kfree_skb(skb1);
4502 } 4505 }
4503 4506