linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sabrina Dubroca <sd@queasysnail.net>
To: Antonio Quartulli <antonio@openvpn.net>
Cc: Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Donald Hunter <donald.hunter@gmail.com>,
	Shuah Khan <shuah@kernel.org>,
	ryazanov.s.a@gmail.com, Andrew Lunn <andrew+netdev@lunn.ch>,
	Simon Horman <horms@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Xiao Liang <shaw.leon@gmail.com>,
	steffen.klassert@secunet.com, antony.antony@secunet.com
Subject: Re: [PATCH net-next v25 01/23] net: introduce OpenVPN Data Channel Offload (ovpn)
Date: Fri, 11 Apr 2025 15:50:49 +0200	[thread overview]
Message-ID: <Z_keORW4OWc8i5Vz@krikkit> (raw)
In-Reply-To: <f11e8a14-deb0-456f-bb4a-b5e4e16a79d7@openvpn.net>

2025-04-11, 10:04:10 +0200, Antonio Quartulli wrote:
> Hi Jakub,
> 
> thanks for taking the time to go through my patchset :)
> 
> On 11/04/2025 04:54, Jakub Kicinski wrote:
> > On Mon, 07 Apr 2025 21:46:09 +0200 Antonio Quartulli wrote:
> > > +static int ovpn_netdev_notifier_call(struct notifier_block *nb,
> > > +				     unsigned long state, void *ptr)
> > > +{
> > > +	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> > > +
> > > +	if (!ovpn_dev_is_valid(dev))
> > > +		return NOTIFY_DONE;
> > > +
> > > +	switch (state) {
> > > +	case NETDEV_REGISTER:
> > > +		/* add device to internal list for later destruction upon
> > > +		 * unregistration
> > > +		 */
> > > +		break;
> > > +	case NETDEV_UNREGISTER:
> > > +		/* can be delivered multiple times, so check registered flag,
> > > +		 * then destroy the interface
> > > +		 */
> > > +		break;
> > > +	case NETDEV_POST_INIT:
> > > +	case NETDEV_GOING_DOWN:
> > > +	case NETDEV_DOWN:
> > > +	case NETDEV_UP:
> > > +	case NETDEV_PRE_UP:
> > > +	default:
> > > +		return NOTIFY_DONE;
> > > +	}
> > 
> > Why are you using a notifier to get events for your own device?
> 
> My understanding is that this is the standard approach to:
> 1) hook in the middle of registration/deregistration;
> 2) handle events generated by other components/routines.
> 
> I see in /drivers/net/ almost every driver registers a notifier for their
> own device.

I think most of them register a notifier for their lower device
(bridge port, real device under a vlan, or similar).

I've mentioned at some point that it would be more usual to replace
this notifier with a custom dellink, and that ovpn->registered could
likely be replaced with checking for NETREG_REGISTERED. I just thought
it could be cleaned up a bit later, but it seems Jakub wants it done
before taking the patches :)

-- 
Sabrina

  reply	other threads:[~2025-04-11 13:50 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 19:46 [PATCH net-next v25 00/23] Introducing OpenVPN Data Channel Offload Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 01/23] net: introduce OpenVPN Data Channel Offload (ovpn) Antonio Quartulli
2025-04-10 17:51   ` ALOK TIWARI
2025-04-11  8:47     ` Antonio Quartulli
2025-04-11  2:54   ` Jakub Kicinski
2025-04-11  8:04     ` Antonio Quartulli
2025-04-11 13:50       ` Sabrina Dubroca [this message]
2025-04-11 21:18         ` Jakub Kicinski
2025-04-14 13:39           ` Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 02/23] ovpn: add basic netlink support Antonio Quartulli
2025-04-10 18:26   ` ALOK TIWARI
2025-04-11  2:58   ` Jakub Kicinski
2025-04-11  8:06     ` Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 03/23] ovpn: add basic interface creation/destruction/management routines Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 04/23] ovpn: keep carrier always on for MP interfaces Antonio Quartulli
2025-04-11  3:03   ` Jakub Kicinski
2025-04-11  8:38     ` Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 05/23] ovpn: introduce the ovpn_peer object Antonio Quartulli
2025-04-10 18:49   ` ALOK TIWARI
2025-04-07 19:46 ` [PATCH net-next v25 06/23] ovpn: introduce the ovpn_socket object Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 07/23] ovpn: implement basic TX path (UDP) Antonio Quartulli
2025-04-11  3:07   ` Jakub Kicinski
2025-04-11  8:46     ` Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 08/23] ovpn: implement basic RX " Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 09/23] ovpn: implement packet processing Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 10/23] ovpn: store tunnel and transport statistics Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 11/23] ovpn: implement TCP transport Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 12/23] skb: implement skb_send_sock_locked_with_flags() Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 13/23] ovpn: add support for MSG_NOSIGNAL in tcp_sendmsg Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 14/23] ovpn: implement multi-peer support Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 15/23] ovpn: implement peer lookup logic Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 16/23] ovpn: implement keepalive mechanism Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 17/23] ovpn: add support for updating local or remote UDP endpoint Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 18/23] ovpn: implement peer add/get/dump/delete via netlink Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 19/23] ovpn: implement key add/get/del/swap " Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 20/23] ovpn: kill key and notify userspace in case of IV exhaustion Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 21/23] ovpn: notify userspace when a peer is deleted Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 22/23] ovpn: add basic ethtool support Antonio Quartulli
2025-04-07 19:46 ` [PATCH net-next v25 23/23] testing/selftests: add test tool and scripts for ovpn module Antonio Quartulli
2025-04-08  6:34 ` [PATCH net-next v25 00/23] Introducing OpenVPN Data Channel Offload Jiri Slaby
2025-04-08  7:37   ` Antonio Quartulli
2025-04-10 14:03 ` Sabrina Dubroca
2025-04-10 14:16   ` Antonio Quartulli

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=Z_keORW4OWc8i5Vz@krikkit \
    --to=sd@queasysnail.net \
    --cc=andrew+netdev@lunn.ch \
    --cc=antonio@openvpn.net \
    --cc=antony.antony@secunet.com \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=shaw.leon@gmail.com \
    --cc=shuah@kernel.org \
    --cc=steffen.klassert@secunet.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).