Skip to content

RFC net: L3 master device

David Ahern netdev 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11net: Introduce L3 Master device abstractionMAINTAINERS include/linux/netdevice.h include/net/l3mdev.h +5 more+241 -00 replies
2/11net: Rename IFF_VRF_MASTER to IFF_L3MDEVdrivers/net/vrf.c include/linux/netdevice.h include/net/route.h +4 more+16 -160 replies
3/11net: Add support for l3mdev ops to VRF driverdrivers/net/Kconfig drivers/net/vrf.c+30 -00 replies
4/11net: Replace vrf_master_ifindex{,_rcu} with l3mdev equivalentsinclude/net/vrf.h net/ipv4/fib_frontend.c net/ipv4/icmp.c +4 more+20 -630 replies
5/11net: Replace vrf_dev_table and friendsinclude/net/vrf.h net/ipv4/af_inet.c net/ipv4/fib_frontend.c+5 -860 replies
6/11net: Replace calls to vrf_dev_get_rthinclude/net/vrf.h net/ipv4/route.c+4 -270 replies
7/11net: Remove the now unused vrf_ptrdrivers/net/vrf.c include/linux/netdevice.h include/net/vrf.h+2 -380 replies
8/11net: Remove vrf header fileMAINTAINERS drivers/net/vrf.c include/net/vrf.h+15 -310 replies
9/11net: Move netif_index_is_l3_master to l3mdev.hinclude/linux/netdevice.h include/net/l3mdev.h include/net/route.h+25 -210 replies
10/11net: Rename FLOWI_FLAG_VRFSRC to FLOWI_FLAG_L3MDEV_SRCdrivers/net/vrf.c include/net/flow.h include/net/route.h +2 more+6 -60 replies
11/11net: Add netif_is_l3_slavedrivers/net/vrf.c include/linux/netdevice.h net/l3mdev/l3mdev.c+12 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC net-next 00/11] net: L3 master device

The VRF device is essentially a Layer 3 master device used to associate netdevices with a specific routing table and to influence FIB lookups via 'ip rules' and controlling the oif/iif used for the lookup.

This series generalizes the VRF into L3 master device, l3mdev. Similar to switchdev it has a Kconfig option and separate set of operations in net_device allowing it to be completely compiled out if not wanted. The l3mdev methods rely on the 'master' aspect and use of netdev_master_upper_dev_get_rcu to retrieve the master device from a given netdevice if it is enslaved to an L3_MASTER.

The VRF device is converted to use the l3mdev operations. At the end the vrf_ptr is no longer and removed, as are all direct references to VRF. The end result is a much simpler implementation for VRF.

Thanks to Nikolay for suggestions (eg., use of the master linkage which is the key to making this work) and to Roopa, Andy and Shrijeet for early reviews.

David Ahern (11):
net: Introduce L3 Master device abstraction
net: Rename IFF_VRF_MASTER to IFF_L3MDEV
net: Add support for l3mdev ops to VRF driver
net: Replace vrf_master_ifindex{,_rcu} with l3mdev equivalents
net: Replace vrf_dev_table and friends
net: Replace calls to vrf_dev_get_rth
net: Remove the now unused vrf_ptr
net: Remove vrf header file
net: Move netif_index_is_l3_master to l3mdev.h
net: Rename FLOWI_FLAG_VRFSRC to FLOWI_FLAG_L3MDEV_SRC
net: Add netif_is_l3_slave

 MAINTAINERS               |   8 ++-
 drivers/net/Kconfig       |   1 +
 drivers/net/vrf.c         |  87 ++++++++++++----------
 include/linux/netdevice.h |  41 ++++-------
 include/net/flow.h        |   2 +-
 include/net/l3mdev.h      | 152 +++++++++++++++++++++++++++++++++++++++
 include/net/route.h       |   5 +-
 include/net/vrf.h         | 178 ----------------------------------------------
 net/Kconfig               |   1 +
 net/Makefile              |   3 +
 net/ipv4/af_inet.c        |   4 +-
 net/ipv4/fib_frontend.c   |  12 ++--
 net/ipv4/fib_trie.c       |   2 +-
 net/ipv4/icmp.c           |   8 +--
 net/ipv4/ip_fragment.c    |   6 +-
 net/ipv4/ip_output.c      |   2 +-
 net/ipv4/route.c          |  16 ++---
 net/ipv4/udp.c            |   4 +-
 net/ipv4/xfrm4_policy.c   |   8 +--
 net/ipv6/xfrm6_policy.c   |   8 +--
 net/l3mdev/Kconfig        |  10 +++
 net/l3mdev/Makefile       |   5 ++
 net/l3mdev/l3mdev.c       |  74 +++++++++++++++++++
 23 files changed, 354 insertions(+), 283 deletions(-)
 create mode 100644 include/net/l3mdev.h
 delete mode 100644 include/net/vrf.h
 create mode 100644 net/l3mdev/Kconfig
 create mode 100644 net/l3mdev/Makefile
 create mode 100644 net/l3mdev/l3mdev.c
Signature · 1 line
1.9.1