public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, pabeni@redhat.com,
	edumazet@google.com, andrew+netdev@lunn.ch, horms@kernel.org,
	petrm@nvidia.com
Subject: Re: [PATCH net-next 1/3] net: Do not unconditionally turn on carrier when clearing protodown
Date: Sun, 3 May 2026 21:08:03 +0300	[thread overview]
Message-ID: <20260503180803.GA269092@shredder> (raw)
In-Reply-To: <20260501180843.069635aa@kernel.org>

On Fri, May 01, 2026 at 06:08:43PM -0700, Jakub Kicinski wrote:
> On Wed, 29 Apr 2026 15:46:22 +0300 Ido Schimmel wrote:
> > Solve this by adding a new NDO that allows different drivers to react
> > differently to protodown being cleared. Change the core to invoke the
> > NDO and implement it for vxlan and macvlan. Maintain the current
> > behavior for the former, but for macvlan implement the NDO by
> > transferring the operational state from its lower device.
> 
> Maybe just me but an NDO for this seems like an overkill.
> Isn't our range of options for the callback either follow
> lower or carrier on? Do you expect more complex logic?

Thanks for reviewing. I don't expect more complex logic, but resolving
the linked device via the driver is more straightforward (unless I'm
missing something).

There are drivers that only implement ndo_get_iflink(), but don't
implement get_link_net(), so it's unclear in which netns we need to look
up the device using the ifindex we got from ndo_get_iflink(). Netdevsim
is one example. There are also some drivers that only implement
get_link_net() such as vxlan.

The popular drivers such as vlan, macvlan and veth obviously implement
both.

I added a helper [1] that resolves the linked device if these operations
are present and otherwise returns the device itself. Similar to
dev_get_iflink() which only gives us the ifindex.

Another option is to add a new NDO that gives us a pointer to the linked
device.

[1] https://github.com/idosch/linux/commit/34c57bceb1a7e52da0f973914f8a4dd08b7f9072.patch

  reply	other threads:[~2026-05-03 18:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 12:46 [PATCH net-next 0/3] net: Fix protodown with macvlan Ido Schimmel
2026-04-29 12:46 ` [PATCH net-next 1/3] net: Do not unconditionally turn on carrier when clearing protodown Ido Schimmel
2026-05-02  1:08   ` Jakub Kicinski
2026-05-03 18:08     ` Ido Schimmel [this message]
2026-05-05  0:55       ` Jakub Kicinski
2026-04-29 12:46 ` [PATCH net-next 2/3] macvlan: Do not transfer operational state when protodown is enabled Ido Schimmel
2026-05-02  1:09   ` Jakub Kicinski
2026-05-03 18:19     ` Ido Schimmel
2026-05-05  0:57       ` Jakub Kicinski
2026-04-29 12:46 ` [PATCH net-next 3/3] selftests: net: Add protodown tests Ido Schimmel

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=20260503180803.GA269092@shredder \
    --to=idosch@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.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