]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests: net: lib: Rename ip_link_add() to adf_*
authorPetr Machata <petrm@nvidia.com>
Thu, 25 Sep 2025 17:31:44 +0000 (19:31 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Sep 2025 00:48:36 +0000 (17:48 -0700)
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>
tools/testing/selftests/net/fdb_notify.sh
tools/testing/selftests/net/forwarding/bridge_activity_notify.sh
tools/testing/selftests/net/forwarding/bridge_fdb_local_vlan_0.sh
tools/testing/selftests/net/forwarding/vxlan_bridge_1q_mc_ul.sh
tools/testing/selftests/net/forwarding/vxlan_reserved.sh
tools/testing/selftests/net/lib.sh
tools/testing/selftests/net/test_vxlan_fdb_changelink.sh
tools/testing/selftests/net/vlan_bridge_binding.sh

index c159230c9b6237bfcc8637d9d8ef14c667bd7685..0a70f6383bfc421b8b01209013b143b6b747aa80 100755 (executable)
@@ -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
index a20ef4bd310b90954640dd499bdb83dad2ebe9f5..6f7df6325da542c3bddd4b8e74a12a863bedb715 100755 (executable)
@@ -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
 
index 65f74c46c2f38db58381ba6baae3332a91003919..d9de3ad6e16271ba7ffda51b8b05c0fb3b274e19 100755 (executable)
@@ -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
 }
index 462db0b603e786f011727a8e6b46e30bc18cc306..503b1176d55ff37490da3eb1db535cdd0b3c6884 100755 (executable)
@@ -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
index 46c31794b91b3ca29593c914f481d3017625eeed..692644c3a48921961e4c0107b689f9031575c5bd 100755 (executable)
@@ -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
index fea9c37fe3387b1bc3a65085994a3d64d78d66a9..7fbd9e5ce2be9e7f3200753ba84300e1dcb3c06e 100644 (file)
@@ -543,7 +543,7 @@ require_command()
        fi
 }
 
-ip_link_add()
+adf_ip_link_add()
 {
        local name=$1; shift
 
index 062f957950af3d99804b9f8ec30a283d433e9420..1443b57a6501a345d3f3b72e314c7e59a51449f7 100755 (executable)
@@ -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" \
index e7cb8c678bdeea54d79b5264a8ee22b6d5419795..7797507cd14fbab6b9a02c470f75401b2cf80231 100755 (executable)
@@ -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()