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

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/drivers/net/mlxsw/ingress_rif_conf_1q.sh
Extension
.sh
Size
6376 bytes
Lines
265
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
# mapping and that packets can be routed via port which is added after the FID
# already has a RIF.

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

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

ALL_TESTS="
	vid_map_rif
	rif_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