All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
@ 2022-12-13  7:38 David Decotigny
  2022-12-15  4:48 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: David Decotigny @ 2022-12-13  7:38 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Nikolay Aleksandrov, David Ahern, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, David Decotigny, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

From: David Decotigny <ddecotig@google.com>

Without this patch, the 'ip neigh add proxy' config is lost when the
cable or peer disappear, ie. when the link goes down while staying
admin up. When the link comes back, the config is never recovered.

This patch makes sure that such an nd proxy config survives a switch
or cable issue.

Signed-off-by: David Decotigny <ddecotig@google.com>


---
 net/core/neighbour.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 952a54763358..5ad7ac674daa 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -426,7 +426,10 @@ static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev,
 {
 	write_lock_bh(&tbl->lock);
 	neigh_flush_dev(tbl, dev, skip_perm);
-	pneigh_ifdown_and_unlock(tbl, dev);
+	if (skip_perm)
+		write_unlock_bh(&tbl->lock);
+	else
+		pneigh_ifdown_and_unlock(tbl, dev);
 	pneigh_queue_purge(&tbl->proxy_queue, dev ? dev_net(dev) : NULL,
 			   tbl->family);
 	if (skb_queue_empty_lockless(&tbl->proxy_queue))
-- 
2.39.0.rc1.256.g54fd8350bd-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
  2022-12-13  7:38 [PATCH v1 1/1] net: neigh: persist proxy config across link flaps David Decotigny
@ 2022-12-15  4:48 ` Jakub Kicinski
  2022-12-15  5:34   ` Mahesh Bandewar (महेश बंडेवार)
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2022-12-15  4:48 UTC (permalink / raw)
  To: David Decotigny
  Cc: David S. Miller, Eric Dumazet, Paolo Abeni, netdev, linux-kernel,
	Nikolay Aleksandrov, David Ahern, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, David Decotigny, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

On Mon, 12 Dec 2022 23:38:01 -0800 David Decotigny wrote:
> From: David Decotigny <ddecotig@google.com>
> 
> Without this patch, the 'ip neigh add proxy' config is lost when the
> cable or peer disappear, ie. when the link goes down while staying
> admin up. When the link comes back, the config is never recovered.
> 
> This patch makes sure that such an nd proxy config survives a switch
> or cable issue.

Hm, how does this square with the spirit of 859bd2ef1fc11 ?

Would be great to hear from David, IDK if he's around or off until 
next year.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
  2022-12-15  4:48 ` Jakub Kicinski
@ 2022-12-15  5:34   ` Mahesh Bandewar (महेश बंडेवार)
       [not found]     ` <CAG88wWbZ3eXCFJBZ8mrfvddKiVihF-GfEOYAOmT_7VX_AeOoqQ@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Mahesh Bandewar (महेश बंडेवार) @ 2022-12-15  5:34 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David Decotigny, David S. Miller, Eric Dumazet, Paolo Abeni,
	netdev, linux-kernel, Nikolay Aleksandrov, David Ahern,
	Denis V. Lunev, Daniel Borkmann, Chen Zhongjin, David Decotigny,
	Yuwei Wang, Alexander Mikhalitsyn, Thomas Zeitlhofer

On Wed, Dec 14, 2022 at 8:49 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 12 Dec 2022 23:38:01 -0800 David Decotigny wrote:
> > From: David Decotigny <ddecotig@google.com>
> >
> > Without this patch, the 'ip neigh add proxy' config is lost when the
> > cable or peer disappear, ie. when the link goes down while staying
> > admin up. When the link comes back, the config is never recovered.
> >
> > This patch makes sure that such an nd proxy config survives a switch
> > or cable issue.
>
> Hm, how does this square with the spirit of 859bd2ef1fc11 ?
>
Devid's (Decotigny) patch is adding the distinction between admin-down
from carrier-off which could be transient. So in my belief, it's
correcting / enhancing the behavior that David (Ahern) introduced but
we can hear from David himself :)

> Would be great to hear from David, IDK if he's around or off until
> next year.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
       [not found]     ` <CAG88wWbZ3eXCFJBZ8mrfvddKiVihF-GfEOYAOmT_7VX_AeOoqQ@mail.gmail.com>
@ 2022-12-15 19:05       ` Jakub Kicinski
  2022-12-15 20:36         ` David Decotigny
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2022-12-15 19:05 UTC (permalink / raw)
  To: David Decotigny, David Ahern
  Cc: Mahesh Bandewar (महेश
	बंडेवार),
	David Decotigny, David S. Miller, Eric Dumazet, Paolo Abeni,
	netdev, linux-kernel, Nikolay Aleksandrov, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

On Wed, 14 Dec 2022 22:18:04 -0800 David Decotigny wrote:
> I don't think this patch is changing that part of the behavior: we still
> flush the cached nd entries when the link flaps. What we don't remove are
> the pneigh_entry-es (ip neigh add proxy ...) attached to the device where
> the link flaps: those are configured once and this patch ensures that they
> survive the link flaps as long as the netdev stays admin-up. When
> the netdev is brought admin-down, we keep the behavior we had before the
> patch.

Makes sense. This is not urgent, tho, right?

David A, do you agree and should we treat this as a fix with

Fixes: 859bd2ef1fc1 ("net: Evict neighbor entries on carrier down")

added?

Reminder: please bottom post on the list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
  2022-12-15 19:05       ` Jakub Kicinski
@ 2022-12-15 20:36         ` David Decotigny
  2022-12-15 21:16           ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: David Decotigny @ 2022-12-15 20:36 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: David Ahern,
	Mahesh Bandewar (महेश
	बंडेवार),
	David Decotigny, David S. Miller, Eric Dumazet, Paolo Abeni,
	netdev, linux-kernel, Nikolay Aleksandrov, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

(answer below)

On Thu, Dec 15, 2022 at 11:05 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 14 Dec 2022 22:18:04 -0800 David Decotigny wrote:
> > I don't think this patch is changing that part of the behavior: we still
> > flush the cached nd entries when the link flaps. What we don't remove are
> > the pneigh_entry-es (ip neigh add proxy ...) attached to the device where
> > the link flaps: those are configured once and this patch ensures that they
> > survive the link flaps as long as the netdev stays admin-up. When
> > the netdev is brought admin-down, we keep the behavior we had before the
> > patch.
>
> Makes sense. This is not urgent, tho, right?

Not that kind of urgent.

FTR, in the v2 you suggested to use NUD_PERMANENT, I can try to see
how this would look like. Note that this will make the patch larger
and more intrusive, and with potentially a behavior change for whoever
uses the netlink API directly instead of the iproute2 implementation
for ip neigh X proxy things.

>
> David A, do you agree and should we treat this as a fix with
>
> Fixes: 859bd2ef1fc1 ("net: Evict neighbor entries on carrier down")

Thanks.

>
> added?
>
> Reminder: please bottom post on the list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
  2022-12-15 20:36         ` David Decotigny
@ 2022-12-15 21:16           ` Jakub Kicinski
  2022-12-15 23:14             ` David Ahern
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2022-12-15 21:16 UTC (permalink / raw)
  To: David Decotigny
  Cc: David Ahern,
	Mahesh Bandewar (महेश
	बंडेवार) ,
	David Decotigny, David S. Miller, Eric Dumazet, Paolo Abeni,
	netdev, linux-kernel, Nikolay Aleksandrov, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

On Thu, 15 Dec 2022 12:36:32 -0800 David Decotigny wrote:
> > Makes sense. This is not urgent, tho, right?  
> 
> Not that kind of urgent.
> 
> FTR, in the v2 you suggested to use NUD_PERMANENT,

I think that was Alex. I don't have a strong preference. I could see
arguments being made in both directions (basically whether it's more
important to leave objects which are clearly not cache vs we care 
more about consistent behavior based on the permanent flag itself).

Let's limit the reposts until experts are in town ;)

>  I can try to see how this would look like. Note that this will make
> the patch larger and more intrusive, and with potentially a behavior
> change for whoever uses the netlink API directly instead of the
> iproute2 implementation for ip neigh X proxy things.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
  2022-12-15 21:16           ` Jakub Kicinski
@ 2022-12-15 23:14             ` David Ahern
  0 siblings, 0 replies; 7+ messages in thread
From: David Ahern @ 2022-12-15 23:14 UTC (permalink / raw)
  To: Jakub Kicinski, David Decotigny
  Cc: Mahesh Bandewar (महेश
	बंडेवार),
	David Decotigny, David S. Miller, Eric Dumazet, Paolo Abeni,
	netdev, linux-kernel, Nikolay Aleksandrov, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

On 12/15/22 2:16 PM, Jakub Kicinski wrote:
> On Thu, 15 Dec 2022 12:36:32 -0800 David Decotigny wrote:
>>> Makes sense. This is not urgent, tho, right?  
>>
>> Not that kind of urgent.
>>
>> FTR, in the v2 you suggested to use NUD_PERMANENT,
> 
> I think that was Alex. I don't have a strong preference. I could see
> arguments being made in both directions (basically whether it's more
> important to leave objects which are clearly not cache vs we care 
> more about consistent behavior based on the permanent flag itself).
> 
> Let's limit the reposts until experts are in town ;)
> 
>>  I can try to see how this would look like. Note that this will make
>> the patch larger and more intrusive, and with potentially a behavior
>> change for whoever uses the netlink API directly instead of the
>> iproute2 implementation for ip neigh X proxy things.

My thinking is inline with Alex's comment on v2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-15 23:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  7:38 [PATCH v1 1/1] net: neigh: persist proxy config across link flaps David Decotigny
2022-12-15  4:48 ` Jakub Kicinski
2022-12-15  5:34   ` Mahesh Bandewar (महेश बंडेवार)
     [not found]     ` <CAG88wWbZ3eXCFJBZ8mrfvddKiVihF-GfEOYAOmT_7VX_AeOoqQ@mail.gmail.com>
2022-12-15 19:05       ` Jakub Kicinski
2022-12-15 20:36         ` David Decotigny
2022-12-15 21:16           ` Jakub Kicinski
2022-12-15 23:14             ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.