Skip to content

psp: Add support for dev-assoc/disassoc

Wei Wang netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 of 9 patches 12 repliesIn review
  2. v18 of 9 patches 8 repliesSuperseded

Changes in v2 from the cover letter

- Update the first 4 patches to reflect the latest changes in
https://lore.kernel.org/netdev/[email protected]/
- Update patch 9 to add a param to NetDrvContEnv to control the loading of the tx forwarding bpf program

8 of 9 patches are in this archive. The cover letter announces 9.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/9selftests/net: Export Netlink class via lib.pytools/testing/selftests/drivers/net/lib/py/__init__.py tools/testing/selftests/net/lib/py/__init__.py tools/testing/selftests/net/lib/py/ynl.py+6 -60 replies
3/9selftests/net: Add env for container based teststools/testing/selftests/drivers/net/README.rst tools/testing/selftests/drivers/net/hw/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/__init__.py +1 more+254 -60 replies
4/9selftests/net: Add netkit container ping testtools/testing/selftests/drivers/net/hw/Makefile tools/testing/selftests/drivers/net/hw/config tools/testing/selftests/drivers/net/hw/nk_netns.py+27 -00 replies
5/9psp: add unprivileged version of psp_device_get_lockedDocumentation/netlink/specs/psp.yaml net/psp/psp-nl-gen.c net/psp/psp-nl-gen.h +3 more+28 -118 replies
6/9psp: Add new netlink cmd for dev-assoc and dev-disassocDocumentation/netlink/specs/psp.yaml include/net/psp/types.h include/uapi/linux/psp.h +4 more+407 -93 replies
7/9psp: add a new netdev event for dev unregisternet/psp/psp_main.c+63 -10 replies
8/9selftests/net: Add bpf skb forwarding programtools/testing/selftests/drivers/net/hw/nk_redirect.bpf.c+60 -00 replies
9/9selftest/net: psp: Add test for dev-assoc/disassoctools/testing/selftests/drivers/net/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/env.py tools/testing/selftests/drivers/net/psp.py+574 -91 reply

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchBobby Eshleman
2/9
3/9
4/9
5/9
6/9
7/9
8/9R-b T-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/9] psp: Add support for dev-assoc/disassoc

The main purpose of this feature is to associate virtual devices like veth or netkit with a real PSP device, so we could provide PSP functionality to the application running with virtual devices.

A typical deployment that works with this feature is as follows:
Host Namespace:
psp_dev_local ←──physically linked──→ psp_dev_peer
(PSP device)
│
│ BPF on psp_dev_local ingress: bpf_redirect_peer() to nk_guest │
nk_host / veth_host
│
│ BPF on nk_host ingress: bpf_redirect_neigh() to psp_dev_local │
Guest Namespace (netns):
│
nk_guest / veth_guest
★ PSP application run here

Remote Namespace (_netns):
psp_dev_peer
★ PSP server application runs here

Note:
The general requirement for this feature to work:
For PSP to work correctly, the egress device at validate_xmit_skb() time must have psp_dev matching the association's psd. Any device stacking or traffic redirection that changes the egress device will cause either:
1. TX validation failure (SKB_DROP_REASON_PSP_OUTPUT) - fail-safe
2. RX policy failure after tx-assoc - packets without PSP extension are rejected by receiver expecting encrypted traffic

Here are a few examples that this feature would not work:
- Bonding with load balancing in round-robin, XOR, 802.3ad mode across multiple PSP devices, or mixed PSP and non-PSP devices
- Bonding with active-backup mode might work without PSP migration for failover case.
- ipvlan/macvlan in bridge mode would not work given packets are loopbacked locally without going through the PSP device.

The first 4 patchs are from this patchset:
https://lore.kernel.org/netdev/[email protected]/
We base the newly added test cases on top of env NetDrvContEnv from this patchset.

Changes since v1:
- Update the first 4 patches to reflect the latest changes in
https://lore.kernel.org/netdev/[email protected]/
- Update patch 9 to add a param to NetDrvContEnv to control the loading of the tx forwarding bpf program

David Wei (4):
selftests/net: Add bpf skb forwarding program selftests/net: Export Netlink class via lib.py selftests/net: Add env for container based tests selftests/net: Add netkit container ping test

Wei Wang (5):
psp: add unprivileged version of psp_device_get_locked
psp: Add new netlink cmd for dev-assoc and dev-disassoc
psp: add a new netdev event for dev unregister selftests/net: Add bpf skb forwarding program selftest/net: psp: Add test for dev-assoc/disassoc

 Documentation/netlink/specs/psp.yaml          |  66 ++-
 include/net/psp/types.h                       |  15 +
 include/uapi/linux/psp.h                      |  13 +
 net/psp/psp-nl-gen.c                          |  34 +-
 net/psp/psp-nl-gen.h                          |   4 +
 net/psp/psp.h                                 |   2 +-
 net/psp/psp_main.c                            |  86 ++-
 net/psp/psp_nl.c                              | 297 +++++++++-
 .../testing/selftests/drivers/net/README.rst  |  38 ++
 .../testing/selftests/drivers/net/hw/Makefile |   1 +
 tools/testing/selftests/drivers/net/hw/config |   3 +
 .../drivers/net/hw/lib/py/__init__.py         |   7 +-
 .../selftests/drivers/net/hw/nk_forward.bpf.c |  49 ++
 .../selftests/drivers/net/hw/nk_netns.py      |  23 +
 .../drivers/net/hw/nk_redirect.bpf.c          |  60 ++
 .../selftests/drivers/net/lib/py/__init__.py  |  11 +-
 .../selftests/drivers/net/lib/py/env.py       | 260 +++++++++
 tools/testing/selftests/drivers/net/psp.py    | 525 +++++++++++++++++-
 .../testing/selftests/net/lib/py/__init__.py  |   4 +-
 tools/testing/selftests/net/lib/py/ynl.py     |   4 +-
 20 files changed, 1464 insertions(+), 38 deletions(-)
 create mode 100644 tools/testing/selftests/drivers/net/hw/nk_forward.bpf.c
 create mode 100755 tools/testing/selftests/drivers/net/hw/nk_netns.py
 create mode 100644 tools/testing/selftests/drivers/net/hw/nk_redirect.bpf.c
Signature · 1 line
2.47.3