diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-06-01 02:44:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-01 02:44:05 -0400 |
commit | b1faf5666438090a4dc4fceac8502edc7788b7e3 (patch) | |
tree | f90808dea27cc38aff6feed1782e2a5666fa6ee9 /include | |
parent | bc284f94f84c3d76e49c6f3df9028c503f9589d9 (diff) |
net: sock_queue_err_skb() dont mess with sk_forward_alloc
Correct sk_forward_alloc handling for error_queue would need to use a
backlog of frames that softirq handler could not deliver because socket
is owned by user thread. Or extend backlog processing to be able to
process normal and error packets.
Another possibility is to not use mem charge for error queue, this is
what I implemented in this patch.
Note: this reverts commit 29030374
(net: fix sk_forward_alloc corruptions), since we dont need to lock
socket anymore.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sock.h | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index ca241ea14875..731150d52799 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1524,20 +1524,7 @@ extern void sk_stop_timer(struct sock *sk, struct timer_list* timer); | |||
1524 | 1524 | ||
1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); | 1525 | extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); |
1526 | 1526 | ||
1527 | static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) | 1527 | extern int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb); |
1528 | { | ||
1529 | /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces | ||
1530 | number of warnings when compiling with -W --ANK | ||
1531 | */ | ||
1532 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
1533 | (unsigned)sk->sk_rcvbuf) | ||
1534 | return -ENOMEM; | ||
1535 | skb_set_owner_r(skb, sk); | ||
1536 | skb_queue_tail(&sk->sk_error_queue, skb); | ||
1537 | if (!sock_flag(sk, SOCK_DEAD)) | ||
1538 | sk->sk_data_ready(sk, skb->len); | ||
1539 | return 0; | ||
1540 | } | ||
1541 | 1528 | ||
1542 | /* | 1529 | /* |
1543 | * Recover an error report and clear atomically | 1530 | * Recover an error report and clear atomically |