Extend netstat to display TCP stack and detailed congestion state (2)

Extend netstat to display TCP stack and detailed congestion state

Adding the "-c" option used to show detailed per-connection
congestion control state for TCP sessions.

This is one summary patch, which adds the relevant variables into
xtcpcb. As previous "spare" space is used, these changes are ABI
compatible.

Reviewed by:	tuexen
MFC after:	2 weeks
Sponsored by:	NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D26518
This commit is contained in:
rscheff 2020-10-09 10:55:19 +00:00
parent 37bd427851
commit 9e629129d9
2 changed files with 14 additions and 1 deletions

View File

@ -3437,6 +3437,13 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *xt)
xt->t_sndzerowin = tp->t_sndzerowin;
xt->t_sndrexmitpack = tp->t_sndrexmitpack;
xt->t_rcvoopack = tp->t_rcvoopack;
xt->t_rcv_wnd = tp->rcv_wnd;
xt->t_snd_wnd = tp->snd_wnd;
xt->t_snd_cwnd = tp->snd_cwnd;
xt->t_snd_ssthresh = tp->snd_ssthresh;
xt->t_maxseg = tp->t_maxseg;
xt->xt_ecn = (tp->t_flags2 & TF2_ECN_PERMIT) ? 1 : 0 +
(tp->t_flags2 & TF2_ACE_PERMIT) ? 2 : 0;
now = getsbinuptime();
#define COPYTIMER(ttt) do { \

View File

@ -768,7 +768,13 @@ struct xtcpcb {
int32_t tt_2msl; /* (s) */
int32_t tt_delack; /* (s) */
int32_t t_logstate; /* (3) */
int32_t spare32[32];
uint32_t t_snd_cwnd; /* (s) */
uint32_t t_snd_ssthresh; /* (s) */
uint32_t t_maxseg; /* (s) */
uint32_t t_rcv_wnd; /* (s) */
uint32_t t_snd_wnd; /* (s) */
uint32_t xt_ecn; /* (s) */
int32_t spare32[26];
} __aligned(8);
#ifdef _KERNEL