1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-25 07:49:18 +00:00

Log the number of segments currently in the reassembly queue.

Sponsored by:	FreeBSD Foundation
This commit is contained in:
Lawrence Stewart 2010-09-25 09:16:46 +00:00
parent 9f1dc4c107
commit d4d3e21865
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213162
2 changed files with 17 additions and 8 deletions

View File

@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd June 23, 2010
.Dd September 25, 2010
.Dt SIFTR 4
.Os
.Sh NAME
@ -198,7 +198,7 @@ The data is CSV formatted.
.Bd -literal -offset indent
o,0xbec491a5,1238556193.463551,172.16.7.28,22,172.16.2.5,55931, \\
1073725440,172312,6144,66560,66608,8,1,4,1448,936,1,996,255, \\
33304,208,66608,0,208
33304,208,66608,0,208,0
.Ed
.Pp
Field descriptions are as follows:
@ -328,6 +328,10 @@ The current number of bytes in the socket receive buffer.
The current number of unacknowledged bytes in-flight.
Bytes acknowledged via SACK are not excluded from this count.
.El
.Bl -tag -offset indent
.It Va 26
The current number of segments in the reassembly queue.
.El
.Pp
The third type of log message is written to the file when the module is disabled
and ceases collecting data from the running kernel.

View File

@ -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)