Skip to content

: MACVLAN driver

Patrick McHardy netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2: Validate new address in eth_mac_addrnet/ethernet/eth.c+3 -00 replies
2/2: Add MACVLAN driverMAINTAINERS drivers/net/Kconfig drivers/net/Makefile +4 more+522 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [NET 00/02]: MACVLAN driver

These patches add a rewritten version of Ben's macvlan driver, which allows to create virtual ethernet devices. The underlying device is put in promiscous mode and packets are demuxed based on MAC address. It behaves similar to bridge devices in that packets are visible on the real device before delivery to the macvlan driver. The driver supports all features of the underlying device except VLAN acceleration, this is currently very hard to support. I might look into this in the future.

The main downside of this driver is that it adds another hook in netif_receive_skb, unfortunately that is unavoidable. When not compiled in the hook vanishes of course.

Usage is simple:

# ip link add link eth0 type macvlan

Will create a macvlan0 device with a random MAC address on top of eth0. No iproute patches are required.

Please apply, thanks.

 MAINTAINERS                |    6 +
 drivers/net/Kconfig        |   10 +
 drivers/net/Makefile       |    1 +
 drivers/net/macvlan.c      |  468 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/if_macvlan.h |    9 +
 include/linux/netdevice.h  |    2 +
 net/core/dev.c             |   26 +++
 net/ethernet/eth.c         |    3 +
 8 files changed, 525 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/macvlan.c
 create mode 100644 include/linux/if_macvlan.h

Patrick McHardy (2):
[ETHERNET]: Validate new address in eth_mac_addr [NET]: Add MACVLAN driver