diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2009-03-14 10:23:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-15 23:09:54 -0400 |
commit | 0c54b85f2828128274f319a1eb3ce7f604fe2a53 (patch) | |
tree | 8ff84b9aa9cd4775f244c2421e11adfbd206a7bf /include/net | |
parent | 72211e90501f954f586481c25521c3724cda3cc7 (diff) |
tcp: simplify tcp_current_mss
There's very little need for most of the callsites to get
tp->xmit_goal_size updated. That will cost us divide as is,
so slice the function in two. Also, the only users of the
tp->xmit_goal_size are directly behind tcp_current_mss(),
so there's no need to store that variable into tcp_sock
at all! The drop of xmit_goal_size currently leaves 16-bit
hole and some reorganization would again be necessary to
change that (but I'm aiming to fill that hole with u16
xmit_goal_size_segs to cache the results of the remaining
divide to get that tso on regression).
Bring xmit_goal_size parts into tcp.c
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Cc: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/tcp.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 255ca35bea05..e54c76d75495 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -481,7 +481,16 @@ static inline void tcp_clear_xmit_timers(struct sock *sk) | |||
481 | } | 481 | } |
482 | 482 | ||
483 | extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); | 483 | extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); |
484 | extern unsigned int tcp_current_mss(struct sock *sk, int large); | 484 | extern unsigned int tcp_current_mss(struct sock *sk); |
485 | |||
486 | /* Bound MSS / TSO packet size with the half of the window */ | ||
487 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | ||
488 | { | ||
489 | if (tp->max_window && pktsize > (tp->max_window >> 1)) | ||
490 | return max(tp->max_window >> 1, 68U - tp->tcp_header_len); | ||
491 | else | ||
492 | return pktsize; | ||
493 | } | ||
485 | 494 | ||
486 | /* tcp.c */ | 495 | /* tcp.c */ |
487 | extern void tcp_get_info(struct sock *, struct tcp_info *); | 496 | extern void tcp_get_info(struct sock *, struct tcp_info *); |
@@ -822,7 +831,7 @@ static inline void tcp_push_pending_frames(struct sock *sk) | |||
822 | { | 831 | { |
823 | struct tcp_sock *tp = tcp_sk(sk); | 832 | struct tcp_sock *tp = tcp_sk(sk); |
824 | 833 | ||
825 | __tcp_push_pending_frames(sk, tcp_current_mss(sk, 1), tp->nonagle); | 834 | __tcp_push_pending_frames(sk, tcp_current_mss(sk), tp->nonagle); |
826 | } | 835 | } |
827 | 836 | ||
828 | static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) | 837 | static inline void tcp_init_wl(struct tcp_sock *tp, u32 seq) |