Lines Matching +full:cpu +full:- +full:1

2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2021-2022 NXP
5 tc_testing_scripts_dir=$(dirname $0)/../../tc-testing/scripts
12 ISOCHRON_CPU=1
15 # https://github.com/vladimiroltean/tsn-scripts
16 # WARNING: isochron versions pre-1.0 are unstable,
28 local uds_address=$1
31 if ! [ -z "${uds_address}" ]; then
32 extra_args="${extra_args} -z ${uds_address}"
37 chrt -f 10 phc2sys -m \
38 -a -rr \
39 --step_threshold 0.00002 \
40 --first_step_threshold 0.00002 \
42 > "${phc2sys_log}" 2>&1 &
47 sleep 1
59 local if_name_list="$1"
66 local if_names="$1"
74 extra_args="${extra_args} -i ${if_name}"
78 extra_args="${extra_args} -s"
83 declare -g "${log}=$(mktemp)"
85 chrt -f 10 ptp4l -m -2 -P \
86 --step_threshold 0.00002 \
87 --first_step_threshold 0.00002 \
88 --tx_timestamp_timeout 100 \
89 --uds_address="${uds_address}" \
91 > "${!log}" 2>&1 &
92 declare -g "${pid}=$!"
96 sleep 1
101 local if_names="$1"
111 local cpu=$1
112 local freq="cpu${cpu}_freq"
113 local governor="cpu${cpu}_governor"
116 if ! [ -d /sys/bus/cpu/devices/cpu${cpu}/cpufreq ]; then
120 # declare dynamic variables cpu${cpu}_freq and cpu${cpu}_governor as
122 declare -g "${freq}=$(cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq)"
123 declare -g "${governor}=$(cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor)"
125 cat /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_max_freq > \
126 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq
127 echo -n "performance" > \
128 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor
133 local cpu=$1
134 local freq="cpu${cpu}_freq"
135 local governor="cpu${cpu}_governor"
137 if ! [ -d /sys/bus/cpu/devices/cpu${cpu}/cpufreq ]; then
141 echo "${!freq}" > /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_min_freq
142 echo -n "${!governor}" > \
143 /sys/bus/cpu/devices/cpu${cpu}/cpufreq/scaling_governor
148 local if_name=$1
154 if ! [ -z "${uds}" ]; then
155 extra_args="${extra_args} --unix-domain-socket ${uds}"
159 --interface ${if_name} \
160 --sched-priority 98 \
161 --sched-fifo \
162 --utc-tai-offset ${UTC_TAI_OFFSET} \
163 --stats-port ${stats_port} \
164 --quiet \
166 declare -g "${pid}=$!"
168 sleep 1
173 local stats_port=$1
181 local sender_if_name=$1; shift
182 local receiver_if_name=$1; shift
183 local sender_uds=$1; shift
184 local receiver_uds=$1; shift
185 local base_time=$1; shift
186 local cycle_time=$1; shift
187 local shift_time=$1; shift
188 local window_size=$1; shift
189 local num_pkts=$1; shift
190 local vid=$1; shift
191 local priority=$1; shift
192 local dst_ip=$1; shift
193 local isochron_dat=$1; shift
199 if ! [ -z "${dst_ip}" ]; then
203 if ! [ -z "${vrf}" ]; then
207 if ! [ -z "${vid}" ]; then
208 vid="--vid=${vid}"
211 if [ -z "${receiver_uds}" ]; then
212 extra_args="${extra_args} --omit-remote-sync"
215 if ! [ -z "${shift_time}" ]; then
216 extra_args="${extra_args} --shift-time=${shift_time}"
219 if ! [ -z "${window_size}" ]; then
220 extra_args="${extra_args} --window-size=${window_size}"
224 extra_args="${extra_args} --l2 --etype=0xdead ${vid}"
225 receiver_extra_args="--l2 --etype=0xdead"
227 extra_args="${extra_args} --l4 --ip-destination=${dst_ip}"
228 receiver_extra_args="--l4"
236 --interface ${sender_if_name} \
237 --unix-domain-socket ${sender_uds} \
238 --priority ${priority} \
239 --base-time ${base_time} \
240 --cycle-time ${cycle_time} \
241 --num-frames ${num_pkts} \
242 --frame-size 64 \
243 --txtime \
244 --utc-tai-offset ${UTC_TAI_OFFSET} \
245 --cpu-mask $((1 << ${ISOCHRON_CPU})) \
246 --sched-fifo \
247 --sched-priority 98 \
248 --client 127.0.0.1 \
249 --sync-threshold 5000 \
250 --output-file ${isochron_dat} \
252 --quiet
261 local isochron_dat=$1; shift
263 # Count all received packets by looking at the non-zero RX timestamps
265 --input-file "${isochron_dat}" \
266 --printf-format "%u\n" --printf-args "R" | \
267 grep -w -v '0' | wc -l
272 local if_name="$1"; shift