__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/bin/bash # SPDX-License-Identifier: GPL-2.0 # Copyright(c) 2020 Intel Corporation, Weqaar Janjua <[email protected]> # AF_XDP selftests based on veth # # End-to-end AF_XDP over Veth test # # Topology: # --------- # ----------- # _ | Process | _ # / ----------- \ # / | \ # / | \ # ----------- | ----------- # | Thread1 | | | Thread2 | # ----------- | ----------- # | | | # ----------- | ----------- # | xskX | | | xskY | # ----------- | ----------- # | | | # ----------- | ---------- # | vethX | --------- | vethY | # ----------- peer ---------- # # AF_XDP is an address family optimized for high performance packet processing, # it is XDP’s user-space interface. # # An AF_XDP socket is linked to a single UMEM which is a region of virtual # contiguous memory, divided into equal-sized frames. # # Refer to AF_XDP Kernel Documentation for detailed information: # https://www.kernel.org/doc/html/latest/networking/af_xdp.html # # Prerequisites setup by script: # # Set up veth interfaces as per the topology shown ^^: # * setup two veth interfaces # ** veth<xxxx> # ** veth<yyyy> # *** xxxx and yyyy are randomly generated 4 digit numbers used to avoid # conflict with any existing interface # * tests the veth and xsk layers of the topology # # See the source xskxceiver.c for information on each test # # Kernel configuration: # --------------------- # See "config" file for recommended kernel config options. # # Turn on XDP sockets and veth support when compiling i.e. # Networking support --> # Networking options --> # [ * ] XDP sockets # # Executing Tests: # ---------------- # Must run with CAP_NET_ADMIN capability. # # Run: # sudo ./test_xsk.sh # # If running from kselftests: # sudo make run_tests # # Run with verbose output: # sudo ./test_xsk.sh -v # # Set up veth interfaces and leave them up so xskxceiver can be launched in a debugger: # sudo ./test_xsk.sh -d # # Run test suite for physical device in loopback mode # sudo ./test_xsk.sh -i IFACE # # Run test suite in a specific mode only [skb,drv,zc] # sudo ./test_xsk.sh -m MODE # # List available tests # ./test_xsk.sh -l # # Run a specific test from the test suite # sudo ./test_xsk.sh -t TEST_NAME # # Display the available command line options # ./test_xsk.sh -h . xsk_prereqs.sh ETH="" while getopts "vi:dm:lt:h" flag do case "${flag}" in v) verbose=1;; d) debug=1;; i) ETH=${OPTARG};; m) MODE=${OPTARG};; l) list=1;; t) TEST=${OPTARG};; h) help=1;; esac done TEST_NAME="PREREQUISITES" URANDOM=/dev/urandom [ ! -e "${URANDOM}" ] && { echo "${URANDOM} not found. Skipping tests."; test_exit $ksft_fail; } VETH0_POSTFIX=$(cat ${URANDOM} | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 4) VETH0=ve${VETH0_POSTFIX} VETH1_POSTFIX=$(cat ${URANDOM} | tr -dc '0-9' | fold -w 256 | head -n 1 | head --bytes 4) VETH1=ve${VETH1_POSTFIX} MTU=1500 trap ctrl_c INT function ctrl_c() { cleanup_exit ${VETH0} ${VETH1} exit 1 } setup_vethPairs() { if [[ $verbose -eq 1 ]]; then echo "setting up ${VETH0}" fi ip link add ${VETH0} numtxqueues 4 numrxqueues 4 type veth peer name ${VETH1} numtxqueues 4 numrxqueues 4 if [ -f /proc/net/if_inet6 ]; then echo 1 > /proc/sys/net/ipv6/conf/${VETH0}/disable_ipv6 echo 1 > /proc/sys/net/ipv6/conf/${VETH1}/disable_ipv6 fi if [[ $verbose -eq 1 ]]; then echo "setting up ${VETH1}" fi if [[ $busy_poll -eq 1 ]]; then echo 2 > /sys/class/net/${VETH0}/napi_defer_hard_irqs echo 200000 > /sys/class/net/${VETH0}/gro_flush_timeout echo 2 > /sys/class/net/${VETH1}/napi_defer_hard_irqs echo 200000 > /sys/class/net/${VETH1}/gro_flush_timeout fi ip link set ${VETH1} mtu ${MTU} ip link set ${VETH0} mtu ${MTU} ip link set ${VETH1} up ip link set ${VETH0} up } if [[ $list -eq 1 ]]; then ./${XSKOBJ} -l exit fi if [[ $help -eq 1 ]]; then ./${XSKOBJ} exit fi if [ ! -z $ETH ]; then VETH0=${ETH} VETH1=${ETH} else validate_root_exec validate_veth_support ${VETH0} validate_ip_utility setup_vethPairs retval=$? if [ $retval -ne 0 ]; then test_status $retval "${TEST_NAME}" cleanup_exit ${VETH0} ${VETH1} exit $retval fi fi if [[ $verbose -eq 1 ]]; then ARGS+="-v " fi if [ -n "$MODE" ]; then ARGS+="-m ${MODE} " fi if [ -n "$TEST" ]; then ARGS+="-t ${TEST} " fi retval=$? test_status $retval "${TEST_NAME}" ## START TESTS statusList=() TEST_NAME="XSK_SELFTESTS_${VETH0}_SOFTIRQ" if [[ $debug -eq 1 ]]; then echo "-i" ${VETH0} "-i" ${VETH1} exit fi exec_xskxceiver if [ -z $ETH ]; then cleanup_exit ${VETH0} ${VETH1} else cleanup_iface ${ETH} ${MTU} fi if [[ $list -eq 1 ]]; then exit fi TEST_NAME="XSK_SELFTESTS_${VETH0}_BUSY_POLL" busy_poll=1 if [ -z $ETH ]; then setup_vethPairs fi exec_xskxceiver ## END TESTS if [ -z $ETH ]; then cleanup_exit ${VETH0} ${VETH1} else cleanup_iface ${ETH} ${MTU} fi failures=0 echo -e "\nSummary:" for i in "${!statusList[@]}" do if [ ${statusList[$i]} -ne 0 ]; then test_status ${statusList[$i]} ${nameList[$i]} failures=1 fi done if [ $failures -eq 0 ]; then echo "All tests successful!" fi
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| benchs | Folder | 0755 |
|
|
| test_kmods | Folder | 0755 |
|
|
| Makefile | File | 33.38 KB | 0644 |
|
| Makefile.docs | File | 2.15 KB | 0644 |
|
| ima_setup.sh | File | 3.26 KB | 0755 |
|
| test_bpftool.sh | File | 415 B | 0755 |
|
| test_bpftool_build.sh | File | 3.9 KB | 0755 |
|
| test_bpftool_metadata.sh | File | 1.63 KB | 0755 |
|
| test_doc_build.sh | File | 638 B | 0755 |
|
| test_ftrace.sh | File | 786 B | 0755 |
|
| test_kmod.sh | File | 1.46 KB | 0755 |
|
| test_lirc_mode2.sh | File | 764 B | 0755 |
|
| test_lwt_ip_encap.sh | File | 14.55 KB | 0755 |
|
| test_lwt_seg6local.sh | File | 6.11 KB | 0755 |
|
| test_tc_edt.sh | File | 2.75 KB | 0755 |
|
| test_tc_tunnel.sh | File | 7.82 KB | 0755 |
|
| test_tunnel.sh | File | 14.26 KB | 0755 |
|
| test_xdp_features.sh | File | 2.5 KB | 0755 |
|
| test_xdp_redirect_multi.sh | File | 6.18 KB | 0755 |
|
| test_xdp_vlan.sh | File | 5.89 KB | 0755 |
|
| test_xdp_vlan_mode_generic.sh | File | 186 B | 0755 |
|
| test_xdp_vlan_mode_native.sh | File | 180 B | 0755 |
|
| test_xdping.sh | File | 2.12 KB | 0755 |
|
| test_xsk.sh | File | 5.31 KB | 0755 |
|
| verify_sig_setup.sh | File | 2.73 KB | 0755 |
|
| vmtest.sh | File | 11.19 KB | 0755 |
|
| with_addr.sh | File | 1.27 KB | 0755 |
|
| with_tunnels.sh | File | 693 B | 0755 |
|
| xsk_prereqs.sh | File | 1.48 KB | 0755 |
|