netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Vasily Khoruzhick <vasilykh@arista.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Roopa Prabhu <roopa@cumulusnetworks.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Jim Westfall <jwestfall@surrealistic.net>,
	Wolfgang Bumiller <w.bumiller@proxmox.com>,
	Vasily Khoruzhick <anarsoul@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	Ihar Hrachyshka <ihrachys@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] neighbour: confirm neigh entries when ARP packet is received
Date: Tue, 11 Sep 2018 11:12:17 -0700	[thread overview]
Message-ID: <20180911111217.3e3679c5@xeon-e3> (raw)
In-Reply-To: <20180911180406.31283-1-vasilykh@arista.com>

On Tue, 11 Sep 2018 11:04:06 -0700
Vasily Khoruzhick <vasilykh@arista.com> 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.

  reply	other threads:[~2018-09-11 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 18:04 [PATCH v2] neighbour: confirm neigh entries when ARP packet is received Vasily Khoruzhick
2018-09-11 18:12 ` Stephen Hemminger [this message]
2018-09-11 18:23   ` Vasiliy Khoruzhick
2018-09-12  9:05 ` Sergei Shtylyov
2018-09-13 16:04 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180911111217.3e3679c5@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=adobriyan@gmail.com \
    --cc=anarsoul@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ihrachys@redhat.com \
    --cc=jwestfall@surrealistic.net \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roopa@cumulusnetworks.com \
    --cc=vasilykh@arista.com \
    --cc=w.bumiller@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).