Author: rscheff
Date: Fri Oct  9 10:55:19 2020
New Revision: 366567
URL: https://svnweb.freebsd.org/changeset/base/366567

Log:
  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

Modified:
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c Fri Oct  9 10:07:41 2020        (r366566)
+++ head/sys/netinet/tcp_subr.c Fri Oct  9 10:55:19 2020        (r366567)
@@ -3437,6 +3437,13 @@ tcp_inptoxtp(const struct inpcb *inp, struct xtcpcb *x
                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 {                                            
\

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h  Fri Oct  9 10:07:41 2020        (r366566)
+++ head/sys/netinet/tcp_var.h  Fri Oct  9 10:55:19 2020        (r366567)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to