Skip to content

Commit 547ecb0

Browse files
yoongsiang2shifty91
authored andcommitted
tests/intel_kpi: Add i226 XDP 1ms test with PTP hardware timestamp
Add test case for Intel i226 NIC KPI evaluation with 1ms cycle time using AF_XDP zero-copy mode. Configuration highlights: - Enable processing latency metric - Workload on Reference: none - Workload on Mirror: 57k instructions per control loop (IPCL) - AF_XDP zero-copy mode with busy polling optimization - Disable interrupt coalescing for immediate interrupt firing Co-developed-by: Chwee-Lin Choong <chwee.lin.choong@intel.com> Signed-off-by: Chwee-Lin Choong <chwee.lin.choong@intel.com> Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com> Part-of: #55 Closes: #55 [Kurt: Run pre-commit] Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
1 parent 7830bf2 commit 547ecb0

6 files changed

Lines changed: 294 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
# Setup the Tx and Rx traffic flows for Intel i226 NIC(s) KPI testing.
9+
#
10+
11+
set -e
12+
13+
source ../../lib/common.sh
14+
source ../../lib/igc.sh
15+
16+
#
17+
# Command line arguments.
18+
#
19+
INTERFACE=$1
20+
CYCLETIME_NS=$2
21+
BASETIME=$3
22+
23+
[ -z $INTERFACE ] && INTERFACE="enp3s0" # default: enp3s0
24+
[ -z $CYCLETIME_NS ] && CYCLETIME_NS="1000000" # default: 1ms
25+
[ -z $BASETIME ] && BASETIME=$(date '+%s000000000' -d '-30 sec') # default: now - 30s
26+
27+
load_kernel_modules
28+
29+
igc_start "${INTERFACE}"
30+
ethtool -C ${INTERFACE} rx-usecs 0
31+
32+
#
33+
# Split traffic between TSN High Stream and everything else.
34+
#
35+
ENTRY1_NS="500000" # Everything else
36+
ENTRY2_NS="500000" # TSN High Stream
37+
38+
#
39+
# Tx Assignment with Qbv and full hardware offload.
40+
#
41+
# PCP 6 - Tx Q 1 - TSN High Stream
42+
# PCP X - Tx Q 0 - Everything else
43+
#
44+
tc qdisc replace dev ${INTERFACE} handle 100 parent root taprio num_tc 2 \
45+
map 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 \
46+
queues 1@0 1@1 \
47+
base-time ${BASETIME} \
48+
sched-entry S 0x03 ${ENTRY1_NS} \
49+
sched-entry S 0x02 ${ENTRY2_NS} \
50+
flags 0x02
51+
52+
#
53+
# Rx Queues Assignment.
54+
#
55+
# PCP 6 - Rx Q 1 - TSN High Stream
56+
# PCP X - Rx Q 0 - Everything else
57+
RXQUEUES=(0 1 0 0 0 0 0 0 0 0)
58+
igc_rx_queues_assign "${INTERFACE}" RXQUEUES
59+
60+
setup_irqs "${INTERFACE}"
61+
62+
exit 0
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
# Setup the Tx and Rx traffic flows for Intel i226 NIC(s) KPI testing.
9+
#
10+
11+
set -e
12+
13+
source ../../lib/common.sh
14+
source ../../lib/igc.sh
15+
16+
#
17+
# Command line arguments.
18+
#
19+
INTERFACE=$1
20+
CYCLETIME_NS=$2
21+
BASETIME=$3
22+
23+
[ -z $INTERFACE ] && INTERFACE="enp3s0" # default: enp3s0
24+
[ -z $CYCLETIME_NS ] && CYCLETIME_NS="1000000" # default: 1ms
25+
[ -z $BASETIME ] && BASETIME=$(date '+%s000000000' -d '-30 sec') # default: now - 30s
26+
27+
load_kernel_modules
28+
29+
igc_start "${INTERFACE}"
30+
ethtool -C ${INTERFACE} rx-usecs 0
31+
32+
#
33+
# Split traffic between TSN High Stream and everything else.
34+
#
35+
ENTRY1_NS="500000" # TSN High Stream
36+
ENTRY2_NS="500000" # Everything else
37+
38+
#
39+
# Tx Assignment with Qbv and full hardware offload.
40+
#
41+
# PCP 6 - Tx Q 1 - TSN High Stream
42+
# PCP X - Tx Q 0 - Everything else
43+
#
44+
tc qdisc replace dev ${INTERFACE} handle 100 parent root taprio num_tc 2 \
45+
map 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 \
46+
queues 1@0 1@1 \
47+
base-time ${BASETIME} \
48+
sched-entry S 0x02 ${ENTRY1_NS} \
49+
sched-entry S 0x01 ${ENTRY2_NS} \
50+
flags 0x02
51+
52+
#
53+
# Rx Queues Assignment.
54+
#
55+
# PCP 6 - Rx Q 1 - TSN High Stream
56+
# PCP X - Rx Q 0 - Everything else
57+
RXQUEUES=(0 1 0 0 0 0 0 0 0 0)
58+
igc_rx_queues_assign "${INTERFACE}" RXQUEUES
59+
60+
setup_irqs "${INTERFACE}"
61+
62+
exit 0
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
9+
set -e
10+
11+
cd "$(dirname "$0")"
12+
13+
# Start PTP
14+
../../../scripts/ptp.sh enp3s0
15+
sleep 30
16+
17+
# Configure flow
18+
./flow_mirror.sh enp3s0
19+
sleep 30
20+
21+
# Start one instance of mirror application
22+
cp ../../../build/xdp_kern_*.o .
23+
../../../build/mirror -c mirror.yaml >/dev/shm/mirror.log &
24+
25+
exit 0
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
# Mirror YAML configuration file for Intel i226 NIC(s) KPI testing.
9+
#
10+
Application:
11+
ApplicationClockId: CLOCK_TAI
12+
# ApplicationBaseStartTimeNS: 0
13+
ApplicationBaseCycleTimeNS: 1ms
14+
ApplicationTxBaseOffsetNS: 700us
15+
ApplicationRxBaseOffsetNS: 300us
16+
ApplicationXdpProgram: xdp_kern_profinet_vid100.o
17+
TsnHigh:
18+
TsnHighEnabled: true
19+
TsnHighXdpEnabled: true
20+
TsnHighXdpSkbMode: false
21+
TsnHighXdpZcMode: true
22+
TsnHighXdpWakeupMode: true
23+
TsnHighXdpBusyPollMode: true
24+
TsnHighTxTimeStampEnabled: true
25+
TsnHighVid: 100
26+
TsnHighNumFramesPerCycle: 1
27+
TsnHighPayloadPattern: |
28+
TsnHighPayloadPattern
29+
TsnHighFrameLength: 64
30+
TsnHighRxQueue: 1
31+
TsnHighTxQueue: 1
32+
TsnHighSocketPriority: 6
33+
TsnHighTxThreadPriority: 98
34+
TsnHighRxThreadPriority: 98
35+
TsnHighTxThreadCpu: 1
36+
TsnHighRxThreadCpu: 1
37+
TsnHighInterface: enp3s0
38+
TsnHighDestination: a8:74:1d:9d:36:14
39+
TsnHighRxWorkloadEnabled: true
40+
TsnHighRxWorkloadFile: ../../workloads/pointer_chasing/pointer_chasing.so
41+
TsnHighRxWorkloadSetupFunction: ptr_chase_setup
42+
TsnHighRxWorkloadSetupArguments: "0x4A4000 0x129000"
43+
TsnHighRxWorkloadTeardownFunction: ptr_chase_teardown
44+
TsnHighRxWorkloadFunction: run_ptr_chasing
45+
TsnHighRxWorkloadPrewarm: false
46+
TsnHighRxWorkloadSkipCount: 100
47+
TsnHighRxWorkloadThreadCpu: 1
48+
TsnHighRxWorkloadThreadPriority: 80
49+
Log:
50+
LogThreadPriority: 1
51+
LogThreadCpu: 0
52+
LogFile: /var/log/mirror_vid100.log
53+
LogLevel: Info
54+
LogMqtt:
55+
LogMqtt: false
56+
LogMqttThreadPriority: 10
57+
LogMqttThreadCpu: 0
58+
LogMqttBrokerIP: 127.0.0.1
59+
LogMqttBrokerPort: 1883
60+
LogMqttMeasurementName: mirror
61+
Debug:
62+
DebugStopTraceOnOutlier: false
63+
DebugStopTraceOnError: false
64+
DebugMonitorMode: false
65+
DebugMonitorDestination: 44:44:44:44:44:44
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
9+
set -e
10+
11+
cd "$(dirname "$0")"
12+
13+
# Start PTP
14+
../../../scripts/ptp.sh enp3s0
15+
sleep 30
16+
17+
# Configure flow
18+
./flow_ref.sh enp3s0
19+
sleep 30
20+
21+
# Start one instance of reference application
22+
cp ../../../build/xdp_kern_*.o .
23+
../../../build/reference -c reference.yaml >/dev/shm/ref.log &
24+
25+
exit 0
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
#
3+
# Copyright (C) 2026 Linutronix GmbH
4+
# Author Kurt Kanzenbach <kurt@linutronix.de>
5+
#
6+
# SPDX-License-Identifier: BSD-2-Clause
7+
#
8+
# Reference YAML configuration file for Intel i226 NIC(s) KPI testing.
9+
#
10+
Application:
11+
ApplicationClockId: CLOCK_TAI
12+
# ApplicationBaseStartTimeNS: 0
13+
ApplicationBaseCycleTimeNS: 1ms
14+
ApplicationTxBaseOffsetNS: 700us
15+
ApplicationRxBaseOffsetNS: 300us
16+
ApplicationXdpProgram: xdp_kern_profinet_vid100.o
17+
TsnHigh:
18+
TsnHighEnabled: true
19+
TsnHighXdpEnabled: true
20+
TsnHighXdpSkbMode: false
21+
TsnHighXdpZcMode: true
22+
TsnHighXdpWakeupMode: true
23+
TsnHighXdpBusyPollMode: true
24+
TsnHighTxTimeStampEnabled: false
25+
TsnHighVid: 100
26+
TsnHighNumFramesPerCycle: 1
27+
TsnHighPayloadPattern: |
28+
TsnHighPayloadPattern
29+
TsnHighFrameLength: 64
30+
TsnHighRxQueue: 1
31+
TsnHighTxQueue: 1
32+
TsnHighSocketPriority: 6
33+
TsnHighTxThreadPriority: 98
34+
TsnHighRxThreadPriority: 98
35+
TsnHighTxThreadCpu: 1
36+
TsnHighRxThreadCpu: 1
37+
TsnHighInterface: enp3s0
38+
TsnHighDestination: a8:74:1d:9d:98:d8
39+
Log:
40+
LogThreadPriority: 1
41+
LogThreadCpu: 0
42+
LogFile: /var/log/reference_vid100.log
43+
LogLevel: Info
44+
LogMqtt:
45+
LogMqtt: false
46+
LogMqttThreadPriority: 10
47+
LogMqttThreadCpu: 0
48+
LogMqttBrokerIP: 127.0.0.1
49+
LogMqttBrokerPort: 1883
50+
LogMqttMeasurementName: reference
51+
Debug:
52+
DebugStopTraceOnOutlier: false
53+
DebugStopTraceOnError: false
54+
DebugMonitorMode: false
55+
DebugMonitorDestination: 44:44:44:44:44:44

0 commit comments

Comments
 (0)