mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
selftests: net: lib: Rename ip_link_add() to adf_*
Rename this function to mark it as autodefer. For details, see the discussion in the cover letter. Signed-off-by: Petr Machata <petrm@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/0b163cca1bf2ec44270e0fc89108f488d99d9c9d.1758821127.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
9ccec26623
commit
191c4912f9
|
|
@ -40,15 +40,15 @@ do_test_dup()
|
|||
|
||||
test_dup_bridge()
|
||||
{
|
||||
ip_link_add br up type bridge vlan_filtering 1
|
||||
adf_ip_link_add br up type bridge vlan_filtering 1
|
||||
do_test_dup add "bridge" dev br self
|
||||
do_test_dup del "bridge" dev br self
|
||||
}
|
||||
|
||||
test_dup_vxlan_self()
|
||||
{
|
||||
ip_link_add br up type bridge vlan_filtering 1
|
||||
ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
adf_ip_link_add br up type bridge vlan_filtering 1
|
||||
adf_ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
ip_link_set_master vx br
|
||||
|
||||
do_test_dup add "vxlan" dev vx self dst 192.0.2.1
|
||||
|
|
@ -57,8 +57,8 @@ test_dup_vxlan_self()
|
|||
|
||||
test_dup_vxlan_master()
|
||||
{
|
||||
ip_link_add br up type bridge vlan_filtering 1
|
||||
ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
adf_ip_link_add br up type bridge vlan_filtering 1
|
||||
adf_ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
ip_link_set_master vx br
|
||||
|
||||
do_test_dup add "vxlan master" dev vx master
|
||||
|
|
@ -67,8 +67,8 @@ test_dup_vxlan_master()
|
|||
|
||||
test_dup_macvlan_self()
|
||||
{
|
||||
ip_link_add dd up type dummy
|
||||
ip_link_add mv up link dd type macvlan mode passthru
|
||||
adf_ip_link_add dd up type dummy
|
||||
adf_ip_link_add mv up link dd type macvlan mode passthru
|
||||
|
||||
do_test_dup add "macvlan self" dev mv self
|
||||
do_test_dup del "macvlan self" dev mv self
|
||||
|
|
@ -76,9 +76,9 @@ test_dup_macvlan_self()
|
|||
|
||||
test_dup_macvlan_master()
|
||||
{
|
||||
ip_link_add br up type bridge vlan_filtering 1
|
||||
ip_link_add dd up type dummy
|
||||
ip_link_add mv up link dd type macvlan mode passthru
|
||||
adf_ip_link_add br up type bridge vlan_filtering 1
|
||||
adf_ip_link_add dd up type dummy
|
||||
adf_ip_link_add mv up link dd type macvlan mode passthru
|
||||
ip_link_set_master mv br
|
||||
|
||||
do_test_dup add "macvlan master" dev mv self
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ h2_create()
|
|||
|
||||
switch_create()
|
||||
{
|
||||
ip_link_add br1 type bridge vlan_filtering 0 mcast_snooping 0 \
|
||||
adf_ip_link_add br1 type bridge vlan_filtering 0 mcast_snooping 0 \
|
||||
ageing_time "$LOW_AGEING_TIME"
|
||||
ip_link_set_up br1
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ adf_bridge_create()
|
|||
{
|
||||
local mac
|
||||
|
||||
ip_link_add br up type bridge vlan_default_pvid 0 "$@"
|
||||
adf_ip_link_add br up type bridge vlan_default_pvid 0 "$@"
|
||||
mac=$(mac_get br)
|
||||
adf_bridge_configure
|
||||
ip_link_set_addr br "$mac"
|
||||
|
|
@ -142,8 +142,8 @@ adf_bridge_create()
|
|||
|
||||
check_fdb_local_vlan_0_support()
|
||||
{
|
||||
if ip_link_add XXbr up type bridge vlan_filtering 1 fdb_local_vlan_0 1 \
|
||||
&>/dev/null; then
|
||||
if adf_ip_link_add XXbr up type bridge vlan_filtering 1 \
|
||||
fdb_local_vlan_0 1 &>/dev/null; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ test_q_sharing()
|
|||
|
||||
adf_addr_set_bridge_create()
|
||||
{
|
||||
ip_link_add br up type bridge vlan_filtering 0
|
||||
adf_ip_link_add br up type bridge vlan_filtering 0
|
||||
ip_link_set_addr br "$(mac_get br)"
|
||||
adf_bridge_configure
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,11 +122,11 @@ h1_create()
|
|||
simple_if_init "$h1"
|
||||
defer simple_if_fini "$h1"
|
||||
|
||||
ip_link_add "$h1.10" master "v$h1" link "$h1" type vlan id 10
|
||||
adf_ip_link_add "$h1.10" master "v$h1" link "$h1" type vlan id 10
|
||||
ip_link_set_up "$h1.10"
|
||||
ip_addr_add "$h1.10" 192.0.2.1/28
|
||||
|
||||
ip_link_add "$h1.20" master "v$h1" link "$h1" type vlan id 20
|
||||
adf_ip_link_add "$h1.20" master "v$h1" link "$h1" type vlan id 20
|
||||
ip_link_set_up "$h1.20"
|
||||
ip_addr_add "$h1.20" 2001:db8:1::1/64
|
||||
}
|
||||
|
|
@ -161,7 +161,7 @@ h2_create()
|
|||
ip_link_set_up "v$h2"
|
||||
|
||||
# br2
|
||||
ip_link_add br2 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
adf_ip_link_add br2 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
ip_link_set_master br2 "v$h2"
|
||||
ip_link_set_up br2
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ h3_create()
|
|||
ip_link_set_up "v$h3"
|
||||
|
||||
# br3
|
||||
ip_link_add br3 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
adf_ip_link_add br3 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
ip_link_set_master br3 "v$h3"
|
||||
ip_link_set_up br3
|
||||
|
||||
|
|
@ -205,17 +205,17 @@ switch_create()
|
|||
|
||||
# br1
|
||||
swp1_mac=$(mac_get "$swp1")
|
||||
ip_link_add br1 type bridge vlan_filtering 1 \
|
||||
adf_ip_link_add br1 type bridge vlan_filtering 1 \
|
||||
vlan_default_pvid 0 mcast_snooping 0
|
||||
ip_link_set_addr br1 "$swp1_mac"
|
||||
ip_link_set_up br1
|
||||
|
||||
# A dummy to force the IPv6 OIF=0 test to install a suitable MC route on
|
||||
# $IPMR to be deterministic. Also used for the IPv6 RX!=TX ping test.
|
||||
ip_link_add "X$IPMR" up type dummy
|
||||
adf_ip_link_add "X$IPMR" up type dummy
|
||||
|
||||
# IPMR
|
||||
ip_link_add "$IPMR" up type dummy
|
||||
adf_ip_link_add "$IPMR" up type dummy
|
||||
ip_addr_add "$IPMR" 192.0.2.100/28
|
||||
ip_addr_add "$IPMR" 2001:db8:4::1/64
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ vx_create()
|
|||
local name=$1; shift
|
||||
local vid=$1; shift
|
||||
|
||||
ip_link_add "$name" up type vxlan dstport "$VXPORT" \
|
||||
adf_ip_link_add "$name" up type vxlan dstport "$VXPORT" \
|
||||
nolearning noudpcsum tos inherit ttl 16 \
|
||||
"$@"
|
||||
ip_link_set_master "$name" br1
|
||||
|
|
@ -295,7 +295,7 @@ ns_init_common()
|
|||
ip_addr_add "$if_in" "$ipv6_in"
|
||||
|
||||
# br1
|
||||
ip_link_add br1 type bridge vlan_filtering 1 \
|
||||
adf_ip_link_add br1 type bridge vlan_filtering 1 \
|
||||
vlan_default_pvid 0 mcast_snooping 0
|
||||
ip_link_set_up br1
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ ns_init_common()
|
|||
vx20_create local "${ipv6_in%/*}" group "$GROUP6" dev "$if_in"
|
||||
|
||||
# w1
|
||||
ip_link_add w1 type veth peer name w2
|
||||
adf_ip_link_add w1 type veth peer name w2
|
||||
ip_link_set_master w1 br1
|
||||
ip_link_set_up w1
|
||||
bridge_vlan_add vid 10 dev w1
|
||||
|
|
@ -315,12 +315,12 @@ ns_init_common()
|
|||
defer simple_if_fini w2
|
||||
|
||||
# w2.10
|
||||
ip_link_add w2.10 master vw2 link w2 type vlan id 10
|
||||
adf_ip_link_add w2.10 master vw2 link w2 type vlan id 10
|
||||
ip_link_set_up w2.10
|
||||
ip_addr_add w2.10 "$ipv4_host"
|
||||
|
||||
# w2.20
|
||||
ip_link_add w2.20 master vw2 link w2 type vlan id 20
|
||||
adf_ip_link_add w2.20 master vw2 link w2 type vlan id 20
|
||||
ip_link_set_up w2.20
|
||||
ip_addr_add w2.20 "$ipv6_host"
|
||||
}
|
||||
|
|
@ -377,8 +377,8 @@ setup_prepare()
|
|||
forwarding_enable
|
||||
defer forwarding_restore
|
||||
|
||||
ip_link_add "v1$h2" type veth peer name "v2$h2"
|
||||
ip_link_add "v1$h3" type veth peer name "v2$h3"
|
||||
adf_ip_link_add "v1$h2" type veth peer name "v2$h2"
|
||||
adf_ip_link_add "v1$h3" type veth peer name "v2$h3"
|
||||
|
||||
h1_create
|
||||
h2_create
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ h1_create()
|
|||
|
||||
switch_create()
|
||||
{
|
||||
ip_link_add br1 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
adf_ip_link_add br1 type bridge vlan_filtering 0 mcast_snooping 0
|
||||
# Make sure the bridge uses the MAC address of the local port and not
|
||||
# that of the VxLAN's device.
|
||||
ip_link_set_addr br1 $(mac_get $swp1)
|
||||
|
|
@ -200,7 +200,7 @@ vxlan_ping_do()
|
|||
|
||||
vxlan_device_add()
|
||||
{
|
||||
ip_link_add vx1 up type vxlan id 1000 \
|
||||
adf_ip_link_add vx1 up type vxlan id 1000 \
|
||||
local 192.0.2.17 dstport "$VXPORT" \
|
||||
nolearning noudpcsum tos inherit ttl 100 "$@"
|
||||
ip_link_set_master vx1 br1
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ require_command()
|
|||
fi
|
||||
}
|
||||
|
||||
ip_link_add()
|
||||
adf_ip_link_add()
|
||||
{
|
||||
local name=$1; shift
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ test_set_remote()
|
|||
{
|
||||
RET=0
|
||||
|
||||
ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
adf_ip_link_add vx up type vxlan id 2000 dstport 4789
|
||||
bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.20 self permanent
|
||||
bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.30 self permanent
|
||||
check_remotes "fdb append"
|
||||
|
|
@ -74,12 +74,12 @@ test_change_mc_remote()
|
|||
{
|
||||
check_command netstat || return
|
||||
|
||||
ip_link_add v1 up type veth peer name v2
|
||||
adf_ip_link_add v1 up type veth peer name v2
|
||||
ip_link_set_up v2
|
||||
|
||||
RET=0
|
||||
|
||||
ip_link_add vx up type vxlan dstport 4789 \
|
||||
adf_ip_link_add vx up type vxlan dstport 4789 \
|
||||
local 192.0.2.1 $(fmt_remote 224.1.1.1) dev v1 vni 1000
|
||||
|
||||
check_membership "group=224.1.1.1 fail=0" \
|
||||
|
|
|
|||
|
|
@ -18,10 +18,10 @@ setup_prepare()
|
|||
{
|
||||
local port
|
||||
|
||||
ip_link_add br up type bridge vlan_filtering 1
|
||||
adf_ip_link_add br up type bridge vlan_filtering 1
|
||||
|
||||
for port in d1 d2 d3; do
|
||||
ip_link_add $port type veth peer name r$port
|
||||
adf_ip_link_add $port type veth peer name r$port
|
||||
ip_link_set_up $port
|
||||
ip_link_set_up r$port
|
||||
ip_link_set_master $port br
|
||||
|
|
@ -74,7 +74,7 @@ add_one_vlan()
|
|||
local link=$1; shift
|
||||
local id=$1; shift
|
||||
|
||||
ip_link_add $link.$id link $link type vlan id $id "$@"
|
||||
adf_ip_link_add $link.$id link $link type vlan id $id "$@"
|
||||
}
|
||||
|
||||
add_vlans()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user