From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2] neighbour: confirm neigh entries when ARP packet is received Date: Tue, 11 Sep 2018 11:12:17 -0700 Message-ID: <20180911111217.3e3679c5@xeon-e3> References: <20180911180406.31283-1-vasilykh@arista.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "David S. Miller" , Roopa Prabhu , Alexey Dobriyan , Eric Dumazet , Jim Westfall , Wolfgang Bumiller , Vasily Khoruzhick , Kees Cook , Ihar Hrachyshka , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Vasily Khoruzhick Return-path: In-Reply-To: <20180911180406.31283-1-vasilykh@arista.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Tue, 11 Sep 2018 11:04:06 -0700 Vasily Khoruzhick wrote: > diff --git a/net/core/neighbour.c b/net/core/neighbour.c > index aa19d86937af..56a554597db5 100644 > --- a/net/core/neighbour.c > +++ b/net/core/neighbour.c > @@ -1180,6 +1180,12 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, > lladdr = neigh->ha; > } > > + /* Update confirmed timestamp for neighbour entry after we > + * received ARP packet even if it doesn't change IP to MAC binding. > + */ > + if (new & NUD_CONNECTED) > + neigh->confirmed = jiffies; You might want to do: if ((new & NUD_CONNECTED) && neigh->confirmed != jiffies) neigh->confirmed = jiffies; This avoid poisoning the cacheline with unnecessary write.