Subject: Re: TCP socket buffers automatic sizing
To: Mindaugas R. <rmind@NetBSD.org>
From: Greg Troxel <gdt@ir.bbn.com>
List: tech-net
Date: 07/21/2007 07:01:13
"Mindaugas R." <rmind@NetBSD.org> writes:

>> Anyone could test and review it, please?
>> 
>> [1]. http://www.netbsd.org/~rmind/tcp_buf_autosizing.diff
>
> Nobody cares?..
> I would like to put this into the tree.

I looked it over, but not super carefully.

It seems that this will cause NetBSD to advertise a receive window
without actually having an allocated buffer.  Will a segment that
doesn't fit inthe buffer but is in the window be received and stored if
there is actually memory available.  In other words, are in-window
segments only dropped if resize allocation fails?

It seems that autosize is turned off permanently for the socket if there
is a single allocation failure, and that there is no way for it to be
turned back on.

  @@ -4015,8 +4088,7 @@ syn_cache_add(struct sockaddr *src, stru
                  sc->sc_requested_s_scale = tb.requested_s_scale;
                  sc->sc_request_r_scale = 0;
                  while (sc->sc_request_r_scale < TCP_MAX_WINSHIFT &&
  -                   TCP_MAXWIN << sc->sc_request_r_scale <
  -                   so->so_rcv.sb_hiwat)
  +                   (0x1 << sc->sc_request_r_scale) < tcp_minmss)
                          sc->sc_request_r_scale++;
          } else {
                  sc->sc_requested_s_scale = 15;

I didn't understand this hunk.