tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh

Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/net/forwarding/mirror_gre_lag_lacp.sh
Extension
.sh
Size
7655 bytes
Lines
272
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 for "tc action mirred egress mirror" when the underlay route points at a
# team device.
#
# +----------------------+                             +----------------------+
# | H1                   |                             |                   H2 |
# |    + $h1.333         |                             |        $h1.555 +     |
# |    | 192.0.2.1/28    |                             |  192.0.2.18/28 |     |
# +----|-----------------+                             +----------------|-----+
#      |                                $h1                             |
#      +---------------------------------+------------------------------+
#                                        |
# +--------------------------------------|------------------------------------+
# | SW                                   o---> mirror                         |
# |                                      |                                    |
# |   +----------------------------------+------------------------------+     |
# |   |                                $swp1                            |     |
# |   + $swp1.333                                             $swp1.555 +     |
# |     192.0.2.2/28                                      192.0.2.17/28       |
# |                                                                           |
# |                                                                           |
# |   + gt4 (gretap)      ,-> + lag1 (team)                                   |
# |     loc=192.0.2.129   |   | 192.0.2.129/28                                |
# |     rem=192.0.2.130 --'   |                                               |
# |     ttl=100               |                                               |
# |     tos=inherit           |                                               |
# |      _____________________|______________________                         |
# |     /                                            \                        |
# |    /                                              \                       |
# |   + $swp3                                          + $swp4                |
# +---|------------------------------------------------|----------------------+
#     |                                                |
# +---|------------------------------------------------|----------------------+
# |   + $h3                                            + $h4               H3 |
# |    \                                              /                       |
# |     \____________________________________________/                        |
# |                           |                                               |
# |                           + lag2 (team)  ------>   + gt4-dst (gretap)     |
# |                             192.0.2.130/28           loc=192.0.2.130      |
# |                                                      rem=192.0.2.129      |
# |                                                      ttl=100              |
# |                                                      tos=inherit          |
# |                                                                           |
# |                                                                           |
# |                                                                           |
# |                                                                           |
# +---------------------------------------------------------------------------+

ALL_TESTS="
	test_mirror_gretap_first
	test_mirror_gretap_second
"

REQUIRE_TEAMD="yes"
NUM_NETIFS=6
source lib.sh
source mirror_lib.sh

vlan_host_create()
{
	local if_name=$1; shift
	local vid=$1; shift
	local vrf_name=$1; shift
	local ips=("${@}")

	vrf_create $vrf_name
	ip link set dev $vrf_name up
	vlan_create $if_name $vid $vrf_name "${ips[@]}"

Annotation

Implementation Notes