From 9df6437f1dfa2ff014f2aabe2ec4d90ab2b194e9 Mon Sep 17 00:00:00 2001 From: linxin Date: Wed, 26 Jun 2024 18:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:add=20trex=20master=20and=20la?= =?UTF-8?q?tency=20core=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ansible/roles/mrzcpd/files/helm/templates/_config.tpl | 1 + ansible/roles/trex/files/generate-trex-conf.sh | 6 +++--- ansible/roles/trex/files/helm/templates/deployment.yaml | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ansible/roles/mrzcpd/files/helm/templates/_config.tpl b/ansible/roles/mrzcpd/files/helm/templates/_config.tpl index ad1bf817..1ac61c28 100644 --- a/ansible/roles/mrzcpd/files/helm/templates/_config.tpl +++ b/ansible/roles/mrzcpd/files/helm/templates/_config.tpl @@ -323,6 +323,7 @@ poll_wait_enable=1 virtaddr=0x500000000000 loglevel=7 huge-dir=/run/mrzcpd/hugepages +legacy_mem=0 [keepalive] check_spinlock=1 diff --git a/ansible/roles/trex/files/generate-trex-conf.sh b/ansible/roles/trex/files/generate-trex-conf.sh index fb56972f..7c540584 100644 --- a/ansible/roles/trex/files/generate-trex-conf.sh +++ b/ansible/roles/trex/files/generate-trex-conf.sh @@ -14,7 +14,7 @@ done port_limit=${#arr[@]} 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[$numa_node]+="$cpu," done @@ -46,8 +46,8 @@ cat << EOF > /etc/trex_cfg.yaml dest_mac : "aa:bb:cc:dd:ee:fe" src_mac : "00:11:22:33:44:54" platform: - master_thread_id: ${CPU_AFFINITY[0]} - latency_thread_id: ${CPU_AFFINITY[1]} + master_thread_id: ${MASTER_IOCORE} + latency_thread_id: ${LATENCY_IOCORE} dual_if: EOF diff --git a/ansible/roles/trex/files/helm/templates/deployment.yaml b/ansible/roles/trex/files/helm/templates/deployment.yaml index f1d5b46d..0ea6bcbd 100644 --- a/ansible/roles/trex/files/helm/templates/deployment.yaml +++ b/ansible/roles/trex/files/helm/templates/deployment.yaml @@ -43,6 +43,10 @@ spec: hugepages-1Gi: {{.Values.trex.hugepages }}Gi memory: 100Mi env: + - name: MASTER_IOCORE + value: {{.Values.trex.master |quote}} + - name: LATENCY_IOCORE + value: {{.Values.trex.latency |quote}} - name: CPU_AFFINITY value: {{ range $index, $cpu :=.Values.trex.cpu_affinity -}}{{- if eq $index 0 -}}{{$cpu}}{{- else -}},{{$cpu}}{{- end -}}{{- end }} - name: TREX_PATH