From b283fe1dbfaa82c2682cd7d885d38d84dc8c04f1 Mon Sep 17 00:00:00 2001 From: wangmenglan Date: Sat, 17 Jun 2023 19:12:32 +0800 Subject: [PATCH] =?UTF-8?q?Clixon=E6=9B=B4=E6=96=B0=E5=88=B01.0.45=20TSG-1?= =?UTF-8?q?5626=20Clixon=E6=94=AF=E6=8C=81=E6=B8=B2=E6=9F=93=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8rxcore=E9=85=8D=E7=BD=AE=20TSG-15582=20Clixon=E6=94=AF?= =?UTF-8?q?=E6=8C=81cm=20policy=20local=20cache=20clixon=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=20TSG-15318=20Clixon=20=E5=A2=9E=E5=8A=A0non-interact?= =?UTF-8?q?ive=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../install_config/group_vars/rpm_version.yml | 2 +- .../files/helm/templates/_config.tpl | 10 ++++ .../roles/tsg-os-HAL/files/script/cpu_amd.sh | 48 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/ansible/install_config/group_vars/rpm_version.yml b/ansible/install_config/group_vars/rpm_version.yml index 64f949c4..fc1b966e 100644 --- a/ansible/install_config/group_vars/rpm_version.yml +++ b/ansible/install_config/group_vars/rpm_version.yml @@ -103,7 +103,7 @@ hasp_tools_rpm_version: tsg_os_clixon_rpm_version: cligen: cligen-5.8.0-release clixon: clixon-5.8.0-release - tsg-os-mgnt-srv: tsg-os-mgnt-srv-1.0.44.22d975c + tsg-os-mgnt-srv: tsg-os-mgnt-srv-1.0.45.9a8a689 sce_rpm_version: sce: sce-1.0.13.23d05e7 diff --git a/ansible/roles/traffic-engine/files/helm/templates/_config.tpl b/ansible/roles/traffic-engine/files/helm/templates/_config.tpl index 60a9dc66..7dc8e7b4 100644 --- a/ansible/roles/traffic-engine/files/helm/templates/_config.tpl +++ b/ansible/roles/traffic-engine/files/helm/templates/_config.tpl @@ -531,22 +531,32 @@ enable_breakpad_upload=0 {{- define "traffic-engine.firewall.set-redis-ip" -}} +{{- if eq .Values.external_resources.cm.connectivity "local_cache" }} sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/sapp/tsgconf/maat.conf sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/sapp/etc/wannat/wangw.conf +{{- end }} {{- end -}} {{- define "traffic-engine.proxy.certstore.set-redis-ip" -}} +{{- if eq .Values.external_resources.cm.connectivity "local_cache" }} sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/certstore/conf/cert_store.ini +{{- end }} {{- end -}} {{- define "traffic-engine.proxy.tfe.set-redis-ip" -}} +{{- if eq .Values.external_resources.cm.connectivity "local_cache" }} sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/tfe/conf/tfe/tfe.conf +{{- end }} {{- end -}} {{- define "traffic-engine.sce.set-redis-ip" -}} +{{- if eq .Values.external_resources.cm.connectivity "local_cache" }} sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/sce/conf/sce.conf +{{- end }} {{- end -}} {{- define "traffic-engine.shaping.set-redis-ip" -}} +{{- if eq .Values.external_resources.cm.connectivity "local_cache" }} sed -Ei "s|CM_POLICY_LOCAL_CACHE_IP_LOCATION|${CM_POLICY_LOCAL_CACHE_IP?}|g" /opt/tsg/shaping_engine/conf/shaping.conf +{{- end }} {{- end -}} \ No newline at end of file diff --git a/ansible/roles/tsg-os-HAL/files/script/cpu_amd.sh b/ansible/roles/tsg-os-HAL/files/script/cpu_amd.sh index 2df5d916..ed577f92 100644 --- a/ansible/roles/tsg-os-HAL/files/script/cpu_amd.sh +++ b/ansible/roles/tsg-os-HAL/files/script/cpu_amd.sh @@ -2,6 +2,51 @@ set -x +write_devices_conf() +{ +(cat <> $2 +} + +write_device_rxcore_conf() +{ +(cat <> $3 +} + +del_device_rxcore_conf() +{ + sed -i '/^\[device.*\]/,/^$/d' ${tsg_clixon_cfg_file} +} + +set_mrzcpd_rx_core() +{ + local devices + local str_device + + del_device_rxcore_conf + + devices=$(lshw -c network -businfo | grep network | awk '{print $2}') + for device in $devices + do + businfo=$(ethtool -i $device | grep "bus-info:"| awk '{print $2}') + numa_node=$(lspci -s $businfo -vv | grep "NUMA node:" | awk '{print $3}') + write_device_rxcore_conf $device ${mrzcpd_rx_core[$numa_node]} ${tsg_clixon_cfg_file} + str_device=$str_device","$device + done + str_device=${str_device#*,} + write_devices_conf $str_device ${tsg_clixon_cfg_file} +} + allocate_cpu() { local numa_node_min=0 @@ -51,9 +96,12 @@ allocate_cpu() numa_list=$(numactl --hardware | grep "node $i cpus: " | sed -r "s/node $i cpus: //g") mrzcpd_core=$(echo $numa_list | cut -d ' ' -f $mrzcpd_start-$mrzcpd_end | tr ' ' ',') MRZCPD_IOCORE=$MRZCPD_IOCORE","$mrzcpd_core + mrzcpd_rx_core+=($mrzcpd_core) clixon_core=$(echo $numa_list | cut -d ' ' -f $clixon_start- | tr ' ' ',') CLIXON_IOCORE=$CLIXON_IOCORE","$clixon_core done MRZCPD_IOCORE=${MRZCPD_IOCORE#*,} CLIXON_IOCORE=${CLIXON_IOCORE#*,} + + set_mrzcpd_rx_core }