-
Notifications
You must be signed in to change notification settings - Fork 10
/
test-vf-rep-ping-reconfig-sriov.sh
executable file
·69 lines (55 loc) · 1.25 KB
/
test-vf-rep-ping-reconfig-sriov.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
#
# Bug SW #1040416: slow path xmit on VF reps broken
#
# with tcpdump we could see traffic VF->rep works but rep->VF doesn't.
#
# Bug SW #1242030: [ASAP MLNX OFED] VF to Rep traffic doesn't work after
# reconfiguring VFs without reloading mlx5_core
#
NIC=${1:-ens5f0}
VF=${2:-ens5f2}
REP=${3:-ens5f0_0}
my_dir="$(dirname "$0")"
. $my_dir/common.sh
IP1="7.7.7.1"
IP2="7.7.7.2"
enable_switchdev_if_no_rep $REP
bind_vfs
function cleanup() {
ip netns del ns0 2> /dev/null
ifconfig $REP 0
}
function ping_test() {
cleanup
ifconfig $REP $IP1/24 up
ip netns add ns0
ip link set $VF netns ns0
ip netns exec ns0 ifconfig $VF $IP2/24 up
title "Test ping REP($IP1) -> VF($IP2)"
ping -q -c 10 -i 0.2 -w 2 $IP2 && success || err
title "Test ping VF($IP2) -> REP($IP1)"
ip netns exec ns0 ping -q -c 10 -i 0.2 -w 2 $IP1 && success || err
cleanup
}
function reconfig_sriov() {
# reconfig sriov without reloading modules
config_sriov 0
config_sriov 2
set_macs
enable_switchdev_if_no_rep $REP
bind_vfs
}
title "Ping test"
ping_test
fail_if_err
title "Reconfig SRIOV"
reconfig_sriov
title "Ping test"
ping_test
fail_if_err
title "Reconfig SRIOV"
reconfig_sriov
title "Ping test"
ping_test
test_done