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>
Cc: Wei Wang <weibunny@fb.com>
Subject: Re: [PATCH v3 net-next 2/5] psp: add new netlink cmd for dev-assoc and dev-disassoc
Date: Tue, 10 Mar 2026 10:25:42 -0400 [thread overview]
Message-ID: <f316780b-141f-4a91-b517-71034a02aef7@gmail.com> (raw)
In-Reply-To: <20260309183454.2872967-3-weibunny.kernel@gmail.com>
On 3/9/26 2:34 PM, Wei Wang wrote:
> +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;
> + struct net *net;
> + int nsid;
> +
> + if (GENL_REQ_ATTR_CHECK(info, PSP_A_DEV_IFINDEX) ||
> + GENL_REQ_ATTR_CHECK(info, PSP_A_DEV_NSID))
> + return -EINVAL;
> +
> + nsid = nla_get_s32(info->attrs[PSP_A_DEV_NSID]);
> + net = get_net_ns_by_id(genl_info_net(info), nsid);
> + if (!net) {
> + NL_SET_BAD_ATTR(info->extack, info->attrs[PSP_A_DEV_NSID]);
> + return -EINVAL;
> + }
hmm, well I guess I still have the same comment from v2. If assoc_dev is
in the same netns as genl_info_net(info), then userspace would need to
create a self-referencing nsid to link them together. It might be a
better uapi to change PSP_A_DEV_NSID to an optional attribute, and if
not present then look for PSP_A_DEV_IFINDEX inside of genl_info_net(info).
next prev parent reply other threads:[~2026-03-10 14:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 18:34 [PATCH v3 net-next 0/5] psp: Add support for dev-assoc/disassoc Wei Wang
2026-03-09 18:34 ` [PATCH v3 net-next 1/5] psp: add admin/non-admin version of psp_device_get_locked Wei Wang
2026-03-09 18:34 ` [PATCH v3 net-next 2/5] psp: add new netlink cmd for dev-assoc and dev-disassoc Wei Wang
2026-03-10 2:26 ` Bobby Eshleman
2026-03-10 16:38 ` Wei Wang
2026-03-10 14:25 ` Daniel Zahka [this message]
2026-03-10 17:03 ` Wei Wang
2026-03-10 15:08 ` Daniel Zahka
2026-03-10 19:42 ` Wei Wang
2026-03-09 18:34 ` [PATCH v3 net-next 3/5] psp: add a new netdev event for dev unregister Wei Wang
2026-03-10 0:37 ` Willem de Bruijn
2026-03-10 20:45 ` Wei Wang
2026-03-09 18:34 ` [PATCH v3 net-next 4/5] selftests/net: Add bpf skb forwarding program Wei Wang
2026-03-09 18:34 ` [PATCH v3 net-next 5/5] selftest/net: psp: Add test for dev-assoc/disassoc Wei Wang
2026-03-09 23:38 ` Jakub Kicinski
2026-03-10 20:46 ` 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=f316780b-141f-4a91-b517-71034a02aef7@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=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 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.