Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jun 2016 14:16:54 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        src-committers@freebsd.org
Cc:        svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r301932 - head/sys/dev/cxgbe/tom
Message-ID:  <10550858.Wqzuf5sXBE@ralph.baldwin.cx>
In-Reply-To: <201606152108.u5FL8pcO012174@repo.freebsd.org>
References:  <201606152108.u5FL8pcO012174@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, June 15, 2016 09:08:51 PM John Baldwin wrote:
> Author: jhb
> Date: Wed Jun 15 21:08:51 2016
> New Revision: 301932
> URL: https://svnweb.freebsd.org/changeset/base/301932
> 
> Log:
>   Use sbused() instead of sbspace() to avoid signed issues.
>   
>   Inserting a full mbuf with an external cluster into the socket buffer
>   resulted in sbspace() returning -MLEN.  However, since sb_hiwat is
>   unsigned, the -MLEN value was converted to unsigned in comparisons.  As a
>   result, the socket buffer was never autosized.  Note that sb_lowat is signed
>   to permit direct comparisons with sbspace(), but sb_hiwat is unsigned.
>   Follow suit with what tcp_output() does and compare the value of sbused()
>   with sb_hiwat instead.
>   
>   Approved by:	re (gjb)
>   Sponsored by:	Chelsio Communications

Amusingly (or not), sb_lowat used to be signed as well.  Mike Karels
changed it to signed in this commit to BSD:

https://svnweb.freebsd.org/csrg/sys/sys/socketvar.h?revision=43896

The log reads:

add SB_ASYNC in sockbuf, add  SB_NOTIFY, SB_NOINTR;
make lowat signed for comparison with sbspace (should probably give up
and make all fields signed

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10550858.Wqzuf5sXBE>