summaryrefslogtreecommitdiffstats
path: root/sys/netinet/siftr.c
diff options
context:
space:
mode:
authorlstewart <lstewart@FreeBSD.org>2010-09-25 09:16:46 +0000
committerlstewart <lstewart@FreeBSD.org>2010-09-25 09:16:46 +0000
commit09dabf65c879db81573d927dca0d5ad948619bca (patch)
treea2e885f51d0a33c55c667a8b5058f1a77aea3397 /sys/netinet/siftr.c
parent6405ab4b6cef652a2152238d7c510e97100fa14a (diff)
downloadFreeBSD-src-09dabf65c879db81573d927dca0d5ad948619bca.zip
FreeBSD-src-09dabf65c879db81573d927dca0d5ad948619bca.tar.gz
Log the number of segments currently in the reassembly queue.
Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/netinet/siftr.c')
-rw-r--r--sys/netinet/siftr.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c
index 6097ad4..176d0d0 100644
--- a/sys/netinet/siftr.c
+++ b/sys/netinet/siftr.c
@@ -55,7 +55,7 @@
* SIFTR should be directed to him via email: lastewart@swin.edu.au
*
* Initial release date: June 2007
- * Most recent update: June 2010
+ * Most recent update: September 2010
******************************************************/
#include <sys/cdefs.h>
@@ -105,7 +105,7 @@ __FBSDID("$FreeBSD$");
*/
#define V_MAJOR 1
#define V_BACKBREAK 2
-#define V_BACKCOMPAT 3
+#define V_BACKCOMPAT 4
#define MODVERSION __CONCAT(V_MAJOR, __CONCAT(V_BACKBREAK, V_BACKCOMPAT))
#define MODVERSION_STR __XSTRING(V_MAJOR) "." __XSTRING(V_BACKBREAK) "." \
__XSTRING(V_BACKCOMPAT)
@@ -226,6 +226,8 @@ struct pkt_node {
u_int rcv_buf_cc;
/* Number of bytes inflight that we are waiting on ACKs for. */
u_int sent_inflight_bytes;
+ /* Number of segments currently in the reassembly queue. */
+ int t_segqlen;
/* Link to next pkt_node in the list. */
STAILQ_ENTRY(pkt_node) nodes;
};
@@ -442,7 +444,7 @@ siftr_process_pkt(struct pkt_node * pkt_node)
MAX_LOG_MSG_LEN,
"%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:"
"%x:%x:%x:%x:%x,%u,%ld,%ld,%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,"
- "%u,%d,%u,%u,%u,%u,%u\n",
+ "%u,%d,%u,%u,%u,%u,%u,%u\n",
direction[pkt_node->direction],
pkt_node->hash,
pkt_node->tval.tv_sec,
@@ -482,7 +484,8 @@ siftr_process_pkt(struct pkt_node * pkt_node)
pkt_node->snd_buf_cc,
pkt_node->rcv_buf_hiwater,
pkt_node->rcv_buf_cc,
- pkt_node->sent_inflight_bytes);
+ pkt_node->sent_inflight_bytes,
+ pkt_node->t_segqlen);
} else { /* IPv4 packet */
pkt_node->ip_laddr[0] = FIRST_OCTET(pkt_node->ip_laddr[3]);
pkt_node->ip_laddr[1] = SECOND_OCTET(pkt_node->ip_laddr[3]);
@@ -498,7 +501,7 @@ siftr_process_pkt(struct pkt_node * pkt_node)
log_buf->ae_bytesused = snprintf(log_buf->ae_data,
MAX_LOG_MSG_LEN,
"%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%ld,%ld,"
- "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u\n",
+ "%ld,%ld,%ld,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u\n",
direction[pkt_node->direction],
pkt_node->hash,
(intmax_t)pkt_node->tval.tv_sec,
@@ -530,7 +533,8 @@ siftr_process_pkt(struct pkt_node * pkt_node)
pkt_node->snd_buf_cc,
pkt_node->rcv_buf_hiwater,
pkt_node->rcv_buf_cc,
- pkt_node->sent_inflight_bytes);
+ pkt_node->sent_inflight_bytes,
+ pkt_node->t_segqlen);
#ifdef SIFTR_IPV6
}
#endif
@@ -790,6 +794,7 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb *inp, struct tcpcb *tp,
pn->rcv_buf_hiwater = inp->inp_socket->so_rcv.sb_hiwat;
pn->rcv_buf_cc = inp->inp_socket->so_rcv.sb_cc;
pn->sent_inflight_bytes = tp->snd_max - tp->snd_una;
+ pn->t_segqlen = tp->t_segqlen;
/* We've finished accessing the tcb so release the lock. */
if (inp_locally_locked)
OpenPOWER on IntegriCloud