# This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/09/28 13:26:54-07:00 davem@nuts.davemloft.net # [TCP]: Uninline tcp_current_mss(). # # Also fix the return value of tcp_sync_mss() to # be unsigned. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2004/09/28 13:26:01-07:00 davem@nuts.davemloft.net +31 -1 # [TCP]: Uninline tcp_current_mss(). # # include/net/tcp.h # 2004/09/28 13:26:00-07:00 davem@nuts.davemloft.net +2 -32 # [TCP]: Uninline tcp_current_mss(). # diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h 2004-09-28 13:49:22 -07:00 +++ b/include/net/tcp.h 2004-09-28 13:49:22 -07:00 @@ -961,7 +961,8 @@ extern void tcp_delete_keepalive_timer (struct sock *); extern void tcp_reset_keepalive_timer (struct sock *, unsigned long); -extern int tcp_sync_mss(struct sock *sk, u32 pmtu); +extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); +extern unsigned int tcp_current_mss(struct sock *sk, int large); extern const char timer_bug_msg[]; @@ -1033,37 +1034,6 @@ default: printk(timer_bug_msg); }; -} - -/* Compute the current effective MSS, taking SACKs and IP options, - * and even PMTU discovery events into account. - * - * LARGESEND note: !urg_mode is overkill, only frames up to snd_up - * cannot be large. However, taking into account rare use of URG, this - * is not a big flaw. - */ - -static inline unsigned int tcp_current_mss(struct sock *sk, int large) -{ - struct tcp_opt *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); - int do_large, mss_now; - - do_large = (large && - (sk->sk_route_caps & NETIF_F_TSO) && - !tp->urg_mode); - mss_now = do_large ? tp->mss_cache : tp->mss_cache_std; - - if (dst) { - u32 mtu = dst_pmtu(dst); - if (mtu != tp->pmtu_cookie || - tp->ext2_header_len != dst->header_len) - mss_now = tcp_sync_mss(sk, mtu); - } - if (tp->eff_sacks) - mss_now -= (TCPOLEN_SACK_BASE_ALIGNED + - (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK)); - return mss_now; } /* Initialize RCV_MSS value. diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2004-09-28 13:49:22 -07:00 +++ b/net/ipv4/tcp_output.c 2004-09-28 13:49:22 -07:00 @@ -603,7 +603,7 @@ this function. --ANK (980731) */ -int tcp_sync_mss(struct sock *sk, u32 pmtu) +unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) { struct tcp_opt *tp = tcp_sk(sk); struct dst_entry *dst = __sk_dst_get(sk); @@ -661,6 +661,36 @@ return mss_now; } +/* Compute the current effective MSS, taking SACKs and IP options, + * and even PMTU discovery events into account. + * + * LARGESEND note: !urg_mode is overkill, only frames up to snd_up + * cannot be large. However, taking into account rare use of URG, this + * is not a big flaw. + */ + +unsigned int tcp_current_mss(struct sock *sk, int large) +{ + struct tcp_opt *tp = tcp_sk(sk); + struct dst_entry *dst = __sk_dst_get(sk); + int do_large, mss_now; + + do_large = (large && + (sk->sk_route_caps & NETIF_F_TSO) && + !tp->urg_mode); + mss_now = do_large ? tp->mss_cache : tp->mss_cache_std; + + if (dst) { + u32 mtu = dst_pmtu(dst); + if (mtu != tp->pmtu_cookie || + tp->ext2_header_len != dst->header_len) + mss_now = tcp_sync_mss(sk, mtu); + } + if (tp->eff_sacks) + mss_now -= (TCPOLEN_SACK_BASE_ALIGNED + + (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK)); + return mss_now; +} /* This routine writes packets to the network. It advances the * send_head. This happens as incoming acks open up the remote