Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ipvlan-support-bonding-events'

Etienne Champetier says:

====================
ipvlan: Support bonding events
====================

Link: https://patch.msgid.link/20250109032819.326528-1-champetier.etienne@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+104 -100
+6
drivers/net/ipvlan/ipvlan_main.c
··· 799 799 case NETDEV_PRE_TYPE_CHANGE: 800 800 /* Forbid underlying device to change its type. */ 801 801 return NOTIFY_BAD; 802 + 803 + case NETDEV_NOTIFY_PEERS: 804 + case NETDEV_BONDING_FAILOVER: 805 + case NETDEV_RESEND_IGMP: 806 + list_for_each_entry(ipvlan, &port->ipvlans, pnode) 807 + call_netdevice_notifiers(event, ipvlan->dev); 802 808 } 803 809 return NOTIFY_DONE; 804 810 }
+1 -1
tools/testing/selftests/drivers/net/bonding/Makefile
··· 10 10 mode-2-recovery-updelay.sh \ 11 11 bond_options.sh \ 12 12 bond-eth-type-change.sh \ 13 - bond_macvlan.sh 13 + bond_macvlan_ipvlan.sh 14 14 15 15 TEST_FILES := \ 16 16 lag_lib.sh \
-99
tools/testing/selftests/drivers/net/bonding/bond_macvlan.sh
··· 1 - #!/bin/bash 2 - # SPDX-License-Identifier: GPL-2.0 3 - # 4 - # Test macvlan over balance-alb 5 - 6 - lib_dir=$(dirname "$0") 7 - source ${lib_dir}/bond_topo_2d1c.sh 8 - 9 - m1_ns="m1-$(mktemp -u XXXXXX)" 10 - m2_ns="m1-$(mktemp -u XXXXXX)" 11 - m1_ip4="192.0.2.11" 12 - m1_ip6="2001:db8::11" 13 - m2_ip4="192.0.2.12" 14 - m2_ip6="2001:db8::12" 15 - 16 - cleanup() 17 - { 18 - ip -n ${m1_ns} link del macv0 19 - ip netns del ${m1_ns} 20 - ip -n ${m2_ns} link del macv0 21 - ip netns del ${m2_ns} 22 - 23 - client_destroy 24 - server_destroy 25 - gateway_destroy 26 - } 27 - 28 - check_connection() 29 - { 30 - local ns=${1} 31 - local target=${2} 32 - local message=${3:-"macvlan_over_bond"} 33 - RET=0 34 - 35 - 36 - ip netns exec ${ns} ping ${target} -c 4 -i 0.1 &>/dev/null 37 - check_err $? "ping failed" 38 - log_test "$mode: $message" 39 - } 40 - 41 - macvlan_over_bond() 42 - { 43 - local param="$1" 44 - RET=0 45 - 46 - # setup new bond mode 47 - bond_reset "${param}" 48 - 49 - ip -n ${s_ns} link add link bond0 name macv0 type macvlan mode bridge 50 - ip -n ${s_ns} link set macv0 netns ${m1_ns} 51 - ip -n ${m1_ns} link set dev macv0 up 52 - ip -n ${m1_ns} addr add ${m1_ip4}/24 dev macv0 53 - ip -n ${m1_ns} addr add ${m1_ip6}/24 dev macv0 54 - 55 - ip -n ${s_ns} link add link bond0 name macv0 type macvlan mode bridge 56 - ip -n ${s_ns} link set macv0 netns ${m2_ns} 57 - ip -n ${m2_ns} link set dev macv0 up 58 - ip -n ${m2_ns} addr add ${m2_ip4}/24 dev macv0 59 - ip -n ${m2_ns} addr add ${m2_ip6}/24 dev macv0 60 - 61 - sleep 2 62 - 63 - check_connection "${c_ns}" "${s_ip4}" "IPv4: client->server" 64 - check_connection "${c_ns}" "${s_ip6}" "IPv6: client->server" 65 - check_connection "${c_ns}" "${m1_ip4}" "IPv4: client->macvlan_1" 66 - check_connection "${c_ns}" "${m1_ip6}" "IPv6: client->macvlan_1" 67 - check_connection "${c_ns}" "${m2_ip4}" "IPv4: client->macvlan_2" 68 - check_connection "${c_ns}" "${m2_ip6}" "IPv6: client->macvlan_2" 69 - check_connection "${m1_ns}" "${m2_ip4}" "IPv4: macvlan_1->macvlan_2" 70 - check_connection "${m1_ns}" "${m2_ip6}" "IPv6: macvlan_1->macvlan_2" 71 - 72 - 73 - sleep 5 74 - 75 - check_connection "${s_ns}" "${c_ip4}" "IPv4: server->client" 76 - check_connection "${s_ns}" "${c_ip6}" "IPv6: server->client" 77 - check_connection "${m1_ns}" "${c_ip4}" "IPv4: macvlan_1->client" 78 - check_connection "${m1_ns}" "${c_ip6}" "IPv6: macvlan_1->client" 79 - check_connection "${m2_ns}" "${c_ip4}" "IPv4: macvlan_2->client" 80 - check_connection "${m2_ns}" "${c_ip6}" "IPv6: macvlan_2->client" 81 - check_connection "${m2_ns}" "${m1_ip4}" "IPv4: macvlan_2->macvlan_2" 82 - check_connection "${m2_ns}" "${m1_ip6}" "IPv6: macvlan_2->macvlan_2" 83 - 84 - ip -n ${c_ns} neigh flush dev eth0 85 - } 86 - 87 - trap cleanup EXIT 88 - 89 - setup_prepare 90 - ip netns add ${m1_ns} 91 - ip netns add ${m2_ns} 92 - 93 - modes="active-backup balance-tlb balance-alb" 94 - 95 - for mode in $modes; do 96 - macvlan_over_bond "mode $mode" 97 - done 98 - 99 - exit $EXIT_STATUS
+96
tools/testing/selftests/drivers/net/bonding/bond_macvlan_ipvlan.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + # 4 + # Test macvlan/ipvlan over bond 5 + 6 + lib_dir=$(dirname "$0") 7 + source ${lib_dir}/bond_topo_2d1c.sh 8 + 9 + xvlan1_ns="xvlan1-$(mktemp -u XXXXXX)" 10 + xvlan2_ns="xvlan2-$(mktemp -u XXXXXX)" 11 + xvlan1_ip4="192.0.2.11" 12 + xvlan1_ip6="2001:db8::11" 13 + xvlan2_ip4="192.0.2.12" 14 + xvlan2_ip6="2001:db8::12" 15 + 16 + cleanup() 17 + { 18 + client_destroy 19 + server_destroy 20 + gateway_destroy 21 + 22 + ip netns del ${xvlan1_ns} 23 + ip netns del ${xvlan2_ns} 24 + } 25 + 26 + check_connection() 27 + { 28 + local ns=${1} 29 + local target=${2} 30 + local message=${3} 31 + RET=0 32 + 33 + ip netns exec ${ns} ping ${target} -c 4 -i 0.1 &>/dev/null 34 + check_err $? "ping failed" 35 + log_test "${bond_mode}/${xvlan_type}_${xvlan_mode}: ${message}" 36 + } 37 + 38 + xvlan_over_bond() 39 + { 40 + local param="$1" 41 + local xvlan_type="$2" 42 + local xvlan_mode="$3" 43 + RET=0 44 + 45 + # setup new bond mode 46 + bond_reset "${param}" 47 + 48 + ip -n ${s_ns} link add link bond0 name ${xvlan_type}0 type ${xvlan_type} mode ${xvlan_mode} 49 + ip -n ${s_ns} link set ${xvlan_type}0 netns ${xvlan1_ns} 50 + ip -n ${xvlan1_ns} link set dev ${xvlan_type}0 up 51 + ip -n ${xvlan1_ns} addr add ${xvlan1_ip4}/24 dev ${xvlan_type}0 52 + ip -n ${xvlan1_ns} addr add ${xvlan1_ip6}/24 dev ${xvlan_type}0 53 + 54 + ip -n ${s_ns} link add link bond0 name ${xvlan_type}0 type ${xvlan_type} mode ${xvlan_mode} 55 + ip -n ${s_ns} link set ${xvlan_type}0 netns ${xvlan2_ns} 56 + ip -n ${xvlan2_ns} link set dev ${xvlan_type}0 up 57 + ip -n ${xvlan2_ns} addr add ${xvlan2_ip4}/24 dev ${xvlan_type}0 58 + ip -n ${xvlan2_ns} addr add ${xvlan2_ip6}/24 dev ${xvlan_type}0 59 + 60 + sleep 2 61 + 62 + check_connection "${c_ns}" "${s_ip4}" "IPv4: client->server" 63 + check_connection "${c_ns}" "${s_ip6}" "IPv6: client->server" 64 + check_connection "${c_ns}" "${xvlan1_ip4}" "IPv4: client->${xvlan_type}_1" 65 + check_connection "${c_ns}" "${xvlan1_ip6}" "IPv6: client->${xvlan_type}_1" 66 + check_connection "${c_ns}" "${xvlan2_ip4}" "IPv4: client->${xvlan_type}_2" 67 + check_connection "${c_ns}" "${xvlan2_ip6}" "IPv6: client->${xvlan_type}_2" 68 + check_connection "${xvlan1_ns}" "${xvlan2_ip4}" "IPv4: ${xvlan_type}_1->${xvlan_type}_2" 69 + check_connection "${xvlan1_ns}" "${xvlan2_ip6}" "IPv6: ${xvlan_type}_1->${xvlan_type}_2" 70 + 71 + check_connection "${s_ns}" "${c_ip4}" "IPv4: server->client" 72 + check_connection "${s_ns}" "${c_ip6}" "IPv6: server->client" 73 + check_connection "${xvlan1_ns}" "${c_ip4}" "IPv4: ${xvlan_type}_1->client" 74 + check_connection "${xvlan1_ns}" "${c_ip6}" "IPv6: ${xvlan_type}_1->client" 75 + check_connection "${xvlan2_ns}" "${c_ip4}" "IPv4: ${xvlan_type}_2->client" 76 + check_connection "${xvlan2_ns}" "${c_ip6}" "IPv6: ${xvlan_type}_2->client" 77 + check_connection "${xvlan2_ns}" "${xvlan1_ip4}" "IPv4: ${xvlan_type}_2->${xvlan_type}_1" 78 + check_connection "${xvlan2_ns}" "${xvlan1_ip6}" "IPv6: ${xvlan_type}_2->${xvlan_type}_1" 79 + 80 + ip -n ${c_ns} neigh flush dev eth0 81 + } 82 + 83 + trap cleanup EXIT 84 + 85 + setup_prepare 86 + ip netns add ${xvlan1_ns} 87 + ip netns add ${xvlan2_ns} 88 + 89 + bond_modes="active-backup balance-tlb balance-alb" 90 + 91 + for bond_mode in ${bond_modes}; do 92 + xvlan_over_bond "mode ${bond_mode}" macvlan bridge 93 + xvlan_over_bond "mode ${bond_mode}" ipvlan l2 94 + done 95 + 96 + exit $EXIT_STATUS
+1
tools/testing/selftests/drivers/net/bonding/config
··· 3 3 CONFIG_DUMMY=y 4 4 CONFIG_IPV6=y 5 5 CONFIG_MACVLAN=y 6 + CONFIG_IPVLAN=y 6 7 CONFIG_NET_ACT_GACT=y 7 8 CONFIG_NET_CLS_FLOWER=y 8 9 CONFIG_NET_SCH_INGRESS=y