public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, edumazet@google.com, pabeni@redhat.com,
	andrew+netdev@lunn.ch, horms@kernel.org,
	willemdebruijn.kernel@gmail.com, daniel.zahka@gmail.com,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 2/3] psp: add a comment about a psp_dev add netlink notification
Date: Tue, 28 Apr 2026 13:53:51 -0700	[thread overview]
Message-ID: <20260428205352.1247325-3-kuba@kernel.org> (raw)
In-Reply-To: <20260428205352.1247325-1-kuba@kernel.org>

In psp_dev_create(), the DEV_ADD_NTF netlink notification is sent
before the device is published to the netdev via rcu_assign_pointer().
IIRC this is intentional because a single PSP device is expected
to be shared with multiple netdevs. So we are trying to default to
not having the netdev info. We can change it if someone complains
but for now just add a comment that it's intentional.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 net/psp/psp_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
index 652ec8a9c8a4..f069117c867a 100644
--- a/net/psp/psp_main.c
+++ b/net/psp/psp_main.c
@@ -90,6 +90,10 @@ psp_dev_create(struct net_device *netdev,
 	mutex_lock(&psd->lock);
 	mutex_unlock(&psp_devs_lock);
 
+	/* notify before netdev assignment
+	 * There's no strong reason for it, but thinking is to avoid creating
+	 * implicit expectations about the PSP dev <> netdev relationship.
+	 */
 	psp_nl_notify_dev(psd, PSP_CMD_DEV_ADD_NTF);
 
 	rcu_assign_pointer(netdev->psp_dev, psd);
-- 
2.54.0


  parent reply	other threads:[~2026-04-28 20:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 20:53 [PATCH net-next 0/3] net: psp: add more validation Jakub Kicinski
2026-04-28 20:53 ` [PATCH net-next 1/3] psp: validate protocol before mutating skb in psp_dev_encapsulate() Jakub Kicinski
2026-04-29  0:12   ` Eric Dumazet
2026-04-29  2:47   ` Willem de Bruijn
2026-04-28 20:53 ` Jakub Kicinski [this message]
2026-04-29  2:48   ` [PATCH net-next 2/3] psp: add a comment about a psp_dev add netlink notification Willem de Bruijn
2026-04-28 20:53 ` [PATCH net-next 3/3] psp: validate IPv4 header fields in psp_dev_rcv() Jakub Kicinski
2026-04-29  0:14   ` Eric Dumazet
2026-04-29  0:22   ` Willem de Bruijn
2026-04-29  1:43     ` Jakub Kicinski
2026-04-29  2:42       ` Willem de Bruijn
2026-04-30  0:40 ` [PATCH net-next 0/3] net: psp: add more validation patchwork-bot+netdevbpf

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=20260428205352.1247325-3-kuba@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel.zahka@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.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