Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4409949imm; Tue, 11 Sep 2018 11:25:39 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbcpv3VCjulm4zod18mynI39FWEUNfjNEsMJohOMDEKI/K1oavZPUfxsXICx1f3pYnHSQNw X-Received: by 2002:a63:df04:: with SMTP id u4-v6mr30416749pgg.434.1536690339083; Tue, 11 Sep 2018 11:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536690339; cv=none; d=google.com; s=arc-20160816; b=laNh/deM3SJK4pVYZNpO/JNAUUyiIBBGf5I04tx/zNXTqQj4maGntJ1KuX3Q0+ztt9 nCMpEhkgMjuXjKttB9VmkZhb7upxy3VVQpzACEsxAaOpskAyqXprcaYyx7MKWk1vnxtk WLOXU4ebHlMr4SXoCUJnB21/KJgRwNSUepySrhEEoq6+aSQhUrvq7WS2HX0+/248/9jV cE5bOXydkSp1NLrYSSGXr3pPVt4ASqk+ZNNK6KSoub189Ott9gX6sPz8HBU4fgKVEotV gHt3jGL3c1JYG40srYg6otf7ZDX/DzR6BjWiyFUXCd+ANUXUTTELYRDGTlSfLanhXW6J pwjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=5931aHJ0SiTio5MsKfcYNyT3U/UPc5zo3OJiAvM50Wc=; b=zrnW46fUpKokNKERsjw8BMLSzZSK3CJ3SV2j45gpzc5m3zlGdM631fQWWoW1GZ2h9v Ck7hZUjVqhDNAnXYuOUikgn8C+v/HEjC0EAxe9GjC9fYVR7+VeQip1+RPBGQ33DvVo/t gVi9z/xfeNmWis3AwkRXq3jOPLMFTj044VpfZ6dGQJUy8XFgB1CuuD97IeUy49iDqNRt erorPjV0nQieJXOFReV8hwpfIwFhRAxVPUtKYhOvOsrZEZ5zKR+ud2NZ/BvYjfXW0Xzw +6cUFVZT/K+cA3ulqfVccb6mR6XFemHcaiGlaBfmluMzUXbd7v7hzPmNMDrLh6njjWqs Jzqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=F7rC61w4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2-v6si20786572pfi.351.2018.09.11.11.25.23; Tue, 11 Sep 2018 11:25:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@arista.com header.s=googlenew header.b=F7rC61w4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=arista.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728051AbeIKXYM (ORCPT + 99 others); Tue, 11 Sep 2018 19:24:12 -0400 Received: from mail-ed1-f49.google.com ([209.85.208.49]:41146 "EHLO mail-ed1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbeIKXYM (ORCPT ); Tue, 11 Sep 2018 19:24:12 -0400 Received: by mail-ed1-f49.google.com with SMTP id f38-v6so19975853edd.8 for ; Tue, 11 Sep 2018 11:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=googlenew; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5931aHJ0SiTio5MsKfcYNyT3U/UPc5zo3OJiAvM50Wc=; b=F7rC61w43ZpA8t/XxwarunPvBwThI3vo6CoVHcPpmMbJ5arKeVpjRi1CKMsIiq31wG WCKD86G19rc+7QcEnelFI2pGpCNifK7EKQvDYctg+rrgq98eyVdxXh2chq9BJg/9zKo5 +7imP7c2y8FQ/FouWeD6GdpcSdq0xD5Mbt9yQXETA0X52lKnlIacklZWWI4FkwUrX7JS SxUk0Me8zqkfZ6BqGBua2o681zvOoLHXcj4IG61kFNQA3HWKTiKLm18XBpPF5T0T29Yd 6/Lh4ks8pY1qN8Z12QhlvrpkCTGmSvpzgbMWs+t//zeoo5iurfyqBA7TwBhigMu+UAgb NhCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5931aHJ0SiTio5MsKfcYNyT3U/UPc5zo3OJiAvM50Wc=; b=frGqoe7i3QvmglHkbPJo+/2pyM8TL2qbseemxw29CV5WWn86lkzDUwh3m4/chOUFaD VsNl4F34hgKw5Spn4Z/Z4A+rjv5WOl8izzT40AISWoMkmr+BDO1XwyhHy7DswD+6GZRe JbBocXOeWtzSdHD5xG6OCmtbllv1RFAqbRJR08JO2eyfqPZH9Kg9DCjIaqYHk7thVPy6 VMJ1guC1Vyvl5CNWsT9ANAQuFvNwpgoSBbBh7z5og7hG78PAW3pmY4FISmBgOIWWiVF4 e7oyEew7VZJxplXaKJ7YTWIaXcLorpa4/6wO8pcyaIkG+uMvjdtEy63dvuuaZxvYwLU8 jq/w== X-Gm-Message-State: APzg51CTTtXiEwh/Jjp5HZSYKEL+e8nUbJ99Gxd2vW1VLrt7iS49yjKB IPzO+VFNQBZQZwbEi3HksX+TAFSBWeviZb6UTCuvow== X-Received: by 2002:a50:a186:: with SMTP id 6-v6mr30461746edk.12.1536690218997; Tue, 11 Sep 2018 11:23:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a50:955c:0:0:0:0:0 with HTTP; Tue, 11 Sep 2018 11:23:18 -0700 (PDT) In-Reply-To: <20180911111217.3e3679c5@xeon-e3> References: <20180911180406.31283-1-vasilykh@arista.com> <20180911111217.3e3679c5@xeon-e3> From: Vasiliy Khoruzhick Date: Tue, 11 Sep 2018 11:23:18 -0700 Message-ID: Subject: Re: [PATCH v2] neighbour: confirm neigh entries when ARP packet is received To: Stephen Hemminger 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 11, 2018 at 11:12 AM, Stephen Hemminger wrote: > 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. Sorry for duplicate - this time in plain text, so it should get through lkml filter: I don't think that it's performance-critical path, so this optimization is unnecessary and it doesn't improve code readability.