feat:add trex master and latency core env

This commit is contained in:
linxin
2024-06-26 18:41:27 +08:00
committed by 林鑫
parent f92c949e15
commit 9df6437f1d
3 changed files with 8 additions and 3 deletions

View File

@@ -323,6 +323,7 @@ poll_wait_enable=1
virtaddr=0x500000000000 virtaddr=0x500000000000
loglevel=7 loglevel=7
huge-dir=/run/mrzcpd/hugepages huge-dir=/run/mrzcpd/hugepages
legacy_mem=0
[keepalive] [keepalive]
check_spinlock=1 check_spinlock=1

View File

@@ -14,7 +14,7 @@ done
port_limit=${#arr[@]} port_limit=${#arr[@]}
declare -A NUMA declare -A NUMA
for cpu in ${CPU_AFFINITY[@]:2}; do for cpu in ${CPU_AFFINITY[@]}; do
numa_node=$(lscpu -p=CPU,NODE | grep "^$cpu," | cut -d',' -f2) numa_node=$(lscpu -p=CPU,NODE | grep "^$cpu," | cut -d',' -f2)
NUMA[$numa_node]+="$cpu," NUMA[$numa_node]+="$cpu,"
done done
@@ -46,8 +46,8 @@ cat << EOF > /etc/trex_cfg.yaml
dest_mac : "aa:bb:cc:dd:ee:fe" dest_mac : "aa:bb:cc:dd:ee:fe"
src_mac : "00:11:22:33:44:54" src_mac : "00:11:22:33:44:54"
platform: platform:
master_thread_id: ${CPU_AFFINITY[0]} master_thread_id: ${MASTER_IOCORE}
latency_thread_id: ${CPU_AFFINITY[1]} latency_thread_id: ${LATENCY_IOCORE}
dual_if: dual_if:
EOF EOF

View File

@@ -43,6 +43,10 @@ spec:
hugepages-1Gi: {{.Values.trex.hugepages }}Gi hugepages-1Gi: {{.Values.trex.hugepages }}Gi
memory: 100Mi memory: 100Mi
env: env:
- name: MASTER_IOCORE
value: {{.Values.trex.master |quote}}
- name: LATENCY_IOCORE
value: {{.Values.trex.latency |quote}}
- name: CPU_AFFINITY - name: CPU_AFFINITY
value: {{ range $index, $cpu :=.Values.trex.cpu_affinity -}}{{- if eq $index 0 -}}{{$cpu}}{{- else -}},{{$cpu}}{{- end -}}{{- end }} value: {{ range $index, $cpu :=.Values.trex.cpu_affinity -}}{{- if eq $index 0 -}}{{$cpu}}{{- else -}},{{$cpu}}{{- end -}}{{- end }}
- name: TREX_PATH - name: TREX_PATH