Commit 4c815af9 authored by Kirill Smelkov's avatar Kirill Smelkov

X neotest: Show NIC features and emit warning if !TSO

On neo1 - neo2 without TSO latency becomes very poor in lat_tcp when
payload size becomes greater TCP MSS (lat_tcp -m 1448 ~ 130μs; lat_tcp
-m 1449 ~ 500μs and more)
parent 4436b983
...@@ -520,22 +520,74 @@ system_info() { ...@@ -520,22 +520,74 @@ system_info() {
*pci*) *pci*)
pcidev=`basename $nicdev` # /sys/devices/pci0000:00/0000:00:1f.6 -> 0000:00:1f.6 pcidev=`basename $nicdev` # /sys/devices/pci0000:00/0000:00:1f.6 -> 0000:00:1f.6
#lspci -s $pcidev #lspci -s $pcidev
echo -n "`lspci1 $pcidev Vendor` `lspci1 $pcidev Device` rev `lspci1 $pcidev Rev`" echo "`lspci1 $pcidev Vendor` `lspci1 $pcidev Device` rev `lspci1 $pcidev Rev`"
;; ;;
*) *)
echo -n "$nicdev (TODO)" echo "$nicdev (TODO)"
;; ;;
esac esac
nicwarnv=()
# show relevant features
featok=y
feat=`ethtool -k $nicname 2>/dev/null` || featok=n
if [ $featok != y ]; then
echo "# $nicname: features: ?"
else
# feat1 name abbrev -> abbrev. value (e.g. "tx" or "!tx")
feat1() {
# ntuple-filters: off [fixed]
v=`echo "$feat" |grep "^$1:\\s*" |awk '{print $2}'`
case $v in
on)
echo "$2"
;;
off)
echo "!$2"
;;
*)
echo "?($v)$2"
;;
esac
}
s="# $nicname: features:"
# NOTE feature abbrevs are those used by `ethtool -K` to set them
s+=" `feat1 rx-checksumming rx`"
s+=" `feat1 tx-checksumming tx`"
s+=" `feat1 scatter-gather sg`"
tso="`feat1 tcp-segmentation-offload tso`"
s+=" $tso"
s+=" `feat1 udp-fragmentation-offload ufo`"
s+=" `feat1 generic-segmentation-offload gso`"
s+=" `feat1 generic-receive-offload gro`"
s+=" `feat1 large-receive-offload lro`"
s+=" `feat1 rx-vlan-offload rxvlan`"
s+=" `feat1 tx-vlan-offload txvlan`"
s+=" `feat1 ntuple-filters ntuple`"
s+=" `feat1 receive-hashing rxhash`"
# ^^^ are the common features - others are specific to kernel/device
# XXX or list them all?
s+=" ..."
echo "$s"
# warn if !tso (linux starts enabling autocorking for e.g. small second segment and probably
# something else and lat_tcp latency grows stepwise from ~130μs to 500μs and more)
test "$tso" == "tso" || nicwarnv+=("TSO not enabled - TCP latency with packets > MSS will be poor")
fi
# show rx/tx coalescing latency # show rx/tx coalescing latency
echo -n "# $nicname: coalesce:"
coalok=y coalok=y
coal=`ethtool -c $nicname 2>/dev/null` || coalok=n coal=`ethtool -c $nicname 2>/dev/null` || coalok=n
if [ $coalok != y ]; then if [ $coalok != y ]; then
echo -e "\t(rxc: ? txc: ?)" echo " rxc: ?, txc: ?"
continue else
fi
# coal1 name -> value # coal1 name -> value
coal1() { coal1() {
echo "$coal" |grep "^$1:\\s*" | sed -e "s/^$1:\\s*//" echo "$coal" |grep "^$1:\\s*" | sed -e "s/^$1:\\s*//"
...@@ -550,14 +602,22 @@ system_info() { ...@@ -550,14 +602,22 @@ system_info() {
txt_irq=`coal1 tx-usecs-irq` txt_irq=`coal1 tx-usecs-irq`
txf_irq=`coal1 tx-frames-irq` txf_irq=`coal1 tx-frames-irq`
echo -en "\t(rxc: ${rxt}μs/${rxf}f/${rxt_irq}μs-irq/${rxf_irq}f-irq" echo -en " rxc: ${rxt}μs/${rxf}f/${rxt_irq}μs-irq/${rxf_irq}f-irq,"
echo -e " txc: ${txt}μs/${txf}f/${txt_irq}μs-irq/${txf_irq}f-irq)" echo -e " txc: ${txt}μs/${txf}f/${txt_irq}μs-irq/${txf_irq}f-irq"
# XXX also add -low and -high ? # XXX also add -low and -high ?
# warn if rx latency is too high # warn if rx latency is too high
rxlat=$(($rxt>$rxt_irq?$rxt:$rxt_irq)) rxlat=$(($rxt>$rxt_irq?$rxt:$rxt_irq))
test "$rxlat" -le 10 || echo "# $nicname: WARNING: RX coalesce latency is max ${rxlat}μs - that will add to networked request-reply latency" test "$rxlat" -le 10 || nicwarnv+=("RX coalesce latency is max ${rxlat}μs - that will add to networked request-reply latency")
fi
# emit NIC warnings
for warn in "${nicwarnv[@]}"; do
echo "# $nicname: WARNING: $warn"
done
done done
echo -n "# "; python --version echo -n "# "; python --version
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment