~ [ source navigation ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/net/forwarding/

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Name Size Last modified (GMT) Description
Back Parent directory 2024-11-11 14:31:54
File Makefile 2955 bytes 2024-11-11 14:31:54
File README 3529 bytes 2024-11-11 14:31:54
File bridge_fdb_learning_limit.sh 5941 bytes 2024-11-11 14:31:54
File bridge_igmp.sh 15061 bytes 2024-11-11 14:31:54
File bridge_locked_port.sh 9469 bytes 2024-11-11 14:31:54
File bridge_mdb.sh 46232 bytes 2024-11-11 14:31:54
File bridge_mdb_host.sh 1701 bytes 2024-11-11 14:31:54
File bridge_mdb_max.sh 30698 bytes 2024-11-11 14:31:54
File bridge_mdb_port_down.sh 2292 bytes 2024-11-11 14:31:54
File bridge_mld.sh 16563 bytes 2024-11-11 14:31:54
File bridge_port_isolation.sh 2378 bytes 2024-11-11 14:31:54
File bridge_sticky_fdb.sh 1159 bytes 2024-11-11 14:31:54
File bridge_vlan_aware.sh 4299 bytes 2024-11-11 14:31:54
File bridge_vlan_mcast.sh 17146 bytes 2024-11-11 14:31:54
File bridge_vlan_unaware.sh 1241 bytes 2024-11-11 14:31:54
File config 1191 bytes 2024-11-11 14:31:54
File custom_multipath_hash.sh 10035 bytes 2024-11-11 14:31:54
File devlink_lib.sh 13141 bytes 2024-11-11 14:31:54
File dual_vxlan_bridge.sh 11477 bytes 2024-11-11 14:31:54
File fib_offload_lib.sh 25157 bytes 2024-11-11 14:31:54
File forwarding.config.sample 706 bytes 2024-11-11 14:31:54
File gre_custom_multipath_hash.sh 12810 bytes 2024-11-11 14:31:54
File gre_inner_v4_multipath.sh 7734 bytes 2024-11-11 14:31:54
File gre_inner_v6_multipath.sh 7847 bytes 2024-11-11 14:31:54
File gre_multipath.sh 6443 bytes 2024-11-11 14:31:54
File gre_multipath_nh.sh 8296 bytes 2024-11-11 14:31:54
File gre_multipath_nh_res.sh 8452 bytes 2024-11-11 14:31:54
File ip6_forward_instats_vrf.sh 3118 bytes 2024-11-11 14:31:54
File ip6gre_custom_multipath_hash.sh 13080 bytes 2024-11-11 14:31:54
File ip6gre_flat.sh 1206 bytes 2024-11-11 14:31:54
File ip6gre_flat_key.sh 1273 bytes 2024-11-11 14:31:54
File ip6gre_flat_keys.sh 1334 bytes 2024-11-11 14:31:54
File ip6gre_hier.sh 1299 bytes 2024-11-11 14:31:54
File ip6gre_hier_key.sh 1367 bytes 2024-11-11 14:31:54
File ip6gre_hier_keys.sh 1425 bytes 2024-11-11 14:31:54
File ip6gre_inner_v4_multipath.sh 7960 bytes 2024-11-11 14:31:54
File ip6gre_inner_v6_multipath.sh 8073 bytes 2024-11-11 14:31:54
File ip6gre_lib.sh 16124 bytes 2024-11-11 14:31:54
File ipip_flat_gre.sh 838 bytes 2024-11-11 14:31:54
File ipip_flat_gre_key.sh 860 bytes 2024-11-11 14:31:54
File ipip_flat_gre_keys.sh 886 bytes 2024-11-11 14:31:54
File ipip_hier_gre.sh 887 bytes 2024-11-11 14:31:54
File ipip_hier_gre_key.sh 910 bytes 2024-11-11 14:31:54
File ipip_hier_gre_keys.sh 938 bytes 2024-11-11 14:31:54
File ipip_lib.sh 8543 bytes 2024-11-11 14:31:54
File lib.sh 45663 bytes 2024-11-11 14:31:54
File lib_sh_test.sh 3659 bytes 2024-11-11 14:31:54
File local_termination.sh 14777 bytes 2024-11-11 14:31:54
File min_max_mtu.sh 4856 bytes 2024-11-11 14:31:54
File mirror_gre.sh 2968 bytes 2024-11-11 14:31:54
File mirror_gre_bound.sh 5640 bytes 2024-11-11 14:31:54
File mirror_gre_bridge_1d.sh 4214 bytes 2024-11-11 14:31:54
File mirror_gre_bridge_1d_vlan.sh 2429 bytes 2024-11-11 14:31:54
File mirror_gre_bridge_1q.sh 4070 bytes 2024-11-11 14:31:54
File mirror_gre_bridge_1q_lag.sh 7172 bytes 2024-11-11 14:31:54
File mirror_gre_changes.sh 5293 bytes 2024-11-11 14:31:54
File mirror_gre_flower.sh 2673 bytes 2024-11-11 14:31:54
File mirror_gre_lag_lacp.sh 7635 bytes 2024-11-11 14:31:54
File mirror_gre_lib.sh 3736 bytes 2024-11-11 14:31:54
File mirror_gre_neigh.sh 2126 bytes 2024-11-11 14:31:54
File mirror_gre_nh.sh 2591 bytes 2024-11-11 14:31:54
File mirror_gre_topo_lib.sh 3529 bytes 2024-11-11 14:31:54
File mirror_gre_vlan.sh 1396 bytes 2024-11-11 14:31:54
File mirror_gre_vlan_bridge_1q.sh 8659 bytes 2024-11-11 14:31:54
File mirror_lib.sh 3807 bytes 2024-11-11 14:31:54
File mirror_topo_lib.sh 2796 bytes 2024-11-11 14:31:54
File mirror_vlan.sh 1902 bytes 2024-11-11 14:31:54
File no_forwarding.sh 5649 bytes 2024-11-11 14:31:54
File pedit_dsfield.sh 6848 bytes 2024-11-11 14:31:54
File pedit_ip.sh 4511 bytes 2024-11-11 14:31:54
File pedit_l4port.sh 4564 bytes 2024-11-11 14:31:54
File q_in_vni.sh 10964 bytes 2024-11-11 14:31:54
File q_in_vni_ipv6.sh 11130 bytes 2024-11-11 14:31:54
File router.sh 7492 bytes 2024-11-11 14:31:54
File router_bridge.sh 4069 bytes 2024-11-11 14:31:54
File router_bridge_1d.sh 5223 bytes 2024-11-11 14:31:54
File router_bridge_1d_lag.sh 9508 bytes 2024-11-11 14:31:54
File router_bridge_lag.sh 6965 bytes 2024-11-11 14:31:54
File router_bridge_pvid_vlan_upper.sh 3584 bytes 2024-11-11 14:31:54
File router_bridge_vlan.sh 5592 bytes 2024-11-11 14:31:54
File router_bridge_vlan_upper.sh 4009 bytes 2024-11-11 14:31:54
File router_bridge_vlan_upper_pvid.sh 3792 bytes 2024-11-11 14:31:54
File router_broadcast.sh 5142 bytes 2024-11-11 14:31:54
File router_mpath_nh.sh 10988 bytes 2024-11-11 14:31:54
File router_mpath_nh_lib.sh 3280 bytes 2024-11-11 14:31:54
File router_mpath_nh_res.sh 13020 bytes 2024-11-11 14:31:54
File router_mpath_seed.sh 7551 bytes 2024-11-11 14:31:54
File router_multicast.sh 14953 bytes 2024-11-11 14:31:54
File router_multipath.sh 7238 bytes 2024-11-11 14:31:54
File router_nh.sh 3389 bytes 2024-11-11 14:31:54
File router_vid_1.sh 3607 bytes 2024-11-11 14:31:54
File sch_ets.sh 781 bytes 2024-11-11 14:31:54
File sch_ets_core.sh 7456 bytes 2024-11-11 14:31:54
File sch_ets_tests.sh 4159 bytes 2024-11-11 14:31:54
File sch_red.sh 11428 bytes 2024-11-11 14:31:54
File sch_tbf_core.sh 5154 bytes 2024-11-11 14:31:54
File sch_tbf_ets.sh 118 bytes 2024-11-11 14:31:54
File sch_tbf_etsprio.sh 1390 bytes 2024-11-11 14:31:54
File sch_tbf_prio.sh 118 bytes 2024-11-11 14:31:54
File sch_tbf_root.sh 489 bytes 2024-11-11 14:31:54
File settings 10 bytes 2024-11-11 14:31:54
File skbedit_priority.sh 3960 bytes 2024-11-11 14:31:54
File tc_actions.sh 9519 bytes 2024-11-11 14:31:54
File tc_chains.sh 4945 bytes 2024-11-11 14:31:54
File tc_common.sh 710 bytes 2024-11-11 14:31:54
File tc_flower.sh 21752 bytes 2024-11-11 14:31:54
File tc_flower_cfm.sh 4968 bytes 2024-11-11 14:31:54
File tc_flower_l2_miss.sh 9353 bytes 2024-11-11 14:31:54
File tc_flower_port_range.sh 6087 bytes 2024-11-11 14:31:54
File tc_flower_router.sh 3096 bytes 2024-11-11 14:31:54
File tc_mpls_l2vpn.sh 5146 bytes 2024-11-11 14:31:54
File tc_police.sh 12111 bytes 2024-11-11 14:31:54
File tc_shblocks.sh 2748 bytes 2024-11-11 14:31:54
File tc_tunnel_key.sh 3794 bytes 2024-11-11 14:31:54
File tc_vlan_modify.sh 3246 bytes 2024-11-11 14:31:54
File tsn_lib.sh 5601 bytes 2024-11-11 14:31:54
File vxlan_asymmetric.sh 17974 bytes 2024-11-11 14:31:54
File vxlan_asymmetric_ipv6.sh 16416 bytes 2024-11-11 14:31:54
File vxlan_bridge_1d.sh 20893 bytes 2024-11-11 14:31:54
File vxlan_bridge_1d_ipv6.sh 21821 bytes 2024-11-11 14:31:54
File vxlan_bridge_1d_port_8472.sh 172 bytes 2024-11-11 14:31:54
File vxlan_bridge_1d_port_8472_ipv6.sh 188 bytes 2024-11-11 14:31:54
File vxlan_bridge_1q.sh 23462 bytes 2024-11-11 14:31:54
File vxlan_bridge_1q_ipv6.sh 24931 bytes 2024-11-11 14:31:54
File vxlan_bridge_1q_port_8472.sh 172 bytes 2024-11-11 14:31:54
File vxlan_bridge_1q_port_8472_ipv6.sh 188 bytes 2024-11-11 14:31:54
File vxlan_symmetric.sh 18488 bytes 2024-11-11 14:31:54
File vxlan_symmetric_ipv6.sh 18750 bytes 2024-11-11 14:31:54

  1 Motivation
  2 ==========
  3 
  4 One of the nice things about network namespaces is that they allow one
  5 to easily create and test complex environments.
  6 
  7 Unfortunately, these namespaces can not be used with actual switching
  8 ASICs, as their ports can not be migrated to other network namespaces
  9 (dev->netns_local) and most of them probably do not support the
 10 L1-separation provided by namespaces.
 11 
 12 However, a similar kind of flexibility can be achieved by using VRFs and
 13 by looping the switch ports together. For example:
 14 
 15                              br0
 16                               +
 17                vrf-h1         |           vrf-h2
 18                  +        +---+----+        +
 19                  |        |        |        |
 20     192.0.2.1/24 +        +        +        + 192.0.2.2/24
 21                swp1     swp2     swp3     swp4
 22                  +        +        +        +
 23                  |        |        |        |
 24                  +--------+        +--------+
 25 
 26 The VRFs act as lightweight namespaces representing hosts connected to
 27 the switch.
 28 
 29 This approach for testing switch ASICs has several advantages over the
 30 traditional method that requires multiple physical machines, to name a
 31 few:
 32 
 33 1. Only the device under test (DUT) is being tested without noise from
 34 other system.
 35 
 36 2. Ability to easily provision complex topologies. Testing bridging
 37 between 4-ports LAGs or 8-way ECMP requires many physical links that are
 38 not always available. With the VRF-based approach one merely needs to
 39 loopback more ports.
 40 
 41 These tests are written with switch ASICs in mind, but they can be run
 42 on any Linux box using veth pairs to emulate physical loopbacks.
 43 
 44 Guidelines for Writing Tests
 45 ============================
 46 
 47 o Where possible, reuse an existing topology for different tests instead
 48   of recreating the same topology.
 49 o Tests that use anything but the most trivial topologies should include
 50   an ASCII art showing the topology.
 51 o Where possible, IPv6 and IPv4 addresses shall conform to RFC 3849 and
 52   RFC 5737, respectively.
 53 o Where possible, tests shall be written so that they can be reused by
 54   multiple topologies and added to lib.sh.
 55 o Checks shall be added to lib.sh for any external dependencies.
 56 o Code shall be checked using ShellCheck [1] prior to submission.
 57 
 58 1. https://www.shellcheck.net/
 59 
 60 Customization
 61 =============
 62 
 63 The forwarding selftests framework uses a number of variables that
 64 influence its behavior and tools it invokes, and how it invokes them, in
 65 various ways. A number of these variables can be overridden. The way these
 66 overridable variables are specified is typically one of the following two
 67 syntaxes:
 68 
 69         : "${VARIABLE:=default_value}"
 70         VARIABLE=${VARIABLE:=default_value}
 71 
 72 Any of these variables can be overridden. Notably net/forwarding/lib.sh and
 73 net/lib.sh contain a number of overridable variables.
 74 
 75 One way of overriding these variables is through the environment:
 76 
 77         PAUSE_ON_FAIL=yes ./some_test.sh
 78 
 79 The variable NETIFS is special. Since it is an array variable, there is no
 80 way to pass it through the environment. Its value can instead be given as
 81 consecutive arguments to the selftest:
 82 
 83         ./some_test.sh swp{1..8}
 84 
 85 A way to customize variables in a persistent fashion is to create a file
 86 named forwarding.config in this directory. lib.sh sources the file if
 87 present, so it can contain any shell code. Typically it will contain
 88 assignments of variables whose value should be overridden.
 89 
 90 forwarding.config.sample is available in the directory as an example of
 91 how forwarding.config might look.

~ [ source navigation ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php