tools/testing/selftests/drivers/net/ocelot/basic_qos.sh

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

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/drivers/net/ocelot/basic_qos.sh
Extension
.sh
Size
4433 bytes
Lines
254
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
# Copyright 2022 NXP

# The script is mostly generic, with the exception of the
# ethtool per-TC counter names ("rx_green_prio_${tc}")

WAIT_TIME=1
NUM_NETIFS=4
STABLE_MAC_ADDRS=yes
NETIF_CREATE=no
lib_dir=$(dirname $0)/../../../net/forwarding
source $lib_dir/tc_common.sh
source $lib_dir/lib.sh

require_command dcb

h1=${NETIFS[p1]}
swp1=${NETIFS[p2]}
swp2=${NETIFS[p3]}
h2=${NETIFS[p4]}

H1_IPV4="192.0.2.1"
H2_IPV4="192.0.2.2"
H1_IPV6="2001:db8:1::1"
H2_IPV6="2001:db8:1::2"

h1_create()
{
	simple_if_init $h1 $H1_IPV4/24 $H1_IPV6/64
}

h1_destroy()
{
	simple_if_fini $h1 $H1_IPV4/24 $H1_IPV6/64
}

h2_create()
{
	simple_if_init $h2 $H2_IPV4/24 $H2_IPV6/64
}

h2_destroy()
{
	simple_if_fini $h2 $H2_IPV4/24 $H2_IPV6/64
}

h1_vlan_create()
{
	local vid=$1

	vlan_create $h1 $vid
	simple_if_init $h1.$vid $H1_IPV4/24 $H1_IPV6/64
	ip link set $h1.$vid type vlan \
		egress-qos-map 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7 \
		ingress-qos-map 0:0 1:1 2:2 3:3 4:4 5:5 6:6 7:7
}

h1_vlan_destroy()
{
	local vid=$1

	simple_if_fini $h1.$vid $H1_IPV4/24 $H1_IPV6/64
	vlan_destroy $h1 $vid
}

h2_vlan_create()
{
	local vid=$1

Annotation

Implementation Notes