[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251118100046.2944392-1-skorodumov.dmitry@huawei.com>
Date: Tue, 18 Nov 2025 13:00:32 +0300
From: Dmitry Skorodumov <skorodumov.dmitry@...wei.com>
To: <netdev@...r.kernel.org>
CC: <andrey.bokhanko@...wei.com>, <edumazet@...gle.com>, Dmitry Skorodumov
<skorodumov.dmitry@...wei.com>
Subject: [PATCH v4 net-next 00/13] ipvlan: support mac-nat mode
pvlan: support mac-nat mode
ipvlan: Add support of MAC-NAT translation in L2-bridge
Make it is possible to create link in L2_MACNAT mode: learnable
bridge with MAC Address Translation. The IPs and MAC addresses will be learned
from TX-packets of child interfaces.
Also, dev_add_pack() protocol is attached to the main port
to support communication from main to child interfaces.
This mode is intended for the desktop virtual machines, for
bridging to Wireless interfaces.
The mode should be specified while creating first child interface.
It is not possible to change it after this.
This functionality is quite often requested by users.
diff from v3:
- Restructured code, to place all new functionality under
if (ipvlan_is_macnat(port) condition and minimize refactoring
of existing code.
- Added kselftest for the new functionality
- Removed patch with unnecessary gso_segment() call
- Patches 1-3 were merged into 1
- Fixed compilation warnings about __be16/__be32 conversions
diff from v2:
- forgotten patches (10..14) added
diff from v1:
- changed name of the mode to be L2_MACNAT
- Fixed use of uninitialized variable, found by Intel CI/CD
- Fixed style problems with lines more then 80 chars
- Try to use xmastree style of vars declarations
- Fixed broken intermediate compilation
- Added check, that child-ip doesn't use IP of the main port
- Added patch to ignore PACKET_LOOPBACK in handle_mode_l2()
- Some patches with style-refactoring of addr-event notifications
Dmitry Skorodumov (13):
ipvlan: Support MACNAT mode
ipvlan: macnat: Handle rx mcast-ip and unicast eth
ipvlan: Forget all IP when device goes down
ipvlan: Support IPv6 in macnat mode.
ipvlan: Fix compilation warning about __be32 -> u32
ipvlan: Make the addrs_lock be per port
ipvlan: Take addr_lock in ipvlan_open()
ipvlan: Don't allow children to use IPs of main
ipvlan: const-specifier for functions that use iaddr
ipvlan: Common code from v6/v4 validator_event
ipvlan: common code to handle ipv6/ipv4 address events
ipvlan: Ignore PACKET_LOOPBACK in handle_mode_l2()
selftests: drv-net: selftest for ipvlan-macnat mode
Documentation/networking/ipvlan.rst | 20 +
drivers/net/ipvlan/ipvlan.h | 45 +-
drivers/net/ipvlan/ipvlan_core.c | 486 ++++++++++++++++-
drivers/net/ipvlan/ipvlan_main.c | 506 ++++++++++++++----
include/uapi/linux/if_link.h | 1 +
tools/testing/selftests/net/Makefile | 3 +
.../selftests/net/ipvtap_macnat_bridge.py | 174 ++++++
.../selftests/net/ipvtap_macnat_test.sh | 332 ++++++++++++
8 files changed, 1426 insertions(+), 141 deletions(-)
create mode 100755 tools/testing/selftests/net/ipvtap_macnat_bridge.py
create mode 100755 tools/testing/selftests/net/ipvtap_macnat_test.sh
--
2.25.1
Powered by blists - more mailing lists