* [net-next, v2 0/2] psp: Support PSP Tx on logical devices like VLAN
@ 2026-02-23 19:11 Kiran Kella
2026-02-23 19:11 ` [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP Kiran Kella
2026-02-23 19:11 ` [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface Kiran Kella
0 siblings, 2 replies; 11+ messages in thread
From: Kiran Kella @ 2026-02-23 19:11 UTC (permalink / raw)
To: davem, edumazet, kuba, daniel.zahka, willemb, pabeni,
andrew+netdev, horms
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni, Kiran Kella
This patch adds support to allow transmit if the bottom most underlying
transport device matches the PSP device associated with the
transmitting application socket.
python ./psp.py
TAP version 13
1..29
ok 1 psp.data_basic_send_v0_ip4
ok 2 psp.data_basic_send_v0_ip6
ok 3 psp.data_basic_send_v1_ip4
ok 4 psp.data_basic_send_v1_ip6
ok 5 psp.data_basic_send_v2_ip4
ok 6 psp.data_basic_send_v2_ip6
ok 7 psp.data_basic_send_v3_ip4
ok 8 psp.data_basic_send_v3_ip6
ok 9 psp.data_mss_adjust_ip4
ok 10 psp.data_mss_adjust_ip6
ok 11 psp.dev_list_devices
ok 12 psp.dev_get_device
ok 13 psp.dev_get_device_bad
ok 14 psp.dev_rotate
ok 15 psp.dev_rotate_spi
ok 16 psp.assoc_basic
ok 17 psp.assoc_bad_dev
ok 18 psp.assoc_sk_only_conn
ok 19 psp.assoc_sk_only_mismatch
ok 20 psp.assoc_sk_only_mismatch_tx
ok 21 psp.assoc_sk_only_unconn
ok 22 psp.assoc_version_mismatch
ok 23 psp.assoc_twice
ok 24 psp.data_send_bad_key
ok 25 psp.data_send_disconnect
ok 26 psp.data_stale_key
ok 27 psp.removal_device_rx
ok 28 psp.removal_device_bi
ok 29 psp.vlan_basic_send
# Totals: pass:29 fail:0 xfail:0 xpass:0 skip:0 error:0
#
# Responder logs (0):
# STDERR:
# # Set PSP enable on device 3 to 0xf
# # Set PSP enable on device 3 to 0x0
CHANGES:
v2:
- Simplified the psp_netdevice_event() to return if the upper device is
bond device.
- Handle the scenario where the psp_dev_unregister() is invoked by a
driver before the unregister_netdev() that can result in stale
psp_dev pointer in the upper devices.
- Fix the vlan_basic_send test to run on any lower device and not
require nsim.
v1: https://lore.kernel.org/all/20260121073517.3323332-1-kiran.kella@broadcom.com/
Kiran Kella (2):
psp: Support for transmit on logical device when the underlying
transport device supports PSP.
selftests: drv-net: psp: add test for VLAN sub-interface
net/psp/psp_main.c | 109 ++++++++++++++++++++-
tools/testing/selftests/drivers/net/psp.py | 86 +++++++++++++++-
2 files changed, 193 insertions(+), 2 deletions(-)
--
2.45.4
^ permalink raw reply [flat|nested] 11+ messages in thread
* [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-23 19:11 [net-next, v2 0/2] psp: Support PSP Tx on logical devices like VLAN Kiran Kella
@ 2026-02-23 19:11 ` Kiran Kella
2026-02-24 20:58 ` Daniel Zahka
2026-02-23 19:11 ` [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface Kiran Kella
1 sibling, 1 reply; 11+ messages in thread
From: Kiran Kella @ 2026-02-23 19:11 UTC (permalink / raw)
To: davem, edumazet, kuba, daniel.zahka, willemb, pabeni,
andrew+netdev, horms
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni, Kiran Kella
This is achieved by propagating the psp_dev from the lower device
to the upper devices in the device stack via a netdevice notifier.
The lowest device owns the psp_dev pointer while the upper devices
just borrow the pointer. When the lower device is unlinked, the
borrowed pointer is cleared in the upper device.
Assumption being that psp_dev is set on the lowest device before
any upper devices are stacked on that lowest device.
Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
---
net/psp/psp_main.c | 109 ++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 108 insertions(+), 1 deletion(-)
diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
index a8534124f626..fac785dcfa0f 100644
--- a/net/psp/psp_main.c
+++ b/net/psp/psp_main.c
@@ -3,6 +3,7 @@
#include <linux/bitfield.h>
#include <linux/list.h>
#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
#include <linux/xarray.h>
#include <net/net_namespace.h>
#include <net/psp.h>
@@ -110,13 +111,45 @@ void psp_dev_free(struct psp_dev *psd)
kfree_rcu(psd, rcu);
}
+/**
+ * psp_clear_upper_dev_psp_dev() - Clear borrowed psp_dev pointer on upper
+ * device
+ * @upper_dev: Upper device that may have borrowed psp_dev pointer
+ * @priv: netdev_nested_priv containing the psp_dev being unregistered
+ *
+ * Callback for netdev_walk_all_upper_dev_rcu() to clear borrowed psp_dev
+ * pointers on upper devices when the underlying psp_dev is being unregistered.
+ *
+ * Return: 0 to continue walking, non-zero to stop.
+ */
+static int psp_clear_upper_dev_psp_dev(struct net_device *upper_dev,
+ struct netdev_nested_priv *priv)
+{
+ struct psp_dev *psd = priv->data;
+ struct psp_dev *upper_psd;
+
+ upper_psd = rcu_dereference(upper_dev->psp_dev);
+ if (upper_psd == psd)
+ rcu_assign_pointer(upper_dev->psp_dev, NULL);
+
+ return 0;
+}
+
/**
* psp_dev_unregister() - unregister PSP device
* @psd: PSP device structure
+ *
+ * Unregisters a PSP device and clears all borrowed psp_dev pointers on
+ * upper devices (e.g., VLAN subinterfaces) that reference this device.
+ * This prevents use-after-free if upper devices still have borrowed
+ * pointers when the psp_dev structure is freed.
*/
void psp_dev_unregister(struct psp_dev *psd)
{
struct psp_assoc *pas, *next;
+ struct netdev_nested_priv priv = {
+ .data = psd,
+ };
mutex_lock(&psp_devs_lock);
mutex_lock(&psd->lock);
@@ -137,6 +170,12 @@ void psp_dev_unregister(struct psp_dev *psd)
rcu_assign_pointer(psd->main_netdev->psp_dev, NULL);
+ /* Clear borrowed psp_dev pointers on all upper devices */
+ rcu_read_lock();
+ netdev_walk_all_upper_dev_rcu(psd->main_netdev,
+ psp_clear_upper_dev_psp_dev, &priv);
+ rcu_read_unlock();
+
psd->ops = NULL;
psd->drv_priv = NULL;
@@ -313,11 +352,79 @@ int psp_dev_rcv(struct sk_buff *skb, u16 dev_id, u8 generation, bool strip_icv)
}
EXPORT_SYMBOL(psp_dev_rcv);
+/**
+ * psp_netdevice_event() - Handle netdevice events for PSP device propagation
+ * @nb: notifier block
+ * @event: netdevice event
+ * @ptr: netdevice notifier info
+ *
+ * Propagates psp_dev pointer from lower devices to upper devices when
+ * upper devices are created (e.g., VLAN subinterfaces).
+ * Excluding from this logic, the upper devices that have multiple lower
+ * devices eg., bond devices.
+ *
+ * Return: NOTIFY_DONE
+ */
+static int psp_netdevice_event(struct notifier_block *nb,
+ unsigned long event, void *ptr)
+{
+ struct netdev_notifier_changeupper_info *info;
+ struct net_device *dev, *upper_dev;
+ struct psp_dev *psd;
+
+ if (event != NETDEV_CHANGEUPPER)
+ return NOTIFY_DONE;
+
+ info = ptr;
+ dev = netdev_notifier_info_to_dev(ptr);
+ upper_dev = info->upper_dev;
+
+ if (netif_is_lag_master(upper_dev))
+ return NOTIFY_DONE;
+
+ if (info->linking) {
+ /* Lower device is being linked to an upper device.
+ * Propagate psp_dev from the immediate lower device to the
+ * upper device. The immediate lower device would have already
+ * got the psp_dev pointer set in a previous notification (or
+ * owns it if it's the lowest device).
+ * Upper devices just borrow the pointer.
+ */
+ psd = rtnl_dereference(dev->psp_dev);
+ if (psd)
+ rcu_assign_pointer(upper_dev->psp_dev, psd);
+ } else {
+ /* Lower device is being unlinked from an upper device.
+ * Clear the borrowed psp_dev pointer.
+ */
+ psd = rtnl_dereference(upper_dev->psp_dev);
+ if (psd)
+ rcu_assign_pointer(upper_dev->psp_dev, NULL);
+ }
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block psp_netdevice_notifier = {
+ .notifier_call = psp_netdevice_event,
+};
+
static int __init psp_init(void)
{
+ int err;
+
mutex_init(&psp_devs_lock);
- return genl_register_family(&psp_nl_family);
+ err = register_netdevice_notifier(&psp_netdevice_notifier);
+ if (err)
+ return err;
+
+ err = genl_register_family(&psp_nl_family);
+ if (err) {
+ unregister_netdevice_notifier(&psp_netdevice_notifier);
+ return err;
+ }
+ return 0;
}
subsys_initcall(psp_init);
--
2.45.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface
2026-02-23 19:11 [net-next, v2 0/2] psp: Support PSP Tx on logical devices like VLAN Kiran Kella
2026-02-23 19:11 ` [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP Kiran Kella
@ 2026-02-23 19:11 ` Kiran Kella
2026-02-23 21:58 ` Jakub Kicinski
1 sibling, 1 reply; 11+ messages in thread
From: Kiran Kella @ 2026-02-23 19:11 UTC (permalink / raw)
To: davem, edumazet, kuba, daniel.zahka, willemb, pabeni,
andrew+netdev, horms
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni, Kiran Kella
Add test to validate that the psp device information is propagated
properly from the lower device to the upper devices so that
the PSP transmit validation passes.
Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
---
tools/testing/selftests/drivers/net/psp.py | 86 +++++++++++++++++++++-
1 file changed, 85 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
index 864d9fce1094..c45a04172844 100755
--- a/tools/testing/selftests/drivers/net/psp.py
+++ b/tools/testing/selftests/drivers/net/psp.py
@@ -18,6 +18,7 @@ from lib.py import KsftSkipEx
from lib.py import NetDrvEpEnv, PSPFamily, NlError
from lib.py import bkg, rand_port, wait_port_listen
+from lib.py import ip
def _get_outq(s):
one = b'\0' * 4
@@ -570,6 +571,89 @@ def removal_device_bi(cfg):
finally:
_close_conn(cfg, s)
+def vlan_basic_send(cfg):
+ """
+ Test PSP over VLAN-to-VLAN traffic
+
+ Network topology:
+ Local VLAN (nsim0.100) <---> Remote VLAN (nsim1.100)
+ | |
+ Local Physical (nsim0) <---> Remote Physical (nsim1)
+ [PSP configured here]
+ """
+ _init_psp_dev(cfg)
+
+ # VLAN configuration
+ vlan_id = 100
+ local_vlan_ifname = f"{cfg.ifname}.{vlan_id}"
+ remote_vlan_ifname = f"{cfg.remote_ifname}.{vlan_id}"
+
+ local_vlan_addr_v4 = "192.0.2.21"
+ remote_vlan_addr_v4 = "192.0.2.22"
+ local_vlan_addr_v6 = "2001:db8::21"
+ remote_vlan_addr_v6 = "2001:db8::22"
+
+ # Create VLAN interface on LOCAL side
+ ip(f"link add link {cfg.ifname} name {local_vlan_ifname} type vlan id {vlan_id}")
+ defer(ip, f"link del {local_vlan_ifname}")
+ ip(f"addr add {local_vlan_addr_v4}/24 dev {local_vlan_ifname}")
+ ip(f"-6 addr add {local_vlan_addr_v6}/64 dev {local_vlan_ifname} nodad")
+ ip(f"link set {local_vlan_ifname} up")
+
+ # Create VLAN interface on REMOTE side
+ ip(f"link add link {cfg.remote_ifname} name {remote_vlan_ifname} type vlan id {vlan_id}", host=cfg.remote)
+ defer(ip, f"link del {remote_vlan_ifname}", host=cfg.remote)
+ ip(f"addr add {remote_vlan_addr_v4}/24 dev {remote_vlan_ifname}", host=cfg.remote)
+ ip(f"-6 addr add {remote_vlan_addr_v6}/64 dev {remote_vlan_ifname} nodad", host=cfg.remote)
+ ip(f"link set {remote_vlan_ifname} up", host=cfg.remote)
+
+ # Get VLAN interface index
+ local_vlan_info = ip(f"-j link show {local_vlan_ifname}", json=True)[0]
+ local_vlan_ifindex = local_vlan_info['ifindex']
+
+ # Create a cfg-like object for VLAN interfaces
+ # The PSP device is still on the physical interface, but
+ # the socket will be bound to the VLAN interface
+ class VlanCfg:
+ pass
+
+ vlan_cfg = VlanCfg()
+ vlan_cfg.ifname = local_vlan_ifname
+ vlan_cfg.ifindex = local_vlan_ifindex
+ vlan_cfg.remote_ifname = remote_vlan_ifname
+ vlan_cfg.addr_v = {"4": local_vlan_addr_v4, "6": local_vlan_addr_v6}
+ vlan_cfg.remote_addr_v = {"4": remote_vlan_addr_v4, "6": remote_vlan_addr_v6}
+ vlan_cfg.addr = local_vlan_addr_v4
+ vlan_cfg.remote_addr = remote_vlan_addr_v4
+ vlan_cfg.pspnl = cfg.pspnl
+ vlan_cfg.psp_dev_id = cfg.psp_dev_id
+ vlan_cfg.remote = cfg.remote
+ vlan_cfg.comm_port = cfg.comm_port
+ vlan_cfg.comm_sock = cfg.comm_sock
+
+ s = _make_psp_conn(vlan_cfg, version=0)
+ defer(_close_psp_conn, vlan_cfg, s)
+
+ # Create PSP associations
+ # The socket's device is VLAN, but PSP device is on physical NIC
+ rx_assoc = vlan_cfg.pspnl.rx_assoc({
+ "version": 0,
+ "dev-id": vlan_cfg.psp_dev_id, # PSP device on physical interface
+ "sock-fd": s.fileno()
+ })
+ rx = rx_assoc['rx-key']
+ tx = _spi_xchg(s, rx)
+
+ vlan_cfg.pspnl.tx_assoc({
+ "dev-id": vlan_cfg.psp_dev_id,
+ "version": 0,
+ "tx-key": tx,
+ "sock-fd": s.fileno()
+ })
+
+ # Send data through VLAN interface (VLAN-to-VLAN traffic!)
+ data_len = _send_careful(vlan_cfg, s, 100)
+ _check_data_rx(vlan_cfg, data_len)
def psp_ip_ver_test_builder(name, test_func, psp_ver, ipver):
"""Build test cases for each combo of PSP version and IP version"""
@@ -624,7 +708,7 @@ def main() -> None:
]
ksft_run(cases=cases, globs=globals(),
- case_pfx={"dev_", "data_", "assoc_", "removal_"},
+ case_pfx={"dev_", "data_", "assoc_", "removal_", "vlan_"},
args=(cfg, ))
cfg.comm_sock.send(b"exit\0")
--
2.45.4
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface
2026-02-23 19:11 ` [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface Kiran Kella
@ 2026-02-23 21:58 ` Jakub Kicinski
2026-02-25 7:22 ` Kiran Kella
0 siblings, 1 reply; 11+ messages in thread
From: Jakub Kicinski @ 2026-02-23 21:58 UTC (permalink / raw)
To: Kiran Kella
Cc: davem, edumazet, daniel.zahka, willemb, pabeni, andrew+netdev,
horms, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, akhilesh.samineni
On Mon, 23 Feb 2026 11:11:54 -0800 Kiran Kella wrote:
> Add test to validate that the psp device information is propagated
> properly from the lower device to the upper devices so that
> the PSP transmit validation passes.
>
> Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
> Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
Looks like you need to enable VLAN in the respective config file in
ksft:
# ok 28 psp.removal_device_bi
# # Exception| Traceback (most recent call last):
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/ksft.py", line 338, in ksft_run
# # Exception| func(*args)
# # Exception| ~~~~^^^^^^^
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/drivers/net/./psp.py", line 597, in vlan_basic_send
# # Exception| ip(f"link add link {cfg.ifname} name {local_vlan_ifname} type vlan id {vlan_id}")
# # Exception| ~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 238, in ip
# # Exception| return tool('ip', args, json=json, host=host)
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 225, in tool
# # Exception| cmd_obj = cmd(cmd_str, ns=ns, host=host)
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 91, in __init__
# # Exception| self.process(terminate=False, fail=fail, timeout=timeout)
# # Exception| ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 117, in process
# # Exception| raise CmdExitFailure("Command failed", self)
# # Exception| net.lib.py.utils.CmdExitFailure: Command failed
# # Exception| CMD: ip link add link eni1972np1 name eni1972np1.100 type vlan id 100
# # Exception| EXIT: 2
# # Exception| STDERR: Error: Unknown device type.
--
pw-bot: cr
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-23 19:11 ` [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP Kiran Kella
@ 2026-02-24 20:58 ` Daniel Zahka
2026-02-26 11:38 ` Kiran Kella
2026-02-26 11:46 ` Kiran Kella
0 siblings, 2 replies; 11+ messages in thread
From: Daniel Zahka @ 2026-02-24 20:58 UTC (permalink / raw)
To: Kiran Kella, davem, edumazet, kuba, willemb, pabeni,
andrew+netdev, horms
Cc: netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni
On 2/23/26 2:11 PM, Kiran Kella wrote:
> This is achieved by propagating the psp_dev from the lower device
> to the upper devices in the device stack via a netdevice notifier.
> The lowest device owns the psp_dev pointer while the upper devices
> just borrow the pointer. When the lower device is unlinked, the
> borrowed pointer is cleared in the upper device.
> Assumption being that psp_dev is set on the lowest device before
> any upper devices are stacked on that lowest device.
>
> Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> ---
> net/psp/psp_main.c | 109 ++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 108 insertions(+), 1 deletion(-)
>
> diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
> index a8534124f626..fac785dcfa0f 100644
> --- a/net/psp/psp_main.c
> +++ b/net/psp/psp_main.c
> @@ -3,6 +3,7 @@
> #include <linux/bitfield.h>
> #include <linux/list.h>
> #include <linux/netdevice.h>
> +#include <linux/rtnetlink.h>
> #include <linux/xarray.h>
> #include <net/net_namespace.h>
> #include <net/psp.h>
> @@ -110,13 +111,45 @@ void psp_dev_free(struct psp_dev *psd)
> kfree_rcu(psd, rcu);
> }
>
> +/**
> + * psp_clear_upper_dev_psp_dev() - Clear borrowed psp_dev pointer on upper
> + * device
> + * @upper_dev: Upper device that may have borrowed psp_dev pointer
> + * @priv: netdev_nested_priv containing the psp_dev being unregistered
> + *
> + * Callback for netdev_walk_all_upper_dev_rcu() to clear borrowed psp_dev
> + * pointers on upper devices when the underlying psp_dev is being unregistered.
> + *
> + * Return: 0 to continue walking, non-zero to stop.
> + */
> +static int psp_clear_upper_dev_psp_dev(struct net_device *upper_dev,
> + struct netdev_nested_priv *priv)
> +{
> + struct psp_dev *psd = priv->data;
> + struct psp_dev *upper_psd;
> +
> + upper_psd = rcu_dereference(upper_dev->psp_dev);
> + if (upper_psd == psd)
> + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> +
> + return 0;
> +}
> +
> /**
> * psp_dev_unregister() - unregister PSP device
> * @psd: PSP device structure
> + *
> + * Unregisters a PSP device and clears all borrowed psp_dev pointers on
> + * upper devices (e.g., VLAN subinterfaces) that reference this device.
> + * This prevents use-after-free if upper devices still have borrowed
> + * pointers when the psp_dev structure is freed.
> */
> void psp_dev_unregister(struct psp_dev *psd)
> {
> struct psp_assoc *pas, *next;
> + struct netdev_nested_priv priv = {
> + .data = psd,
> + };
>
> mutex_lock(&psp_devs_lock);
> mutex_lock(&psd->lock);
> @@ -137,6 +170,12 @@ void psp_dev_unregister(struct psp_dev *psd)
>
> rcu_assign_pointer(psd->main_netdev->psp_dev, NULL);
>
> + /* Clear borrowed psp_dev pointers on all upper devices */
> + rcu_read_lock();
> + netdev_walk_all_upper_dev_rcu(psd->main_netdev,
> + psp_clear_upper_dev_psp_dev, &priv);
> + rcu_read_unlock();
> +
> psd->ops = NULL;
> psd->drv_priv = NULL;
>
> @@ -313,11 +352,79 @@ int psp_dev_rcv(struct sk_buff *skb, u16 dev_id, u8 generation, bool strip_icv)
> }
> EXPORT_SYMBOL(psp_dev_rcv);
>
> +/**
> + * psp_netdevice_event() - Handle netdevice events for PSP device propagation
> + * @nb: notifier block
> + * @event: netdevice event
> + * @ptr: netdevice notifier info
> + *
> + * Propagates psp_dev pointer from lower devices to upper devices when
> + * upper devices are created (e.g., VLAN subinterfaces).
> + * Excluding from this logic, the upper devices that have multiple lower
> + * devices eg., bond devices.
> + *
> + * Return: NOTIFY_DONE
> + */
> +static int psp_netdevice_event(struct notifier_block *nb,
> + unsigned long event, void *ptr)
> +{
> + struct netdev_notifier_changeupper_info *info;
> + struct net_device *dev, *upper_dev;
> + struct psp_dev *psd;
> +
> + if (event != NETDEV_CHANGEUPPER)
> + return NOTIFY_DONE;
> +
> + info = ptr;
> + dev = netdev_notifier_info_to_dev(ptr);
> + upper_dev = info->upper_dev;
> +
> + if (netif_is_lag_master(upper_dev))
> + return NOTIFY_DONE;
> +
> + if (info->linking) {
> + /* Lower device is being linked to an upper device.
> + * Propagate psp_dev from the immediate lower device to the
> + * upper device. The immediate lower device would have already
> + * got the psp_dev pointer set in a previous notification (or
> + * owns it if it's the lowest device).
> + * Upper devices just borrow the pointer.
> + */
> + psd = rtnl_dereference(dev->psp_dev);
> + if (psd)
> + rcu_assign_pointer(upper_dev->psp_dev, psd);
> + } else {
> + /* Lower device is being unlinked from an upper device.
> + * Clear the borrowed psp_dev pointer.
> + */
> + psd = rtnl_dereference(upper_dev->psp_dev);
> + if (psd)
> + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> + }
> +
> + return NOTIFY_DONE;
> +}
> +
> +static struct notifier_block psp_netdevice_notifier = {
> + .notifier_call = psp_netdevice_event,
> +};
> +
> static int __init psp_init(void)
> {
> + int err;
> +
> mutex_init(&psp_devs_lock);
>
> - return genl_register_family(&psp_nl_family);
> + err = register_netdevice_notifier(&psp_netdevice_notifier);
> + if (err)
> + return err;
> +
> + err = genl_register_family(&psp_nl_family);
> + if (err) {
> + unregister_netdevice_notifier(&psp_netdevice_notifier);
> + return err;
> + }
> + return 0;
> }
>
> subsys_initcall(psp_init);
The lack of support for netns is a bit of a gap for this feature. It may
make sense to see if what was posted in
https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
is sufficient for your use case, as it handles cases where upper devices
are in a different netns from psd->main_netdev.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface
2026-02-23 21:58 ` Jakub Kicinski
@ 2026-02-25 7:22 ` Kiran Kella
0 siblings, 0 replies; 11+ messages in thread
From: Kiran Kella @ 2026-02-25 7:22 UTC (permalink / raw)
To: Jakub Kicinski
Cc: davem, edumazet, daniel.zahka, willemb, pabeni, andrew+netdev,
horms, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, akhilesh.samineni
[-- Attachment #1: Type: text/plain, Size: 2308 bytes --]
On Tue, Feb 24, 2026 at 3:28 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Mon, 23 Feb 2026 11:11:54 -0800 Kiran Kella wrote:
> > Add test to validate that the psp device information is propagated
> > properly from the lower device to the upper devices so that
> > the PSP transmit validation passes.
> >
> > Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
> > Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
>
> Looks like you need to enable VLAN in the respective config file in
> ksft:
Thanks. Needs CONFIG_VLAN_8021Q=m entry in the net/config. Will update in v3.
>
> # ok 28 psp.removal_device_bi
> # # Exception| Traceback (most recent call last):
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/ksft.py", line 338, in ksft_run
> # # Exception| func(*args)
> # # Exception| ~~~~^^^^^^^
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/drivers/net/./psp.py", line 597, in vlan_basic_send
> # # Exception| ip(f"link add link {cfg.ifname} name {local_vlan_ifname} type vlan id {vlan_id}")
> # # Exception| ~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 238, in ip
> # # Exception| return tool('ip', args, json=json, host=host)
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 225, in tool
> # # Exception| cmd_obj = cmd(cmd_str, ns=ns, host=host)
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 91, in __init__
> # # Exception| self.process(terminate=False, fail=fail, timeout=timeout)
> # # Exception| ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> # # Exception| File "/srv/vmksft/testing/wt-17/tools/testing/selftests/net/lib/py/utils.py", line 117, in process
> # # Exception| raise CmdExitFailure("Command failed", self)
> # # Exception| net.lib.py.utils.CmdExitFailure: Command failed
> # # Exception| CMD: ip link add link eni1972np1 name eni1972np1.100 type vlan id 100
> # # Exception| EXIT: 2
> # # Exception| STDERR: Error: Unknown device type.
> --
> pw-bot: cr
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5465 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-24 20:58 ` Daniel Zahka
@ 2026-02-26 11:38 ` Kiran Kella
2026-02-26 11:46 ` Kiran Kella
1 sibling, 0 replies; 11+ messages in thread
From: Kiran Kella @ 2026-02-26 11:38 UTC (permalink / raw)
To: Daniel Zahka
Cc: davem, edumazet, kuba, willemb, pabeni, andrew+netdev, horms,
netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni
On Wed, Feb 25, 2026 at 2:28 AM Daniel Zahka <daniel.zahka@gmail.com> wrote:
>
>
>
> On 2/23/26 2:11 PM, Kiran Kella wrote:
> > This is achieved by propagating the psp_dev from the lower device
> > to the upper devices in the device stack via a netdevice notifier.
> > The lowest device owns the psp_dev pointer while the upper devices
> > just borrow the pointer. When the lower device is unlinked, the
> > borrowed pointer is cleared in the upper device.
> > Assumption being that psp_dev is set on the lowest device before
> > any upper devices are stacked on that lowest device.
> >
> > Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
> > Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> > Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> > ---
> > net/psp/psp_main.c | 109 ++++++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 108 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
> > index a8534124f626..fac785dcfa0f 100644
> > --- a/net/psp/psp_main.c
> > +++ b/net/psp/psp_main.c
> > @@ -3,6 +3,7 @@
> > #include <linux/bitfield.h>
> > #include <linux/list.h>
> > #include <linux/netdevice.h>
> > +#include <linux/rtnetlink.h>
> > #include <linux/xarray.h>
> > #include <net/net_namespace.h>
> > #include <net/psp.h>
> > @@ -110,13 +111,45 @@ void psp_dev_free(struct psp_dev *psd)
> > kfree_rcu(psd, rcu);
> > }
> >
> > +/**
> > + * psp_clear_upper_dev_psp_dev() - Clear borrowed psp_dev pointer on upper
> > + * device
> > + * @upper_dev: Upper device that may have borrowed psp_dev pointer
> > + * @priv: netdev_nested_priv containing the psp_dev being unregistered
> > + *
> > + * Callback for netdev_walk_all_upper_dev_rcu() to clear borrowed psp_dev
> > + * pointers on upper devices when the underlying psp_dev is being unregistered.
> > + *
> > + * Return: 0 to continue walking, non-zero to stop.
> > + */
> > +static int psp_clear_upper_dev_psp_dev(struct net_device *upper_dev,
> > + struct netdev_nested_priv *priv)
> > +{
> > + struct psp_dev *psd = priv->data;
> > + struct psp_dev *upper_psd;
> > +
> > + upper_psd = rcu_dereference(upper_dev->psp_dev);
> > + if (upper_psd == psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> > +
> > + return 0;
> > +}
> > +
> > /**
> > * psp_dev_unregister() - unregister PSP device
> > * @psd: PSP device structure
> > + *
> > + * Unregisters a PSP device and clears all borrowed psp_dev pointers on
> > + * upper devices (e.g., VLAN subinterfaces) that reference this device.
> > + * This prevents use-after-free if upper devices still have borrowed
> > + * pointers when the psp_dev structure is freed.
> > */
> > void psp_dev_unregister(struct psp_dev *psd)
> > {
> > struct psp_assoc *pas, *next;
> > + struct netdev_nested_priv priv = {
> > + .data = psd,
> > + };
> >
> > mutex_lock(&psp_devs_lock);
> > mutex_lock(&psd->lock);
> > @@ -137,6 +170,12 @@ void psp_dev_unregister(struct psp_dev *psd)
> >
> > rcu_assign_pointer(psd->main_netdev->psp_dev, NULL);
> >
> > + /* Clear borrowed psp_dev pointers on all upper devices */
> > + rcu_read_lock();
> > + netdev_walk_all_upper_dev_rcu(psd->main_netdev,
> > + psp_clear_upper_dev_psp_dev, &priv);
> > + rcu_read_unlock();
> > +
> > psd->ops = NULL;
> > psd->drv_priv = NULL;
> >
> > @@ -313,11 +352,79 @@ int psp_dev_rcv(struct sk_buff *skb, u16 dev_id, u8 generation, bool strip_icv)
> > }
> > EXPORT_SYMBOL(psp_dev_rcv);
> >
> > +/**
> > + * psp_netdevice_event() - Handle netdevice events for PSP device propagation
> > + * @nb: notifier block
> > + * @event: netdevice event
> > + * @ptr: netdevice notifier info
> > + *
> > + * Propagates psp_dev pointer from lower devices to upper devices when
> > + * upper devices are created (e.g., VLAN subinterfaces).
> > + * Excluding from this logic, the upper devices that have multiple lower
> > + * devices eg., bond devices.
> > + *
> > + * Return: NOTIFY_DONE
> > + */
> > +static int psp_netdevice_event(struct notifier_block *nb,
> > + unsigned long event, void *ptr)
> > +{
> > + struct netdev_notifier_changeupper_info *info;
> > + struct net_device *dev, *upper_dev;
> > + struct psp_dev *psd;
> > +
> > + if (event != NETDEV_CHANGEUPPER)
> > + return NOTIFY_DONE;
> > +
> > + info = ptr;
> > + dev = netdev_notifier_info_to_dev(ptr);
> > + upper_dev = info->upper_dev;
> > +
> > + if (netif_is_lag_master(upper_dev))
> > + return NOTIFY_DONE;
> > +
> > + if (info->linking) {
> > + /* Lower device is being linked to an upper device.
> > + * Propagate psp_dev from the immediate lower device to the
> > + * upper device. The immediate lower device would have already
> > + * got the psp_dev pointer set in a previous notification (or
> > + * owns it if it's the lowest device).
> > + * Upper devices just borrow the pointer.
> > + */
> > + psd = rtnl_dereference(dev->psp_dev);
> > + if (psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, psd);
> > + } else {
> > + /* Lower device is being unlinked from an upper device.
> > + * Clear the borrowed psp_dev pointer.
> > + */
> > + psd = rtnl_dereference(upper_dev->psp_dev);
> > + if (psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> > + }
> > +
> > + return NOTIFY_DONE;
> > +}
> > +
> > +static struct notifier_block psp_netdevice_notifier = {
> > + .notifier_call = psp_netdevice_event,
> > +};
> > +
> > static int __init psp_init(void)
> > {
> > + int err;
> > +
> > mutex_init(&psp_devs_lock);
> >
> > - return genl_register_family(&psp_nl_family);
> > + err = register_netdevice_notifier(&psp_netdevice_notifier);
> > + if (err)
> > + return err;
> > +
> > + err = genl_register_family(&psp_nl_family);
> > + if (err) {
> > + unregister_netdevice_notifier(&psp_netdevice_notifier);
> > + return err;
> > + }
> > + return 0;
> > }
> >
> > subsys_initcall(psp_init);
>
> The lack of support for netns is a bit of a gap for this feature. It may
> make sense to see if what was posted in
> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> is sufficient for your use case, as it handles cases where upper devices
> are in a different netns from psd->main_netdev.
Thanks. Went through the changes in
https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
It is sufficient for my use case too, although it specifically
addresses the cross-netns virtual devices use case.
But the same net-ns stacked devices like VLANs can be handled with
this patch implicitly, without user intervention through dev-assoc.
I think both approaches can co-exist without conflict.
However, I am ok with using a single approach to use the dev-assoc for
the same net-ns use case too.
Thanks,
Kiran
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-24 20:58 ` Daniel Zahka
2026-02-26 11:38 ` Kiran Kella
@ 2026-02-26 11:46 ` Kiran Kella
2026-02-26 14:11 ` Daniel Zahka
2026-02-27 1:06 ` Jakub Kicinski
1 sibling, 2 replies; 11+ messages in thread
From: Kiran Kella @ 2026-02-26 11:46 UTC (permalink / raw)
To: Daniel Zahka
Cc: davem, edumazet, kuba, willemb, pabeni, andrew+netdev, horms,
netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni
On Wed, Feb 25, 2026 at 2:28 AM Daniel Zahka <daniel.zahka@gmail.com> wrote:
>
>
>
> On 2/23/26 2:11 PM, Kiran Kella wrote:
> > This is achieved by propagating the psp_dev from the lower device
> > to the upper devices in the device stack via a netdevice notifier.
> > The lowest device owns the psp_dev pointer while the upper devices
> > just borrow the pointer. When the lower device is unlinked, the
> > borrowed pointer is cleared in the upper device.
> > Assumption being that psp_dev is set on the lowest device before
> > any upper devices are stacked on that lowest device.
> >
> > Signed-off-by: Kiran Kella <kiran.kella@broadcom.com>
> > Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> > Reviewed-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> > ---
> > net/psp/psp_main.c | 109 ++++++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 108 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/psp/psp_main.c b/net/psp/psp_main.c
> > index a8534124f626..fac785dcfa0f 100644
> > --- a/net/psp/psp_main.c
> > +++ b/net/psp/psp_main.c
> > @@ -3,6 +3,7 @@
> > #include <linux/bitfield.h>
> > #include <linux/list.h>
> > #include <linux/netdevice.h>
> > +#include <linux/rtnetlink.h>
> > #include <linux/xarray.h>
> > #include <net/net_namespace.h>
> > #include <net/psp.h>
> > @@ -110,13 +111,45 @@ void psp_dev_free(struct psp_dev *psd)
> > kfree_rcu(psd, rcu);
> > }
> >
> > +/**
> > + * psp_clear_upper_dev_psp_dev() - Clear borrowed psp_dev pointer on upper
> > + * device
> > + * @upper_dev: Upper device that may have borrowed psp_dev pointer
> > + * @priv: netdev_nested_priv containing the psp_dev being unregistered
> > + *
> > + * Callback for netdev_walk_all_upper_dev_rcu() to clear borrowed psp_dev
> > + * pointers on upper devices when the underlying psp_dev is being unregistered.
> > + *
> > + * Return: 0 to continue walking, non-zero to stop.
> > + */
> > +static int psp_clear_upper_dev_psp_dev(struct net_device *upper_dev,
> > + struct netdev_nested_priv *priv)
> > +{
> > + struct psp_dev *psd = priv->data;
> > + struct psp_dev *upper_psd;
> > +
> > + upper_psd = rcu_dereference(upper_dev->psp_dev);
> > + if (upper_psd == psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> > +
> > + return 0;
> > +}
> > +
> > /**
> > * psp_dev_unregister() - unregister PSP device
> > * @psd: PSP device structure
> > + *
> > + * Unregisters a PSP device and clears all borrowed psp_dev pointers on
> > + * upper devices (e.g., VLAN subinterfaces) that reference this device.
> > + * This prevents use-after-free if upper devices still have borrowed
> > + * pointers when the psp_dev structure is freed.
> > */
> > void psp_dev_unregister(struct psp_dev *psd)
> > {
> > struct psp_assoc *pas, *next;
> > + struct netdev_nested_priv priv = {
> > + .data = psd,
> > + };
> >
> > mutex_lock(&psp_devs_lock);
> > mutex_lock(&psd->lock);
> > @@ -137,6 +170,12 @@ void psp_dev_unregister(struct psp_dev *psd)
> >
> > rcu_assign_pointer(psd->main_netdev->psp_dev, NULL);
> >
> > + /* Clear borrowed psp_dev pointers on all upper devices */
> > + rcu_read_lock();
> > + netdev_walk_all_upper_dev_rcu(psd->main_netdev,
> > + psp_clear_upper_dev_psp_dev, &priv);
> > + rcu_read_unlock();
> > +
> > psd->ops = NULL;
> > psd->drv_priv = NULL;
> >
> > @@ -313,11 +352,79 @@ int psp_dev_rcv(struct sk_buff *skb, u16 dev_id, u8 generation, bool strip_icv)
> > }
> > EXPORT_SYMBOL(psp_dev_rcv);
> >
> > +/**
> > + * psp_netdevice_event() - Handle netdevice events for PSP device propagation
> > + * @nb: notifier block
> > + * @event: netdevice event
> > + * @ptr: netdevice notifier info
> > + *
> > + * Propagates psp_dev pointer from lower devices to upper devices when
> > + * upper devices are created (e.g., VLAN subinterfaces).
> > + * Excluding from this logic, the upper devices that have multiple lower
> > + * devices eg., bond devices.
> > + *
> > + * Return: NOTIFY_DONE
> > + */
> > +static int psp_netdevice_event(struct notifier_block *nb,
> > + unsigned long event, void *ptr)
> > +{
> > + struct netdev_notifier_changeupper_info *info;
> > + struct net_device *dev, *upper_dev;
> > + struct psp_dev *psd;
> > +
> > + if (event != NETDEV_CHANGEUPPER)
> > + return NOTIFY_DONE;
> > +
> > + info = ptr;
> > + dev = netdev_notifier_info_to_dev(ptr);
> > + upper_dev = info->upper_dev;
> > +
> > + if (netif_is_lag_master(upper_dev))
> > + return NOTIFY_DONE;
> > +
> > + if (info->linking) {
> > + /* Lower device is being linked to an upper device.
> > + * Propagate psp_dev from the immediate lower device to the
> > + * upper device. The immediate lower device would have already
> > + * got the psp_dev pointer set in a previous notification (or
> > + * owns it if it's the lowest device).
> > + * Upper devices just borrow the pointer.
> > + */
> > + psd = rtnl_dereference(dev->psp_dev);
> > + if (psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, psd);
> > + } else {
> > + /* Lower device is being unlinked from an upper device.
> > + * Clear the borrowed psp_dev pointer.
> > + */
> > + psd = rtnl_dereference(upper_dev->psp_dev);
> > + if (psd)
> > + rcu_assign_pointer(upper_dev->psp_dev, NULL);
> > + }
> > +
> > + return NOTIFY_DONE;
> > +}
> > +
> > +static struct notifier_block psp_netdevice_notifier = {
> > + .notifier_call = psp_netdevice_event,
> > +};
> > +
> > static int __init psp_init(void)
> > {
> > + int err;
> > +
> > mutex_init(&psp_devs_lock);
> >
> > - return genl_register_family(&psp_nl_family);
> > + err = register_netdevice_notifier(&psp_netdevice_notifier);
> > + if (err)
> > + return err;
> > +
> > + err = genl_register_family(&psp_nl_family);
> > + if (err) {
> > + unregister_netdevice_notifier(&psp_netdevice_notifier);
> > + return err;
> > + }
> > + return 0;
> > }
> >
> > subsys_initcall(psp_init);
>
> The lack of support for netns is a bit of a gap for this feature. It may
> make sense to see if what was posted in
> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> is sufficient for your use case, as it handles cases where upper devices
> are in a different netns from psd->main_netdev.
Thanks. Went through the changes in
https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
It is sufficient for my use case too, although it specifically
addresses the cross-netns virtual devices use case.
But the same net-ns stacked devices like VLANs can be handled with
this patch implicitly, without user intervention through dev-assoc.
I think both approaches can co-exist without conflict.
However, I am ok with using a single approach to use the dev-assoc for
the same net-ns use case too.
Thanks,
Kiran
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-26 11:46 ` Kiran Kella
@ 2026-02-26 14:11 ` Daniel Zahka
2026-02-26 15:11 ` Kiran Kella
2026-02-27 1:06 ` Jakub Kicinski
1 sibling, 1 reply; 11+ messages in thread
From: Daniel Zahka @ 2026-02-26 14:11 UTC (permalink / raw)
To: Kiran Kella
Cc: davem, edumazet, kuba, willemb, pabeni, andrew+netdev, horms,
netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni
On 2/26/26 6:46 AM, Kiran Kella wrote:
> On Wed, Feb 25, 2026 at 2:28 AM Daniel Zahka <daniel.zahka@gmail.com> wrote:
>> The lack of support for netns is a bit of a gap for this feature. It may
>> make sense to see if what was posted in
>> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
>> is sufficient for your use case, as it handles cases where upper devices
>> are in a different netns from psd->main_netdev.
> Thanks. Went through the changes in
> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> It is sufficient for my use case too, although it specifically
> addresses the cross-netns virtual devices use case.
> But the same net-ns stacked devices like VLANs can be handled with
> this patch implicitly, without user intervention through dev-assoc.
> I think both approaches can co-exist without conflict.
I agree they can co-exist, and automatically propagating psp devices is
useful. I was just pointing out that support for upper devices will
eventually need to deal with netns, because when I looked at this patch
things like ipvlan and macvlan came to mind.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-26 14:11 ` Daniel Zahka
@ 2026-02-26 15:11 ` Kiran Kella
0 siblings, 0 replies; 11+ messages in thread
From: Kiran Kella @ 2026-02-26 15:11 UTC (permalink / raw)
To: Daniel Zahka
Cc: davem, edumazet, kuba, willemb, pabeni, andrew+netdev, horms,
netdev, linux-kernel, jayakrishnan.udayavarma, ajit.khaparde,
akhilesh.samineni
On Thu, Feb 26, 2026 at 7:41 PM Daniel Zahka <daniel.zahka@gmail.com> wrote:
>
>
>
> On 2/26/26 6:46 AM, Kiran Kella wrote:
> > On Wed, Feb 25, 2026 at 2:28 AM Daniel Zahka <daniel.zahka@gmail.com> wrote:
> >> The lack of support for netns is a bit of a gap for this feature. It may
> >> make sense to see if what was posted in
> >> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> >> is sufficient for your use case, as it handles cases where upper devices
> >> are in a different netns from psd->main_netdev.
> > Thanks. Went through the changes in
> > https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> > It is sufficient for my use case too, although it specifically
> > addresses the cross-netns virtual devices use case.
> > But the same net-ns stacked devices like VLANs can be handled with
> > this patch implicitly, without user intervention through dev-assoc.
> > I think both approaches can co-exist without conflict.
>
> I agree they can co-exist, and automatically propagating psp devices is
> useful. I was just pointing out that support for upper devices will
> eventually need to deal with netns, because when I looked at this patch
> things like ipvlan and macvlan came to mind.
Ack
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP.
2026-02-26 11:46 ` Kiran Kella
2026-02-26 14:11 ` Daniel Zahka
@ 2026-02-27 1:06 ` Jakub Kicinski
1 sibling, 0 replies; 11+ messages in thread
From: Jakub Kicinski @ 2026-02-27 1:06 UTC (permalink / raw)
To: Kiran Kella
Cc: Daniel Zahka, davem, edumazet, willemb, pabeni, andrew+netdev,
horms, netdev, linux-kernel, jayakrishnan.udayavarma,
ajit.khaparde, akhilesh.samineni
On Thu, 26 Feb 2026 17:16:58 +0530 Kiran Kella wrote:
> > The lack of support for netns is a bit of a gap for this feature. It may
> > make sense to see if what was posted in
> > https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> > is sufficient for your use case, as it handles cases where upper devices
> > are in a different netns from psd->main_netdev.
>
> Thanks. Went through the changes in
> https://lore.kernel.org/netdev/20260224002410.1553838-1-weibunny@fb.com/
> It is sufficient for my use case too, although it specifically
> addresses the cross-netns virtual devices use case.
> But the same net-ns stacked devices like VLANs can be handled with
> this patch implicitly, without user intervention through dev-assoc.
> I think both approaches can co-exist without conflict.
> However, I am ok with using a single approach to use the dev-assoc for
> the same net-ns use case too.
FTR I have mixed feelings about automatic propagation of PSP onto upper
devices. If we propagate it onto vlan, why not bond, and if bond why not
bridge. Or macsec (can every device do multiple layers of encryption?)
If user does the propagation and that results in packet loss that's
user's fault not ours. IDK.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-02-27 1:06 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23 19:11 [net-next, v2 0/2] psp: Support PSP Tx on logical devices like VLAN Kiran Kella
2026-02-23 19:11 ` [net-next, v2 1/2] psp: Support for transmit on logical device when the underlying transport device supports PSP Kiran Kella
2026-02-24 20:58 ` Daniel Zahka
2026-02-26 11:38 ` Kiran Kella
2026-02-26 11:46 ` Kiran Kella
2026-02-26 14:11 ` Daniel Zahka
2026-02-26 15:11 ` Kiran Kella
2026-02-27 1:06 ` Jakub Kicinski
2026-02-23 19:11 ` [net-next, v2 2/2] selftests: drv-net: psp: add test for VLAN sub-interface Kiran Kella
2026-02-23 21:58 ` Jakub Kicinski
2026-02-25 7:22 ` Kiran Kella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox