Date: Tue, 25 Apr 2023 18:02:43 -0400 From: Cheng Cui <cc@freebsd.org> To: Mitchell Horne <mhorne@freebsd.org> Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: d090464ecd4a - main - Change the unit of srtt and rto to usec, inspired by these in struct "tcp_info". Therefore, no need hz and tcp_rtt_scale in the headline of the log. Update the man page as well. Message-ID: <CAGaXuiJ5kc49wb9fwXD1cRmhn9J85UNKyACCjar9_yAgry6u2g@mail.gmail.com> In-Reply-To: <1ead933c-2567-7b79-8761-2f900ccf9b76@freebsd.org> References: <202304252126.33PLQsKe024634@gitrepo.freebsd.org> <1ead933c-2567-7b79-8761-2f900ccf9b76@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000118c9e05fa304989 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Apologize. I am thinking there must be some mess up between 'arc' and 'git commit --amend', as my original git commit message was well organized into 72 chars-per-line. The test plan added by the 'arc' during "arc diff --create" (I thought this command is used to create the Phabricator review page) is automatically mixed into the updated git message. My mentor already notified me about this mess. Now I know how to reproduce this problem, and I will take care of it in the future. :) Best Regards, Cheng Cui On Tue, Apr 25, 2023 at 5:52=E2=80=AFPM Mitchell Horne <mhorne@freebsd.org>= wrote: > > > On 4/25/23 18:26, Cheng Cui wrote: > > The branch main has been updated by cc: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3Dd090464ecd4af5cd400ef5cbbfe8409= d019eac34 > > > > commit d090464ecd4af5cd400ef5cbbfe8409d019eac34 > > Author: Cheng Cui <cc@FreeBSD.org> > > AuthorDate: 2023-04-25 11:52:28 +0000 > > Commit: Cheng Cui <cc@FreeBSD.org> > > CommitDate: 2023-04-25 17:26:39 +0000 > > > > Change the unit of srtt and rto to usec, inspired by these in > struct "tcp_info". Therefore, no need hz and tcp_rtt_scale in the headlin= e > of the log. Update the man page as well. > > > > Summary: Simplify srtt and rto values in siftr log. > > > > Test Plan: > > Tested in Emulab testbed: > > cc@s1:~ % sudo sysctl net.inet.siftr > > net.inet.siftr.port_filter: 0 > > net.inet.siftr.genhashes: 0 > > net.inet.siftr.ppl: 1 > > net.inet.siftr.logfile: /var/log/siftr.log > > net.inet.siftr.enabled: 0 > > cc@s1:~ % sudo sysctl net.inet.siftr.port_filter=3D5001 > > net.inet.siftr.port_filter: 0 -> 5001 > > cc@s1:~ % sudo sysctl net.inet.siftr.enabled=3D1 > > net.inet.siftr.enabled: 0 -> 1 > > cc@s1:~ % > > cc@s1:~ % iperf -c r1 -n 1M > > ------------------------------------------------------------ > > Client connecting to r1, TCP port 5001 > > TCP window size: 32.0 KByte (default) > > ------------------------------------------------------------ > > [ 1] local 10.1.1.2 port 33817 connected with 10.1.1.3 port 5001 > > [ ID] Interval Transfer Bandwidth > > [ 1] 0.00-0.91 sec 1.00 MBytes 9.22 Mbits/sec > > cc@s1:~ % sudo sysctl net.inet.siftr.enabled=3D0 > > net.inet.siftr.enabled: 1 -> 0 > > > > cc@s1:~ % ll /var/log/siftr.log > > -rw-r--r-- 1 root wheel 91K Apr 25 09:38 /var/log/siftr.log > > cc@s1:~ % cat /var/log/siftr.log > > enable_time_secs=3D1682437111 enable_time_usecs=3D121115 > siftrver=3D1.3.0 sysname=3DFreeBSD sysver=3D1400088 ipmode=3D4 > > > o,0x00000000,1682437125.907343,10.1.1.2,33817,10.1.1.3,5001,1073725440,10= 73725440,2,0,0,0,0,2,536,0,1,672,1000000,32768,0,65536,0,0,0,0,0 > > > i,0x00000000,1682437126.106759,10.1.1.2,33817,10.1.1.3,5001,1073725440,10= 73725440,2,0,0,0,0,2,536,0,1,672,1000000,32768,0,65536,0,1,0,0,0 > > > o,0x00000000,1682437126.106767,10.1.1.2,33817,10.1.1.3,5001,1073725440,14= 480,2,65535,65700,9,9,4,1460,201000,1,16778209,803000,33580,0,65700,0,0,0,0= ,0 > > > o,0x00000000,1682437126.107141,10.1.1.2,33817,10.1.1.3,5001,1073725440,14= 480,2,65535,65700,9,9,4,1460,201000,1,16778208,803000,33580,60,65700,0,0,0,= 0,0 > > ... > > > i,0x00000000,1682437127.016754,10.1.1.2,33817,10.1.1.3,5001,1073725440,60= 6109,1030,748544,66048,9,9,9,1460,100812,1,1008,303000,475948,0,65700,0,0,0= ,0,0 > > > o,0x00000000,1682437127.016759,10.1.1.2,33817,10.1.1.3,5001,1073725440,60= 6109,1030,748544,66048,9,9,10,1460,100812,1,1011,303000,475948,0,65700,0,0,= 0,0,0 > > disable_time_secs=3D1682437131 disable_time_usecs=3D767582 > num_inbound_tcp_pkts=3D371 num_outbound_tcp_pkts=3D186 > total_tcp_pkts=3D557 num_inbound_skipped_pkts_malloc=3D0 > num_outbound_skipped_pkts_malloc=3D0 num_inbound_skipped_pkts_tcpcb= =3D0 > num_outbound_skipped_pkts_tcpcb=3D0 > num_inbound_skipped_pkts_inpcb=3D0 num_outbound_skipped_pkts_inpc= b=3D0 > total_skipped_tcp_pkts=3D0 flow_list=3D10.1.1.2;33817-10.1.1.= 3;5001, > > > > Reviewers: rscheff, tuexen > > Approved by: rscheff, tuexen > > Subscribers: imp, melifaro, glebius > > Differential Revision: https://reviews.freebsd.org/D39803 > > --- > > share/man/man4/siftr.4 | 21 +++------------------ > > sys/netinet/siftr.c | 34 +++++++++++++++------------------- > > 2 files changed, 18 insertions(+), 37 deletions(-) > > > > Hello, > > This commit message is messy, and not easily understood. In particular > the subject line should be shorter, and the 'Test Plan' probably should > have been removed completely. > > The full set of guidelines for commit messages is documented in the > Committers Guide: > https://docs.freebsd.org/en/articles/committers-guide/#commit-log-message > > Next time you will need to clean up the message before pushing. > Unfortunately the default output of the 'arc' tool does not generate a > message that meets the guidelines. Ask your mentors for more information > if you need it. Now you know :) > > Cheers, > Mitchell > > > diff --git a/share/man/man4/siftr.4 b/share/man/man4/siftr.4 > > index 0406a38779b6..78eb755ddef1 100644 > > --- a/share/man/man4/siftr.4 > > +++ b/share/man/man4/siftr.4 > > @@ -29,7 +29,7 @@ > > .\" > > .\" $FreeBSD$ > > .\" > > -.Dd April 24, 2023 > > +.Dd April 25, 2023 > > .Dt SIFTR 4 > > .Os > > .Sh NAME > > @@ -175,14 +175,6 @@ version of > > .Nm . > > .El > > .Bl -tag -offset indent -width Va > > -.It Va hz > > -tick rate of the kernel in ticks per second. > > -.El > > -.Bl -tag -offset indent -width Va > > -.It Va tcp_rtt_scale > > -smoothed RTT estimate scaling factor. > > -.El > > -.Bl -tag -offset indent -width Va > > .It Va sysname > > operating system name. > > .El > > @@ -294,11 +286,7 @@ The maximum segment size for the flow, in bytes. > > .El > > .Bl -tag -offset indent -width Va > > .It Va 17 > > -The current smoothed RTT estimate for the flow, in units of > TCP_RTT_SCALE * HZ, > > -where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the > kernel's tick > > -timer. > > -Divide by TCP_RTT_SCALE * HZ to get the RTT in secs. > > -TCP_RTT_SCALE and HZ are reported in the enable log message. > > +The current smoothed RTT estimate for the flow, in units of microsecon= d. > > .El > > .Bl -tag -offset indent -width Va > > .It Va 18 > > @@ -313,10 +301,7 @@ for information about the various flags. > > .El > > .Bl -tag -offset indent -width Va > > .It Va 20 > > -The current retransmission timeout length for the flow, in units of HZ= , > where HZ > > -is the kernel's tick timer. > > -Divide by HZ to get the timeout length in seconds. > > -HZ is reported in the enable log message. > > +The current retransmission timeout length for the flow, in units > microsecond. > > .El > > .Bl -tag -offset indent -width Va > > .It Va 21 > > diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c > > index a23980704e17..05104627910d 100644 > > --- a/sys/netinet/siftr.c > > +++ b/sys/netinet/siftr.c > > @@ -207,11 +207,8 @@ struct pkt_node { > > int conn_state; > > /* Max Segment Size (bytes). */ > > u_int max_seg_size; > > - /* > > - * Smoothed RTT stored as found in the TCP control block > > - * in units of (TCP_RTT_SCALE*hz). > > - */ > > - int smoothed_rtt; > > + /* Smoothed RTT (usecs). */ > > + uint32_t srtt; > > /* Is SACK enabled? */ > > u_char sack_enabled; > > /* Window scaling for snd window. */ > > @@ -220,8 +217,8 @@ struct pkt_node { > > u_char rcv_scale; > > /* TCP control block flags. */ > > u_int flags; > > - /* Retransmit timeout length. */ > > - int rxt_length; > > + /* Retransmission timeout (usec). */ > > + uint32_t rto; > > /* Size of the TCP send buffer in bytes. */ > > u_int snd_buf_hiwater; > > /* Current num bytes in the send socket buffer. */ > > @@ -453,7 +450,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,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u," > > - "%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", > > + "%u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n", > > direction[pkt_node->direction], > > pkt_node->hash, > > pkt_node->tval.tv_sec, > > @@ -485,10 +482,10 @@ siftr_process_pkt(struct pkt_node * pkt_node) > > pkt_node->rcv_scale, > > pkt_node->conn_state, > > pkt_node->max_seg_size, > > - pkt_node->smoothed_rtt, > > + pkt_node->srtt, > > pkt_node->sack_enabled, > > pkt_node->flags, > > - pkt_node->rxt_length, > > + pkt_node->rto, > > pkt_node->snd_buf_hiwater, > > pkt_node->snd_buf_cc, > > pkt_node->rcv_buf_hiwater, > > @@ -512,7 +509,7 @@ siftr_process_pkt(struct pkt_node * pkt_node) > > log_buf->ae_bytesused =3D snprintf(log_buf->ae_data, > > MAX_LOG_MSG_LEN, > > > "%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%u,%u," > > - > "%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n", > > + > "%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n", > > direction[pkt_node->direction], > > pkt_node->hash, > > (intmax_t)pkt_node->tval.tv_sec, > > @@ -536,10 +533,10 @@ siftr_process_pkt(struct pkt_node * pkt_node) > > pkt_node->rcv_scale, > > pkt_node->conn_state, > > pkt_node->max_seg_size, > > - pkt_node->smoothed_rtt, > > + pkt_node->srtt, > > pkt_node->sack_enabled, > > pkt_node->flags, > > - pkt_node->rxt_length, > > + pkt_node->rto, > > pkt_node->snd_buf_hiwater, > > pkt_node->snd_buf_cc, > > pkt_node->rcv_buf_hiwater, > > @@ -785,10 +782,10 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb > *inp, struct tcpcb *tp, > > pn->rcv_scale =3D tp->rcv_scale; > > pn->conn_state =3D tp->t_state; > > pn->max_seg_size =3D tp->t_maxseg; > > - pn->smoothed_rtt =3D tp->t_srtt; > > + pn->srtt =3D ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT; > > pn->sack_enabled =3D (tp->t_flags & TF_SACK_PERMIT) !=3D 0; > > pn->flags =3D tp->t_flags; > > - pn->rxt_length =3D tp->t_rxtcur; > > + pn->rto =3D tp->t_rxtcur * tick; > > pn->snd_buf_hiwater =3D inp->inp_socket->so_snd.sb_hiwat; > > pn->snd_buf_cc =3D sbused(&inp->inp_socket->so_snd); > > pn->rcv_buf_hiwater =3D inp->inp_socket->so_rcv.sb_hiwat; > > @@ -1270,10 +1267,9 @@ siftr_manage_ops(uint8_t action) > > > > sbuf_printf(s, > > "enable_time_secs=3D%jd\tenable_time_usecs=3D%06ld\t" > > - "siftrver=3D%s\thz=3D%u\ttcp_rtt_scale=3D%u\tsysname= =3D%s\t" > > - "sysver=3D%u\tipmode=3D%u\n", > > - (intmax_t)tval.tv_sec, tval.tv_usec, MODVERSION_STR, > hz, > > - TCP_RTT_SCALE, SYS_NAME, __FreeBSD_version, > SIFTR_IPMODE); > > + "siftrver=3D%s\tsysname=3D%s\tsysver=3D%u\tipmode=3D%= u\n", > > + (intmax_t)tval.tv_sec, tval.tv_usec, MODVERSION_STR, > > + SYS_NAME, __FreeBSD_version, SIFTR_IPMODE); > > > > sbuf_finish(s); > > alq_writen(siftr_alq, sbuf_data(s), sbuf_len(s), > ALQ_WAITOK); > --000000000000118c9e05fa304989 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Apologize. I am thinking there must be some mess up b= etween 'arc' and 'git commit --amend',</div><div>as my orig= inal git commit message was well organized into 72 chars-per-line. The test= plan</div><div>added by the 'arc' during=C2=A0 "<code>arc dif= f --create</code>" (I thought this command is used to create the</div>= <div>Phabricator review page) is automatically mixed into the updated git m= essage.</div><div><br></div><div>My mentor already notified me about this m= ess. Now I know how to reproduce this problem,</div><div dir=3D"ltr">and I = will take care of it in the future. :)<div><div dir=3D"ltr" class=3D"gmail_= signature"><div dir=3D"ltr"><div><br></div>Best Regards,<div>Cheng Cui</div= ></div></div></div><br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr= " class=3D"gmail_attr">On Tue, Apr 25, 2023 at 5:52=E2=80=AFPM Mitchell Hor= ne <<a href=3D"mailto:mhorne@freebsd.org">mhorne@freebsd.org</a>> wro= te:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px = 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> <br> On 4/25/23 18:26, Cheng Cui wrote:<br> > The branch main has been updated by cc:<br> > <br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3Dd090464ecd4a= f5cd400ef5cbbfe8409d019eac34" rel=3D"noreferrer" target=3D"_blank">https://= cgit.FreeBSD.org/src/commit/?id=3Dd090464ecd4af5cd400ef5cbbfe8409d019eac34<= /a><br> > <br> > commit d090464ecd4af5cd400ef5cbbfe8409d019eac34<br> > Author:=C2=A0 =C2=A0 =C2=A0Cheng Cui <cc@FreeBSD.org><br> > AuthorDate: 2023-04-25 11:52:28 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Cheng Cui <cc@FreeBSD.org><br> > CommitDate: 2023-04-25 17:26:39 +0000<br> > <br> >=C2=A0 =C2=A0 =C2=A0 Change the unit of srtt and rto to usec, inspired = by these in struct "tcp_info". Therefore, no need hz and tcp_rtt_= scale in the headline of the log. Update the man page as well.<br> >=C2=A0 =C2=A0 =C2=A0 <br> >=C2=A0 =C2=A0 =C2=A0 Summary: Simplify srtt and rto values in siftr log= .<br> >=C2=A0 =C2=A0 =C2=A0 <br> >=C2=A0 =C2=A0 =C2=A0 Test Plan:<br> >=C2=A0 =C2=A0 =C2=A0 Tested in Emulab testbed:<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % sudo sysctl net.inet.siftr<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.port_filter: 0<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.genhashes: 0<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.ppl: 1<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.logfile: /var/log/siftr.log<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.enabled: 0<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % sudo sysctl net.inet.siftr.port_filter= =3D5001<br> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.port_filter: 0 -> 5001<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % sudo sysctl net.inet.siftr.enabled=3D1<b= r> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.enabled: 0 -> 1<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ %<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % iperf -c r1 -n 1M<br> >=C2=A0 =C2=A0 =C2=A0 --------------------------------------------------= ----------<br> >=C2=A0 =C2=A0 =C2=A0 Client connecting to r1, TCP port 5001<br> >=C2=A0 =C2=A0 =C2=A0 TCP window size: 32.0 KByte (default)<br> >=C2=A0 =C2=A0 =C2=A0 --------------------------------------------------= ----------<br> >=C2=A0 =C2=A0 =C2=A0 [=C2=A0 1] local 10.1.1.2 port 33817 connected wit= h 10.1.1.3 port 5001<br> >=C2=A0 =C2=A0 =C2=A0 [ ID] Interval=C2=A0 =C2=A0 =C2=A0 =C2=A0Transfer= =C2=A0 =C2=A0 =C2=A0Bandwidth<br> >=C2=A0 =C2=A0 =C2=A0 [=C2=A0 1] 0.00-0.91 sec=C2=A0 1.00 MBytes=C2=A0 9= .22 Mbits/sec<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % sudo sysctl net.inet.siftr.enabled=3D0<b= r> >=C2=A0 =C2=A0 =C2=A0 net.inet.siftr.enabled: 1 -> 0<br> >=C2=A0 =C2=A0 =C2=A0 <br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % ll /var/log/siftr.log<br> >=C2=A0 =C2=A0 =C2=A0 -rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0 9= 1K Apr 25 09:38 /var/log/siftr.log<br> >=C2=A0 =C2=A0 =C2=A0 cc@s1:~ % cat /var/log/siftr.log<br> >=C2=A0 =C2=A0 =C2=A0 enable_time_secs=3D1682437111=C2=A0 =C2=A0 =C2=A0e= nable_time_usecs=3D121115=C2=A0 =C2=A0 =C2=A0 =C2=A0 siftrver=3D1.3.0=C2=A0= sysname=3DFreeBSD sysver=3D1400088=C2=A0 ipmode=3D4<br> >=C2=A0 =C2=A0 =C2=A0 o,0x00000000,1682437125.907343,10.1.1.2,33817,10.1= .1.3,5001,1073725440,1073725440,2,0,0,0,0,2,536,0,1,672,1000000,32768,0,655= 36,0,0,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 i,0x00000000,1682437126.106759,10.1.1.2,33817,10.1= .1.3,5001,1073725440,1073725440,2,0,0,0,0,2,536,0,1,672,1000000,32768,0,655= 36,0,1,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 o,0x00000000,1682437126.106767,10.1.1.2,33817,10.1= .1.3,5001,1073725440,14480,2,65535,65700,9,9,4,1460,201000,1,16778209,80300= 0,33580,0,65700,0,0,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 o,0x00000000,1682437126.107141,10.1.1.2,33817,10.1= .1.3,5001,1073725440,14480,2,65535,65700,9,9,4,1460,201000,1,16778208,80300= 0,33580,60,65700,0,0,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 ...<br> >=C2=A0 =C2=A0 =C2=A0 i,0x00000000,1682437127.016754,10.1.1.2,33817,10.1= .1.3,5001,1073725440,606109,1030,748544,66048,9,9,9,1460,100812,1,1008,3030= 00,475948,0,65700,0,0,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 o,0x00000000,1682437127.016759,10.1.1.2,33817,10.1= .1.3,5001,1073725440,606109,1030,748544,66048,9,9,10,1460,100812,1,1011,303= 000,475948,0,65700,0,0,0,0,0<br> >=C2=A0 =C2=A0 =C2=A0 disable_time_secs=3D1682437131=C2=A0 =C2=A0 disabl= e_time_usecs=3D767582=C2=A0 =C2=A0 =C2=A0 =C2=A0num_inbound_tcp_pkts=3D371= =C2=A0 =C2=A0 =C2=A0 =C2=A0 num_outbound_tcp_pkts=3D186=C2=A0 =C2=A0 =C2=A0= =C2=A0total_tcp_pkts=3D557=C2=A0 =C2=A0 =C2=A0 num_inbound_skipped_pkts_ma= lloc=3D0=C2=A0 =C2=A0 =C2=A0 =C2=A0num_outbound_skipped_pkts_malloc=3D0=C2= =A0 =C2=A0 =C2=A0 num_inbound_skipped_pkts_tcpcb=3D0=C2=A0 =C2=A0 =C2=A0 = =C2=A0 num_outbound_skipped_pkts_tcpcb=3D0=C2=A0 =C2=A0 =C2=A0 =C2=A0num_in= bound_skipped_pkts_inpcb=3D0=C2=A0 =C2=A0 =C2=A0 =C2=A0 num_outbound_skippe= d_pkts_inpcb=3D0=C2=A0 =C2=A0 =C2=A0 =C2=A0total_skipped_tcp_pkts=3D0=C2=A0= =C2=A0 =C2=A0 =C2=A0 flow_list=3D10.1.1.2;33817-10.1.1.3;5001,<br> >=C2=A0 =C2=A0 =C2=A0 <br> >=C2=A0 =C2=A0 =C2=A0 Reviewers: rscheff, tuexen<br> >=C2=A0 =C2=A0 =C2=A0 Approved by: rscheff, tuexen<br> >=C2=A0 =C2=A0 =C2=A0 Subscribers: imp, melifaro, glebius<br> >=C2=A0 =C2=A0 =C2=A0 Differential Revision: <a href=3D"https://reviews.= freebsd.org/D39803" rel=3D"noreferrer" target=3D"_blank">https://reviews.fr= eebsd.org/D39803</a><br> > ---<br> >=C2=A0 =C2=A0share/man/man4/siftr.4 | 21 +++------------------<br> >=C2=A0 =C2=A0sys/netinet/siftr.c=C2=A0 =C2=A0 | 34 +++++++++++++++-----= --------------<br> >=C2=A0 =C2=A02 files changed, 18 insertions(+), 37 deletions(-)<br> > <br> <br> Hello,<br> <br> This commit message is messy, and not easily understood. In particular <br> the subject line should be shorter, and the 'Test Plan' probably sh= ould <br> have been removed completely.<br> <br> The full set of guidelines for commit messages is documented in the <br> Committers Guide:<br> <a href=3D"https://docs.freebsd.org/en/articles/committers-guide/#commit-lo= g-message" rel=3D"noreferrer" target=3D"_blank">https://docs.freebsd.org/en= /articles/committers-guide/#commit-log-message</a><br> <br> Next time you will need to clean up the message before pushing. <br> Unfortunately the default output of the 'arc' tool does not generat= e a <br> message that meets the guidelines. Ask your mentors for more information <b= r> if you need it. Now you know :)<br> <br> Cheers,<br> Mitchell<br> <br> > diff --git a/share/man/man4/siftr.4 b/share/man/man4/siftr.4<br> > index 0406a38779b6..78eb755ddef1 100644<br> > --- a/share/man/man4/siftr.4<br> > +++ b/share/man/man4/siftr.4<br> > @@ -29,7 +29,7 @@<br> >=C2=A0 =C2=A0.\"<br> >=C2=A0 =C2=A0.\" $FreeBSD$<br> >=C2=A0 =C2=A0.\"<br> > -.Dd April 24, 2023<br> > +.Dd April 25, 2023<br> >=C2=A0 =C2=A0.Dt SIFTR 4<br> >=C2=A0 =C2=A0.Os<br> >=C2=A0 =C2=A0.Sh NAME<br> > @@ -175,14 +175,6 @@ version of<br> >=C2=A0 =C2=A0.Nm .<br> >=C2=A0 =C2=A0.El<br> >=C2=A0 =C2=A0.Bl -tag -offset indent -width Va<br> > -.It Va hz<br> > -tick rate of the kernel in ticks per second.<br> > -.El<br> > -.Bl -tag -offset indent -width Va<br> > -.It Va tcp_rtt_scale<br> > -smoothed RTT estimate scaling factor.<br> > -.El<br> > -.Bl -tag -offset indent -width Va<br> >=C2=A0 =C2=A0.It Va sysname<br> >=C2=A0 =C2=A0operating system name.<br> >=C2=A0 =C2=A0.El<br> > @@ -294,11 +286,7 @@ The maximum segment size for the flow, in bytes.<= br> >=C2=A0 =C2=A0.El<br> >=C2=A0 =C2=A0.Bl -tag -offset indent -width Va<br> >=C2=A0 =C2=A0.It Va 17<br> > -The current smoothed RTT estimate for the flow, in units of TCP_RTT_S= CALE * HZ,<br> > -where TCP_RTT_SCALE is a define found in tcp_var.h, and HZ is the ker= nel's tick<br> > -timer.<br> > -Divide by TCP_RTT_SCALE * HZ to get the RTT in secs.<br> > -TCP_RTT_SCALE and HZ are reported in the enable log message.<br> > +The current smoothed RTT estimate for the flow, in units of microseco= nd.<br> >=C2=A0 =C2=A0.El<br> >=C2=A0 =C2=A0.Bl -tag -offset indent -width Va<br> >=C2=A0 =C2=A0.It Va 18<br> > @@ -313,10 +301,7 @@ for information about the various flags.<br> >=C2=A0 =C2=A0.El<br> >=C2=A0 =C2=A0.Bl -tag -offset indent -width Va<br> >=C2=A0 =C2=A0.It Va 20<br> > -The current retransmission timeout length for the flow, in units of H= Z, where HZ<br> > -is the kernel's tick timer.<br> > -Divide by HZ to get the timeout length in seconds.<br> > -HZ is reported in the enable log message.<br> > +The current retransmission timeout length for the flow, in units micr= osecond.<br> >=C2=A0 =C2=A0.El<br> >=C2=A0 =C2=A0.Bl -tag -offset indent -width Va<br> >=C2=A0 =C2=A0.It Va 21<br> > diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c<br> > index a23980704e17..05104627910d 100644<br> > --- a/sys/netinet/siftr.c<br> > +++ b/sys/netinet/siftr.c<br> > @@ -207,11 +207,8 @@ struct pkt_node {<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0conn_state;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Max Segment Size (bytes). */<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0u_int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0max_seg_size;<br> > -=C2=A0 =C2=A0 =C2=A0/*<br> > -=C2=A0 =C2=A0 =C2=A0 * Smoothed RTT stored as found in the TCP contro= l block<br> > -=C2=A0 =C2=A0 =C2=A0 * in units of (TCP_RTT_SCALE*hz).<br> > -=C2=A0 =C2=A0 =C2=A0 */<br> > -=C2=A0 =C2=A0 =C2=A0int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0smoothed_rtt;<br> > +=C2=A0 =C2=A0 =C2=A0/* Smoothed RTT (usecs). */<br> > +=C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 srtt;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Is SACK enabled? */<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0u_char=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 sack_enabled;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Window scaling for snd window. */<br> > @@ -220,8 +217,8 @@ struct pkt_node {<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0u_char=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 rcv_scale;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* TCP control block flags. */<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0u_int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0flags;<br> > -=C2=A0 =C2=A0 =C2=A0/* Retransmit timeout length. */<br> > -=C2=A0 =C2=A0 =C2=A0int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rxt_length;<br> > +=C2=A0 =C2=A0 =C2=A0/* Retransmission timeout (usec). */<br> > +=C2=A0 =C2=A0 =C2=A0uint32_t=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 rto;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Size of the TCP send buffer in bytes. */<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0u_int=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0snd_buf_hiwater;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0/* Current num bytes in the send socket buff= er. */<br> > @@ -453,7 +450,7 @@ siftr_process_pkt(struct pkt_node * pkt_node)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MA= X_LOG_MSG_LEN,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;%c,0x%08x,%zd.%06ld,%x:%x:%x:%x:%x:%x:%x:%x,%u,%x:%x:%x:"<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;%x:%x:%x:%x:%x,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,"<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"%= u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n",<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"%= u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n",<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0di= rection[pkt_node->direction],<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->hash,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->tval.tv_sec,<br> > @@ -485,10 +482,10 @@ siftr_process_pkt(struct pkt_node * pkt_node)<br= > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->rcv_scale,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->conn_state,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->max_seg_size,<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->smoothed_rtt,<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->srtt,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->sack_enabled,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->flags,<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->rxt_length,<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->rto,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->snd_buf_hiwater,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->snd_buf_cc,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->rcv_buf_hiwater,<br> > @@ -512,7 +509,7 @@ siftr_process_pkt(struct pkt_node * pkt_node)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0log_buf->ae_b= ytesused =3D snprintf(log_buf->ae_data,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0MA= X_LOG_MSG_LEN,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;%c,0x%08x,%jd.%06ld,%u.%u.%u.%u,%u,%u.%u.%u.%u,%u,%u,%u,"<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"%= u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%d,%u,%u,%u,%u,%u,%u,%u,%u\n",<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"%= u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u\n",<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0di= rection[pkt_node->direction],<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->hash,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(i= ntmax_t)pkt_node->tval.tv_sec,<br> > @@ -536,10 +533,10 @@ siftr_process_pkt(struct pkt_node * pkt_node)<br= > >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->rcv_scale,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->conn_state,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->max_seg_size,<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->smoothed_rtt,<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->srtt,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->sack_enabled,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->flags,<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->rxt_length,<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pkt_nod= e->rto,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->snd_buf_hiwater,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->snd_buf_cc,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pk= t_node->rcv_buf_hiwater,<br> > @@ -785,10 +782,10 @@ siftr_siftdata(struct pkt_node *pn, struct inpcb= *inp, struct tcpcb *tp,<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->rcv_scale =3D tp->rcv_scale;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->conn_state =3D tp->t_state;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->max_seg_size =3D tp->t_maxseg;<br> > -=C2=A0 =C2=A0 =C2=A0pn->smoothed_rtt =3D tp->t_srtt;<br> > +=C2=A0 =C2=A0 =C2=A0pn->srtt =3D ((u_int64_t)tp->t_srtt * tick)= >> TCP_RTT_SHIFT;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->sack_enabled =3D (tp->t_flags &= ; TF_SACK_PERMIT) !=3D 0;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->flags =3D tp->t_flags;<br> > -=C2=A0 =C2=A0 =C2=A0pn->rxt_length =3D tp->t_rxtcur;<br> > +=C2=A0 =C2=A0 =C2=A0pn->rto =3D tp->t_rxtcur * tick;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->snd_buf_hiwater =3D inp->inp_socke= t->so_snd.sb_hiwat;<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->snd_buf_cc =3D sbused(&inp->in= p_socket->so_snd);<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0pn->rcv_buf_hiwater =3D inp->inp_socke= t->so_rcv.sb_hiwat;<br> > @@ -1270,10 +1267,9 @@ siftr_manage_ops(uint8_t action)<br> >=C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sbuf_printf(s,<b= r> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&q= uot;enable_time_secs=3D%jd\tenable_time_usecs=3D%06ld\t"<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"s= iftrver=3D%s\thz=3D%u\ttcp_rtt_scale=3D%u\tsysname=3D%s\t"<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"s= ysver=3D%u\tipmode=3D%u\n",<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(intmax= _t)tval.tv_sec, tval.tv_usec, MODVERSION_STR, hz,<br> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0TCP_RTT= _SCALE, SYS_NAME, __FreeBSD_version, SIFTR_IPMODE);<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"s= iftrver=3D%s\tsysname=3D%s\tsysver=3D%u\tipmode=3D%u\n",<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(intmax= _t)tval.tv_sec, tval.tv_usec, MODVERSION_STR,<br> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0SYS_NAM= E, __FreeBSD_version, SIFTR_IPMODE);<br> >=C2=A0 =C2=A0<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sbuf_finish(s);<= br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alq_writen(siftr= _alq, sbuf_data(s), sbuf_len(s), ALQ_WAITOK);<br> </blockquote></div></div> --000000000000118c9e05fa304989--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGaXuiJ5kc49wb9fwXD1cRmhn9J85UNKyACCjar9_yAgry6u2g>