mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
net: sk_drops consolidation
sock_queue_rcv_skb() can update sk_drops itself, removing need for callers to take care of it. This is more consistent since sock_queue_rcv_skb() also reads sk_drops when queueing a skb. This adds sk_drops managment to many protocols that not cared yet. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
48bccd25df
commit
766e9037cc
9 changed files with 20 additions and 34 deletions
|
|
@ -159,11 +159,9 @@ out_nofree:
|
|||
static int pn_backlog_rcv(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
int err = sock_queue_rcv_skb(sk, skb);
|
||||
if (err < 0) {
|
||||
|
||||
if (err < 0)
|
||||
kfree_skb(skb);
|
||||
if (err == -ENOMEM)
|
||||
atomic_inc(&sk->sk_drops);
|
||||
}
|
||||
return err ? NET_RX_DROP : NET_RX_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -360,8 +360,6 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
|
|||
err = sock_queue_rcv_skb(sk, skb);
|
||||
if (!err)
|
||||
return 0;
|
||||
if (err == -ENOMEM)
|
||||
atomic_inc(&sk->sk_drops);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue