aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/ip_vs.h2
-rw-r--r--include/net/sock.h15
-rw-r--r--include/net/tcp.h1
3 files changed, 11 insertions, 7 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 7a3c43711a17..e426641c519f 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -958,7 +958,7 @@ static __inline__ int ip_vs_todrop(void)
958 */ 958 */
959#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK) 959#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
960 960
961extern __inline__ char ip_vs_fwd_tag(struct ip_vs_conn *cp) 961static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
962{ 962{
963 char fwd; 963 char fwd;
964 964
diff --git a/include/net/sock.h b/include/net/sock.h
index 312cb25cbd18..cf628261da52 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -709,6 +709,12 @@ static inline int sk_stream_rmem_schedule(struct sock *sk, struct sk_buff *skb)
709 sk_stream_mem_schedule(sk, skb->truesize, 1); 709 sk_stream_mem_schedule(sk, skb->truesize, 1);
710} 710}
711 711
712static inline int sk_stream_wmem_schedule(struct sock *sk, int size)
713{
714 return size <= sk->sk_forward_alloc ||
715 sk_stream_mem_schedule(sk, size, 0);
716}
717
712/* Used by processes to "lock" a socket state, so that 718/* Used by processes to "lock" a socket state, so that
713 * interrupts and bottom half handlers won't change it 719 * interrupts and bottom half handlers won't change it
714 * from under us. It essentially blocks any incoming 720 * from under us. It essentially blocks any incoming
@@ -1203,8 +1209,7 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
1203 skb = alloc_skb_fclone(size + hdr_len, gfp); 1209 skb = alloc_skb_fclone(size + hdr_len, gfp);
1204 if (skb) { 1210 if (skb) {
1205 skb->truesize += mem; 1211 skb->truesize += mem;
1206 if (sk->sk_forward_alloc >= (int)skb->truesize || 1212 if (sk_stream_wmem_schedule(sk, skb->truesize)) {
1207 sk_stream_mem_schedule(sk, skb->truesize, 0)) {
1208 skb_reserve(skb, hdr_len); 1213 skb_reserve(skb, hdr_len);
1209 return skb; 1214 return skb;
1210 } 1215 }
@@ -1227,10 +1232,8 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
1227{ 1232{
1228 struct page *page = NULL; 1233 struct page *page = NULL;
1229 1234
1230 if (sk->sk_forward_alloc >= (int)PAGE_SIZE || 1235 page = alloc_pages(sk->sk_allocation, 0);
1231 sk_stream_mem_schedule(sk, PAGE_SIZE, 0)) 1236 if (!page) {
1232 page = alloc_pages(sk->sk_allocation, 0);
1233 else {
1234 sk->sk_prot->enter_memory_pressure(); 1237 sk->sk_prot->enter_memory_pressure();
1235 sk_stream_moderate_sndbuf(sk); 1238 sk_stream_moderate_sndbuf(sk);
1236 } 1239 }
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d6bcf1317a6a..97af77c4d096 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -454,6 +454,7 @@ extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
454extern void tcp_xmit_retransmit_queue(struct sock *); 454extern void tcp_xmit_retransmit_queue(struct sock *);
455extern void tcp_simple_retransmit(struct sock *); 455extern void tcp_simple_retransmit(struct sock *);
456extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); 456extern int tcp_trim_head(struct sock *, struct sk_buff *, u32);
457extern int tcp_fragment(struct sock *, struct sk_buff *, u32, unsigned int);
457 458
458extern void tcp_send_probe0(struct sock *); 459extern void tcp_send_probe0(struct sock *);
459extern void tcp_send_partial(struct sock *); 460extern void tcp_send_partial(struct sock *);