Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aa10e5e

Browse files
matthewr-xilinxjfeather-amd
authored andcommitted
ON-16983: latency-best profile, always allow EF_CTPIO_MODE=ct for X3 and X4
Update the checks in latency-best profile so that it will only select EF_CTPIO_MODE=sf when there is an X2 interface which is NOT running at 10GbE. This means ct mode can be used at all speeds on systems which use X4 or X3 adapters.
1 parent 49e29c9 commit aa10e5e

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

‎scripts/onload_profiles/latency-best.opf‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,46 @@ onload_import latency
1010

1111
# Use cut-through mode for CTPIO feature on X2 (and later) adapters. This can
1212
# result in poisoned packets being emitted.
13-
# At link speeds faster than 10Gb the CPU will generally not be able to keep
14-
# up so poisoned packets will often be emitted and latency will get worse;
13+
# X3 and X4 adapters have improved CTPIO implementation, so can use cut-through
14+
# at all speeds.
15+
# On X2, link speeds faster than 10Gb the CPU will generally not be able to
16+
# keep up so poisoned packets will often be emitted and latency will get worse;
1517
# disable cut-through in those cases.
1618
if [ -z "$EF_CTPIO_MODE" ]; then
1719
have_indeterminate=
1820
have_10k=
1921
have_non10k=
22+
have_nonx2=
2023
for nic in /sys/class/net/*; do
2124
driver=$(basename "$(readlink "$nic/device/driver")")
25+
pci_deviceid=`(cat $nic/device/device) || echo 0`
2226
if [ "$driver" = sfc ]; then
23-
speed=`(cat $nic/speed 2>/dev/null) || echo 0`
24-
if [ $speed = 0 ]; then
27+
if [ $pci_deviceid = 0 ]; then
2528
have_indeterminate=1
26-
elif [ $speed -le 10000 ]; then
27-
have_10k=1
29+
elif [[ $pci_deviceid = 0x0b03 || $pci_deviceid = 0x1b03 ]]; then
30+
speed=`(cat $nic/speed 2>/dev/null) || echo 0`
31+
if [ $speed = 0 ]; then
32+
have_indeterminate=1
33+
elif [ $speed -le 10000 ]; then
34+
have_10k=1
35+
else
36+
have_non10k=1
37+
fi
2838
else
29-
have_non10k=1
39+
have_nonx2=1
3040
fi
3141
fi
3242
done
3343
if [ "$have_non10k" ]; then
34-
if [ "$have_indeterminate" -o "$have_10k" ]; then
35-
log "Warning: Disabling CTPIO cut-through because only adapters running at 10GbE benefit from it. If your latency-sensitive traffic is using only a 10GbE adapter then set EF_CTPIO_MODE=ct explicitly"
44+
if [[ "$have_indeterminate" || "$have_nonx2" || "$have_10k" ]]; then
45+
log "Warning: Disabling CTPIO cut-through because X2 adapters running at greater than 10GbE may not benefit from it. If your latency-sensitive traffic is only using an X4 or X3 adapter, or an X2 adapter at 10GbE then set EF_CTPIO_MODE=ct explicitly"
3646
else
37-
log "Note: Disabling CTPIO cut-through because only adapters running at 10GbE benefit from it"
47+
log "Note: Disabling CTPIO cut-through because X2 adapters only benefit from it when running at 10GbE"
3848
fi
3949
else
4050
onload_set EF_CTPIO_MODE ct
4151
if [ $have_indeterminate ]; then
42-
log "Warning: CTPIO cut-through is enabled, but the link speed of some adapters could not be determined. If latency-sensitive traffic is using an adapter running at a speed other than 10GbE then use EF_CTPIO_MODE=sf for best results"
52+
log "Warning: CTPIO cut-through is enabled, but the link speed of some adapters could not be determined. If latency-sensitive traffic is using an X2 adapter running at a speed other than 10GbE then use EF_CTPIO_MODE=sf for best results"
4353
fi
4454
fi
4555
fi

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /