Skip to content

Commit

Permalink
selftests: net: Use setup_ns in udpgro_frglist
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
geliangtang authored and Geliang Tang committed Jan 16, 2025
1 parent fdfbc76 commit 66b296f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions tools/testing/selftests/net/udpgro_frglist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
#
# Run a series of udpgro benchmarks

source lib.sh
source net_helper.sh

readonly PEER_NS="ns-peer-$(mktemp -u XXXXXX)"
PEER_NS=""

BPF_FILE="xdp_dummy.bpf.o"

cleanup() {
local -r jobs="$(jobs -p)"
local -r ns="$(ip netns list|grep $PEER_NS)"

[ -n "${jobs}" ] && kill -INT ${jobs} 2>/dev/null
[ -n "$ns" ] && ip netns del $ns 2>/dev/null
cleanup_all_ns
}
trap cleanup EXIT

Expand All @@ -24,10 +24,7 @@ run_one() {
local -r tx_args=${all%rx*}
local rx_args=${all#*rx}



ip netns add "${PEER_NS}"
ip -netns "${PEER_NS}" link set lo up
setup_ns PEER_NS
ip link add type veth
ip link set dev veth0 up
ip addr add dev veth0 192.168.1.2/24
Expand Down

0 comments on commit 66b296f

Please sign in to comment.