netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Timo Teras <timo.teras@iki.fi>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: David Miller <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<kaber@trash.net>
Subject: Re: [PATCH v2 net-next] arp: flush arp cache on IFF_NOARP change
Date: Tue, 21 May 2013 21:29:30 +0300	[thread overview]
Message-ID: <20130521212930.01efd34e@vostro> (raw)
In-Reply-To: <1369153519.2615.3.camel@bwh-desktop.uk.solarflarecom.com>

On Tue, 21 May 2013 17:25:19 +0100
Ben Hutchings <bhutchings@solarflare.com> wrote:

> On Tue, 2013-05-21 at 13:23 +0300, Timo Teräs wrote:
> > IFF_NOARP affects what kind of neighbor entries are created
> > (nud NOARP or nud INCOMPLETE). If the flag changes, flush the arp
> > cache to refresh all entries.
> > 
> > Signed-off-by: Timo Teräs <timo.teras@iki.fi>
> > ---
> > > This patch makes no sense at all.
> > > 
> > > The state bit in ->priv_flags is a boolean stating whether the
> > > notified should do something or not.
> > > 
> > > But you're setting it to match what IFF_NOARP is.
> > >
> > > You should set it any time IFF_NOARP _changes_, and then clear
> > > the bit when the notifier clears the neighbour entries.
> > 
> > IFF_NOARP_CHANGED is set according to "changes = dev->flags ^
> > old_flags;" which reflect the change. But I agree that the clearing
> > out bit was misplaced. This is especially true as it seems
> > NETDEV_CHANGE can be notified from another place too.
> [...]
> 
> None of the other persistent flags have a transient flag for changes;
> why should IFF_NOARP?  Why not cache the IFF_NOARP state in the
> in_device and then compare and update that in arp_netdev_event().

This was the earlier suggestion I got, so I followed that. NOARP flag
is also used in IPv6 side (quick look would indicate that ndisc code
needs similar fix), so it would be useful to have this generally
available.

Would it be worthwhile to consider adding "flags_changed" to struct
net_device or some other mechanism add this info about all flags?

  reply	other threads:[~2013-05-21 18:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 13:29 [PATCH net-next] arp: flush arp cache on IFF_NOARP change Timo Teräs
2013-05-20 20:46 ` David Miller
2013-05-21 10:23   ` [PATCH v2 " Timo Teräs
2013-05-21 16:25     ` Ben Hutchings
2013-05-21 18:29       ` Timo Teras [this message]
2013-05-21 18:54         ` Ben Hutchings
2013-05-23  7:01     ` David Miller
2013-05-23  7:49       ` Timo Teras

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=20130521212930.01efd34e@vostro \
    --to=timo.teras@iki.fi \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    /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).