Commit 22360fad authored by Martin KaFai Lau's avatar Martin KaFai Lau
Browse files

Merge branch 'Add bpf programmable net device'



Daniel Borkmann says:

====================
This work adds a BPF programmable device which can operate in L3 or L2
mode where the BPF program is part of the xmit routine. It's program
management is done via bpf_mprog and it comes with BPF link support.
For details see patch 1 and following. Thanks!

v3 -> v4:
  - Moved netkit_release_all() into ndo_uninit (Stan)
  - Two small commit msg corrections (Toke)
  - Added Acked/Reviewed-by
v2 -> v3:
  - Remove setting dev->min_mtu to ETH_MIN_MTU (Andrew)
  - Do not populate ethtool info->version (Andrew)
  - Populate netdev private data before register_netdevice (Andrew)
  - Use strscpy for ifname template (Jakub)
  - Use GFP_KERNEL_ACCOUNT for link kzalloc (Jakub)
  - Carry and dump link attach type for bpftool (Toke)
v1 -> v2:
  - Rename from meta (Toke, Andrii, Alexei)
  - Reuse skb_scrub_packet (Stan)
  - Remove IFF_META and use netdev_ops (Toke)
  - Add comment to multicast handler (Toke)
  - Remove silly version info (Toke)
  - Fix attach_type_name (Quentin)
  - Rework libbpf link attach api to be similar
    as tcx (Andrii)
  - Move flags last for bpf_netkit_opts (Andrii)
  - Rebased to bpf_mprog query api changes
  - Folded link support patch into main one
====================

Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parents 42d31dd6 ace15f91
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3795,6 +3795,15 @@ L: bpf@vger.kernel.org
S:	Odd Fixes
K:	(?:\b|_)bpf(?:\b|_)
BPF [NETKIT] (BPF-programmable network device)
M:	Daniel Borkmann <daniel@iogearbox.net>
M:	Nikolay Aleksandrov <razor@blackwall.org>
L:	bpf@vger.kernel.org
L:	netdev@vger.kernel.org
S:	Supported
F:	drivers/net/netkit.c
F:	include/net/netkit.h
BPF [NETWORKING] (struct_ops, reuseport)
M:	Martin KaFai Lau <martin.lau@linux.dev>
L:	bpf@vger.kernel.org
+9 −0
Original line number Diff line number Diff line
@@ -448,6 +448,15 @@ config NLMON
	  diagnostics, etc. This is mostly intended for developers or support
	  to debug netlink issues. If unsure, say N.

config NETKIT
	bool "BPF-programmable network device"
	depends on BPF_SYSCALL
	help
	  The netkit device is a virtual networking device where BPF programs
	  can be attached to the device(s) transmission routine in order to
	  implement the driver's internal logic. The device can be configured
	  to operate in L3 or L2 mode. If unsure, say N.

config NET_VRF
	tristate "Virtual Routing and Forwarding (Lite)"
	depends on IP_MULTIPLE_TABLES
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ obj-$(CONFIG_MDIO) += mdio.o
obj-$(CONFIG_NET) += loopback.o
obj-$(CONFIG_NETDEV_LEGACY_INIT) += Space.o
obj-$(CONFIG_NETCONSOLE) += netconsole.o
obj-$(CONFIG_NETKIT) += netkit.o
obj-y += phy/
obj-y += pse-pd/
obj-y += mdio/

drivers/net/netkit.c

0 → 100644
+940 −0

File added.

Preview size limit exceeded, changes collapsed.

include/net/netkit.h

0 → 100644
+38 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading