From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B173C46470 for ; Sat, 4 May 2019 04:44:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1B612084A for ; Sat, 4 May 2019 04:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726312AbfEDElV (ORCPT ); Sat, 4 May 2019 00:41:21 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:56224 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725865AbfEDElV (ORCPT ); Sat, 4 May 2019 00:41:21 -0400 Received: from localhost (unknown [75.104.87.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 9F63C14D8E200; Fri, 3 May 2019 21:41:15 -0700 (PDT) Date: Sat, 04 May 2019 00:41:11 -0400 (EDT) Message-Id: <20190504.004111.284554825798498883.davem@davemloft.net> To: dsahern@kernel.org Cc: netdev@vger.kernel.org, alan.maguire@oracle.com, jwestfall@surrealistic.net, dsahern@gmail.com Subject: Re: [PATCH net] neighbor: Call __ipv4_neigh_lookup_noref in neigh_xmit From: David Miller In-Reply-To: <20190502011842.1645-1-dsahern@kernel.org> References: <20190502011842.1645-1-dsahern@kernel.org> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Fri, 03 May 2019 21:41:21 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern Date: Wed, 1 May 2019 18:18:42 -0700 > From: David Ahern > > Commit cd9ff4de0107 changed the key for IFF_POINTOPOINT devices to > INADDR_ANY but neigh_xmit which is used for MPLS encapsulations was not > updated to use the altered key. The result is that every packet Tx does > a lookup on the gateway address which does not find an entry, a new one > is created only to find the existing one in the table right before the > insert since arp_constructor was updated to reset the primary key. This > is seen in the allocs and destroys counters: > ip -s -4 ntable show | head -10 | grep alloc > > which increase for each packet showing the unnecessary overhread. > > Fix by having neigh_xmit use __ipv4_neigh_lookup_noref for NEIGH_ARP_TABLE. > > Fixes: cd9ff4de0107 ("ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY") > Reported-by: Alan Maguire > Signed-off-by: David Ahern Applied and queued up for -stable.