tools/testing/selftests/drivers/net/mlxsw/ingress_rif_conf_1d.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/drivers/net/mlxsw/ingress_rif_conf_1d.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/drivers/net/mlxsw/ingress_rif_conf_1d.sh
Extension
.sh
Size
6293 bytes
Lines
264
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: tools
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0

# Test routing over bridge and verify that the order of configuration does not
# impact switch behavior. Verify that RIF is added correctly for existing
# mappings and that new mappings use the correct RIF.

# +-------------------+                   +--------------------+
# | H1                |                   | H2                 |
# |                   |                   |                    |
# |         $h1.10 +  |                   |  + $h2.10          |
# |   192.0.2.1/28 |  |                   |  | 192.0.2.3/28    |
# |                |  |                   |  |                 |
# |            $h1 +  |                   |  + $h2             |
# +----------------|--+                   +--|-----------------+
#                  |                         |
# +----------------|-------------------------|-----------------+
# | SW       $swp1 +                         + $swp2           |
# |                |                         |                 |
# | +--------------|-------------------------|---------------+ |
# | |     $swp1.10 +                         + $swp2.10      | |
# | |                                                        | |
# | |                           br0                          | |
# | |                       192.0.2.2/28                     | |
# | +--------------------------------------------------------+ |
# |                                                            |
# |      $swp3.10 +                                            |
# | 192.0.2.17/28 |                                            |
# |               |                                            |
# |         $swp3 +                                            |
# +---------------|--------------------------------------------+
#                 |
# +---------------|--+
# |           $h3 +  |
# |               |  |
# |        $h3.10 +  |
# | 192.0.2.18/28    |
# |                  |
# | H3               |
# +------------------+

lib_dir=$(dirname $0)/../../../net/forwarding

ALL_TESTS="
	port_vid_map_rif
	rif_port_vid_map
"

NUM_NETIFS=6
source $lib_dir/lib.sh
source $lib_dir/tc_common.sh
source $lib_dir/devlink_lib.sh

h1_create()
{
	simple_if_init $h1
	vlan_create $h1 10 v$h1 192.0.2.1/28

	ip route add 192.0.2.16/28 vrf v$h1 nexthop via 192.0.2.2
}

h1_destroy()
{
	ip route del 192.0.2.16/28 vrf v$h1 nexthop via 192.0.2.2

	vlan_destroy $h1 10
	simple_if_fini $h1
}

h2_create()

Annotation

Implementation Notes