Commit 70d4bf6d467a330ccc947df9b2608e329d9e7708

Authored by Neil Horman
Committed by David S. Miller
1 parent 4b706372f1

drop_monitor: convert some kfree_skb call sites to consume_skb

Convert a few calls from kfree_skb to consume_skb

Noticed while I was working on dropwatch that I was detecting lots of internal
skb drops in several places.  While some are legitimate, several were not,
freeing skbs that were at the end of their life, rather than being discarded due
to an error.  This patch converts those calls sites from using kfree_skb to
consume_skb, which quiets the in-kernel drop_monitor code from detecting them as
drops.  Tested successfully by myself

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 3 changed files with 7 additions and 6 deletions Side-by-side Diff

... ... @@ -407,7 +407,7 @@
407 407 audit_hold_skb(skb);
408 408 } else
409 409 /* drop the extra reference if sent ok */
410   - kfree_skb(skb);
  410 + consume_skb(skb);
411 411 }
412 412  
413 413 static int kauditd_thread(void *dummy)
net/netlink/af_netlink.c
... ... @@ -1076,14 +1076,15 @@
1076 1076 sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list)
1077 1077 do_one_broadcast(sk, &info);
1078 1078  
1079   - kfree_skb(skb);
  1079 + consume_skb(skb);
1080 1080  
1081 1081 netlink_unlock_table();
1082 1082  
1083   - kfree_skb(info.skb2);
1084   -
1085   - if (info.delivery_failure)
  1083 + if (info.delivery_failure) {
  1084 + kfree_skb(info.skb2);
1086 1085 return -ENOBUFS;
  1086 + } else
  1087 + consume_skb(info.skb2);
1087 1088  
1088 1089 if (info.delivered) {
1089 1090 if (info.congested && (allocation & __GFP_WAIT))
... ... @@ -1906,7 +1906,7 @@
1906 1906 break;
1907 1907 }
1908 1908  
1909   - kfree_skb(skb);
  1909 + consume_skb(skb);
1910 1910  
1911 1911 if (siocb->scm->fp)
1912 1912 break;