lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADVnQykeJh+TL1tbOVfcgAJvsk_2f3OpE2-K6m_yqc9Bu9PZEw@mail.gmail.com>
Date: Fri, 19 Dec 2025 10:59:29 -0500
From: Neal Cardwell <ncardwell@...gle.com>
To: Daniel Sedlak <daniel.sedlak@...77.com>
Cc: Eric Dumazet <edumazet@...gle.com>, Kuniyuki Iwashima <kuniyu@...gle.com>, 
	"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Simon Horman <horms@...nel.org>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] tcp: clarify tcp_congestion_ops functions comments

On Fri, Dec 19, 2025 at 2:37 AM Daniel Sedlak <daniel.sedlak@...77.com> wrote:
>
> Hi Neal,
>
> On 12/18/25 2:37 PM, Neal Cardwell wrote:
>
> >
> > Perhaps something like the following.
> >
> > diff --git a/include/net/tcp.h b/include/net/tcp.h
> > index 10706a1753e96..d35908bc977db 100644
> > --- a/include/net/tcp.h
> > +++ b/include/net/tcp.h
> > @@ -1326,12 +1326,28 @@ struct rate_sample {
> >   struct tcp_congestion_ops {
> >   /* fast path fields are put first to fill one cache line */
> >
> > +       /* A congestion control (CC) must provide one of either:
> > +        *
> > +        * (a) a cong_avoid function, if the CC wants to use the core TCP
> > +        *     stack's default functionality to implement a "classic"
> > +        *     (Reno/CUBIC-style) response to packet loss, RFC3168 ECN,
> > +        *     idle periods, pacing rate computations, etc.
> > +        *
> > +        * (b) a cong_control function, if the CC wants custom behavior and
> > +        *      complete control of all congestion control behaviors
> > +        */
> > +       /* (a) "classic" response: calculate new cwnd.
> > +        */
> > +       void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked);
> > +       /* (b) "custom" response: call when packets are delivered to update
> > +        * cwnd and pacing rate, after all the ca_state processing.
> > +        */
> > +       void (*cong_control)(struct sock *sk, u32 ack, int flag,
> > +                            const struct rate_sample *rs);
> > +
> >          /* return slow start threshold (required) */
> >          u32 (*ssthresh)(struct sock *sk);
> >
> > -       /* do new cwnd calculation (required) */
> > -       void (*cong_avoid)(struct sock *sk, u32 ack, u32 acked);
> > -
> >          /* call before changing ca_state (optional) */
> >          void (*set_state)(struct sock *sk, u8 new_state);
> >
> > @@ -1347,12 +1363,6 @@ struct tcp_congestion_ops {
> >          /* pick target number of segments per TSO/GSO skb (optional): */
> >          u32 (*tso_segs)(struct sock *sk, unsigned int mss_now);
> >
> > -       /* call when packets are delivered to update cwnd and pacing rate,
> > -        * after all the ca_state processing. (optional)
> > -        */
> > -       void (*cong_control)(struct sock *sk, u32 ack, int flag, const
> > struct rate_sample *rs);
> > -
> > -
> >          /* new value of cwnd after loss (required) */
> >          u32  (*undo_cwnd)(struct sock *sk);
> >          /* returns the multiplier used in tcp_sndbuf_expand (optional) */
> >
> > How does that sound?
> >
>
> Thank you for your response & suggestions. This sounds like really nice
> improvement, can I use it for v2 and add you as Co-developed-by (since
> you've done most of the heavy lifting)?

Sure, please feel free to use it for v2, and feel free to add me as
Co-developed-by. :-)

(BTW, you probably saw the "The net-next tree is closed...Please
repost when net-next reopens after Jan 2nd." note from Paolo, but I'm
mentioning it just in case.)

Thanks!
neal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ