From: Daniel Zahka <daniel.zahka@gmail.com>
To: Wei Wang <weibunny.kernel@gmail.com>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
David Wei <dw@davidwei.uk>, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Simon Horman <horms@kernel.org>
Cc: Wei Wang <weibunny@fb.com>
Subject: Re: [PATCH v9 net-next 2/5] psp: add new netlink cmd for dev-assoc and dev-disassoc
Date: Tue, 31 Mar 2026 09:03:33 -0400 [thread overview]
Message-ID: <a9c76822-cca7-4108-9395-4af6a4ff1eca@gmail.com> (raw)
In-Reply-To: <20260330223143.2394706-3-weibunny.kernel@gmail.com>
On 3/30/26 6:31 PM, Wei Wang wrote:
> + -
> + name: dev-assoc
> + doc: Associate a network device with a PSP device.
> + attribute-set: dev
> + do:
> + request:
> + attributes:
> + - id
> + - ifindex
> + - nsid
> + reply:
> + attributes: []
> + pre: psp-device-get-locked
> + post: psp-device-unlock
> + -
> + name: dev-disassoc
> + doc: Disassociate a network device from a PSP device.
> + attribute-set: dev
> + do:
> + request:
> + attributes:
> + - id
> + - ifindex
> + - nsid
> + reply:
> + attributes: []
> + pre: psp-device-get-locked
> + post: psp-device-unlock
>
Not sure where we ended up on the netns isolation model, but I'll just
note that these ops are not "admin" so they can be done from any netns.
I don't think that's an issue per se, but I wonder if someone with a
different use case will come along down the road and want to go for the
more restrictive deployment option.
>
> + list_for_each_entry_safe(entry, entry_tmp, &psd->assoc_dev_list,
> + dev_list) {
> + list_del(&entry->dev_list);
> + rcu_assign_pointer(entry->assoc_dev->psp_dev, NULL);
> + netdev_put(entry->assoc_dev, &entry->dev_tracker);
> + kfree(entry);
> + }
> +
> rcu_assign_pointer(psd->main_netdev->psp_dev, NULL);
>
> psd->ops = NULL;
> @@ -361,5 +381,4 @@ static int __init psp_init(void)
>
> return genl_register_family(&psp_nl_family);
> }
> -
> subsys_initcall(psp_init);
nit: spurious line deletion
> +int psp_nl_dev_assoc_doit(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct psp_dev *psd = info->user_ptr[0];
> + struct psp_assoc_dev *psp_assoc_dev;
> + struct net_device *assoc_dev;
> + u32 assoc_ifindex;
> + struct sk_buff *rsp;
nit: reverse xmas issue
> +
> +int psp_nl_dev_disassoc_doit(struct sk_buff *skb, struct genl_info *info)
> +{
> + struct psp_assoc_dev *entry, *found = NULL;
> + struct psp_dev *psd = info->user_ptr[0];
> + u32 assoc_ifindex;
> + struct sk_buff *rsp;
nit: reverse xmas issue
next prev parent reply other threads:[~2026-03-31 13:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 22:31 [PATCH v9 net-next 0/5] psp: Add support for dev-assoc/disassoc Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 1/5] psp: add admin/non-admin version of psp_device_get_locked Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 2/5] psp: add new netlink cmd for dev-assoc and dev-disassoc Wei Wang
2026-03-31 13:03 ` Daniel Zahka [this message]
2026-03-31 21:48 ` Wei Wang
2026-03-31 23:43 ` kernel test robot
2026-03-30 22:31 ` [PATCH v9 net-next 3/5] psp: add a new netdev event for dev unregister Wei Wang
2026-03-31 13:30 ` Daniel Zahka
2026-03-31 21:51 ` Wei Wang
2026-04-01 13:02 ` Daniel Zahka
2026-04-01 21:39 ` Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 4/5] selftests/net: Add bpf skb forwarding program Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 5/5] selftest/net: psp: Add test for dev-assoc/disassoc Wei Wang
2026-03-31 14:04 ` Daniel Zahka
2026-03-31 22:09 ` Wei Wang
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=a9c76822-cca7-4108-9395-4af6a4ff1eca@gmail.com \
--to=daniel.zahka@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=weibunny.kernel@gmail.com \
--cc=weibunny@fb.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