File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
tools/testing/selftests/net/forwarding Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ traffic_test()
25
25
local after=
26
26
local delta=
27
27
28
+ if [ ${has_pmac_stats[$if]} = false ]; then
29
+ src=" aggregate"
30
+ fi
31
+
28
32
before=$( ethtool_std_stats_get $if " eth-mac" " FramesTransmittedOK" $src )
29
33
30
34
$MZ $if -q -c $num_pkts -p 64 -b bcast -t ip -R $PREEMPTIBLE_PRIO
@@ -317,6 +321,13 @@ for netif in ${NETIFS[@]}; do
317
321
echo " SKIP: $netif does not support MAC Merge"
318
322
exit $ksft_skip
319
323
fi
324
+
325
+ if check_ethtool_pmac_std_stats_support $netif eth-mac; then
326
+ has_pmac_stats[$netif ]=true
327
+ else
328
+ has_pmac_stats[$netif ]=false
329
+ echo " $netif does not report pMAC statistics, falling back to aggregate"
330
+ fi
320
331
done
321
332
322
333
trap cleanup EXIT
Original file line number Diff line number Diff line change @@ -155,6 +155,15 @@ check_ethtool_counter_group_support()
155
155
fi
156
156
}
157
157
158
+ check_ethtool_pmac_std_stats_support ()
159
+ {
160
+ local dev=$1 ; shift
161
+ local grp=$1 ; shift
162
+
163
+ [ 0 -ne $( ethtool --json -S $dev --all-groups --src pmac 2> /dev/null \
164
+ | jq " .[].\" $grp \" | length" ) ]
165
+ }
166
+
158
167
check_locked_port_support ()
159
168
{
160
169
if ! bridge -d link show | grep -q " locked" ; then
You can’t perform that action at this time.
0 commit comments