From patchwork Thu Sep 25 17:55:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rick Jones X-Patchwork-Id: 393423 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9F77C140143 for ; Fri, 26 Sep 2014 03:55:43 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754101AbaIYRzg (ORCPT ); Thu, 25 Sep 2014 13:55:36 -0400 Received: from g4t3426.houston.hp.com ([15.201.208.54]:11227 "EHLO g4t3426.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752982AbaIYRzb (ORCPT ); Thu, 25 Sep 2014 13:55:31 -0400 Received: from g4t3433.houston.hp.com (g4t3433.houston.hp.com [16.210.25.219]) by g4t3426.houston.hp.com (Postfix) with ESMTP id 46EEEB0; Thu, 25 Sep 2014 17:55:29 +0000 (UTC) Received: from tardy (tardy.usa.hp.com [16.103.148.51]) by g4t3433.houston.hp.com (Postfix) with ESMTP id BDDA782; Thu, 25 Sep 2014 17:55:29 +0000 (UTC) Received: by tardy (Postfix, from userid 1000) id 8DFF329004BA; Thu, 25 Sep 2014 10:55:28 -0700 (PDT) Subject: [RFC PATCH net-next] arp: Do not perturb drop profiles with ignored ARP packets Cc: To: X-Mailer: mail (GNU Mailutils 2.2) Message-Id: <20140925175528.8DFF329004BA@tardy> Date: Thu, 25 Sep 2014 10:55:28 -0700 (PDT) From: raj@tardy.usa.hp.com (Rick Jones) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Rick Jones We do not wish to disturb dropwatch or perf drop profiles with an ARP we will ignore. Signed-off-by: Rick Jones --- Compile tested only after seeing arp_rcv in a perf top -G -e skb:kfree_skb -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index 1a9b99e..16acb59 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -953,10 +953,11 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev, { const struct arphdr *arp; + /* do not tweak dropwatch on an ARP we will ignore */ if (dev->flags & IFF_NOARP || skb->pkt_type == PACKET_OTHERHOST || skb->pkt_type == PACKET_LOOPBACK) - goto freeskb; + goto consumeskb; skb = skb_share_check(skb, GFP_ATOMIC); if (!skb) @@ -974,6 +975,9 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev, return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process); +consumeskb: + consume_skb(skb); + return 0; freeskb: kfree_skb(skb); out_of_mem: