All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicolas Escande" <nico.escande@gmail.com>
To: "Paolo Abeni" <pabeni@redhat.com>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>
Cc: <netdev@vger.kernel.org>, <decot+git@google.com>
Subject: Re: [PATCH net-next] neighbour: add support for NUD_PERMANENT proxy entries
Date: Tue, 17 Jun 2025 15:42:42 +0200	[thread overview]
Message-ID: <DAOUOYHC2G4F.2SOAYIUMZV3QY@gmail.com> (raw)
In-Reply-To: <df6b49bd-0faf-4c5c-a900-459e76f40536@redhat.com>

On Tue Jun 17, 2025 at 3:25 PM CEST, Paolo Abeni wrote:
> On 6/13/25 3:46 PM, Nicolas Escande wrote:
>> As discussesd in [0] proxy entries (which are more configuration than
>> runtime data) should stay when the link goes does down (carrier wise).
>> This is what happens for regular neighbour entries added manually.
>> 
>> So lets fix this by:
>>   - storing in the proxy entries the mdn_state (only NUD_PERMANENT for now)
>>   - not removing NUD_PERMANENT proxy entries on carrier down by adding a
>>     skip_perm arg to pneigh_ifdown_and_unlock() (same as how it's done in
>>     neigh_flush_dev() for regular non-proxy entries)
>> 
>> Link: https://lore.kernel.org/netdev/c584ef7e-6897-01f3-5b80-12b53f7b4bf4@kernel.org/ [0]
>> Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
>> ---
>>  include/net/neighbour.h |  1 +
>>  net/core/neighbour.c    | 13 ++++++++++---
>>  2 files changed, 11 insertions(+), 3 deletions(-)
>> 
>> diff --git a/include/net/neighbour.h b/include/net/neighbour.h
>> index 9a832cab5b1d..d1e05b39cbb1 100644
>> --- a/include/net/neighbour.h
>> +++ b/include/net/neighbour.h
>> @@ -182,6 +182,7 @@ struct pneigh_entry {
>>  	netdevice_tracker	dev_tracker;
>>  	u32			flags;
>>  	u8			protocol;
>> +	u8			state;
>
> I think it's better to be consistent: either store the full state (u16,
> without masking) or a `permanent` boolean alike: !!(ndm->ndm_state &
> NUD_PERMANENT).

Sure I'll spin a v2 with a 'permanent' boolean then.

>
> The current choice could confuse who is going to touch this code in the
> future.
>
> Thanks,
>
> Paolo

Thanks for the review,

Nico

      reply	other threads:[~2025-06-17 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-13 13:46 [PATCH net-next] neighbour: add support for NUD_PERMANENT proxy entries Nicolas Escande
2025-06-17 13:25 ` Paolo Abeni
2025-06-17 13:42   ` Nicolas Escande [this message]

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=DAOUOYHC2G4F.2SOAYIUMZV3QY@gmail.com \
    --to=nico.escande@gmail.com \
    --cc=davem@davemloft.net \
    --cc=decot+git@google.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 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.