lkml.org 
[lkml]   [2004]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] fix tcp_default_win_scale.
    On Tue, 6 Jul 2004, Stephen Hemminger wrote:

    > +/* Default window scaling based on the size of the maximum window */
    > +static inline __u8 tcp_default_win_scale(void)
    > +{
    > + int b = ffs(sysctl_tcp_rmem[2]);
    > + return (b < 17) ? 0 : b-16;
    > +}


    I would actually change this to be:

    static inline __u8 tcp_select_win_scale(void)
    {
    int b = ffs(tcp_win_from_space(max(sysctl_tcp_rmem[2], sysctl_rmem_max)));
    b = (b < 17) ? 0 : b-16;
    return max(b, 14);
    }

    Then you can also get rid of all the window scale calculation code in
    tcp_select_initial_window().

    -John

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:04    [W:0.020 / U:30.872 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site