]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Peter Zijlstra <a.p.zijlstra@chello.nl> |
2 | Subject: net: wrap sk->sk_backlog_rcv() | |
3 | Patch-mainline: No | |
4 | References: FATE#303834 | |
5 | ||
6 | Wrap calling sk->sk_backlog_rcv() in a function. This will allow extending the | |
7 | generic sk_backlog_rcv behaviour. | |
8 | ||
9 | Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> | |
10 | Acked-by: Neil Brown <neilb@suse.de> | |
11 | Acked-by: Suresh Jayaraman <sjayaraman@suse.de> | |
12 | ||
13 | --- | |
14 | include/net/sock.h | 5 +++++ | |
15 | include/net/tcp.h | 2 +- | |
16 | net/core/sock.c | 4 ++-- | |
17 | net/ipv4/tcp.c | 2 +- | |
18 | net/ipv4/tcp_timer.c | 2 +- | |
19 | 5 files changed, 10 insertions(+), 5 deletions(-) | |
20 | ||
21 | --- a/include/net/sock.h | |
22 | +++ b/include/net/sock.h | |
23 | @@ -482,6 +482,11 @@ static inline void sk_add_backlog(struct | |
24 | skb->next = NULL; | |
25 | } | |
26 | ||
27 | +static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |
28 | +{ | |
29 | + return sk->sk_backlog_rcv(sk, skb); | |
30 | +} | |
31 | + | |
32 | #define sk_wait_event(__sk, __timeo, __condition) \ | |
33 | ({ int __rc; \ | |
34 | release_sock(__sk); \ | |
35 | --- a/include/net/tcp.h | |
36 | +++ b/include/net/tcp.h | |
37 | @@ -894,7 +894,7 @@ static inline int tcp_prequeue(struct so | |
38 | BUG_ON(sock_owned_by_user(sk)); | |
39 | ||
40 | while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { | |
41 | - sk->sk_backlog_rcv(sk, skb1); | |
42 | + sk_backlog_rcv(sk, skb1); | |
43 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED); | |
44 | } | |
45 | ||
46 | --- a/net/core/sock.c | |
47 | +++ b/net/core/sock.c | |
48 | @@ -324,7 +324,7 @@ int sk_receive_skb(struct sock *sk, stru | |
49 | */ | |
50 | mutex_acquire(&sk->sk_lock.dep_map, 0, 1, _RET_IP_); | |
51 | ||
52 | - rc = sk->sk_backlog_rcv(sk, skb); | |
53 | + rc = sk_backlog_rcv(sk, skb); | |
54 | ||
55 | mutex_release(&sk->sk_lock.dep_map, 1, _RET_IP_); | |
56 | } else | |
57 | @@ -1372,7 +1372,7 @@ static void __release_sock(struct sock * | |
58 | struct sk_buff *next = skb->next; | |
59 | ||
60 | skb->next = NULL; | |
61 | - sk->sk_backlog_rcv(sk, skb); | |
62 | + sk_backlog_rcv(sk, skb); | |
63 | ||
64 | /* | |
65 | * We are in process context here with softirqs | |
66 | --- a/net/ipv4/tcp.c | |
67 | +++ b/net/ipv4/tcp.c | |
68 | @@ -1165,7 +1165,7 @@ static void tcp_prequeue_process(struct | |
69 | * necessary */ | |
70 | local_bh_disable(); | |
71 | while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) | |
72 | - sk->sk_backlog_rcv(sk, skb); | |
73 | + sk_backlog_rcv(sk, skb); | |
74 | local_bh_enable(); | |
75 | ||
76 | /* Clear memory counter. */ | |
77 | --- a/net/ipv4/tcp_timer.c | |
78 | +++ b/net/ipv4/tcp_timer.c | |
79 | @@ -201,7 +201,7 @@ static void tcp_delack_timer(unsigned lo | |
80 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPSCHEDULERFAILED); | |
81 | ||
82 | while ((skb = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) | |
83 | - sk->sk_backlog_rcv(sk, skb); | |
84 | + sk_backlog_rcv(sk, skb); | |
85 | ||
86 | tp->ucopy.memory = 0; | |
87 | } |