Created
July 2, 2016 17:13
-
-
Save anonymous/078cf3ea121ccde05e81b35cf84aeb25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) | |
{ | |
struct net *net = sock_net((struct sock *)tp); | |
return tp->notsent_lowat ?: net->ipv4.sysctl_tcp_notsent_lowat; | |
} | |
static inline bool tcp_stream_memory_free(const struct sock *sk) | |
{ | |
const struct tcp_sock *tp = tcp_sk(sk); | |
u32 notsent_bytes = tp->write_seq - tp->snd_nxt; | |
return notsent_bytes < tcp_notsent_lowat(tp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment