From 2dc465ca1bcb89648bbdbde2f0cfb0bffa833a81 Mon Sep 17 00:00:00 2001 From: suyuan168 <175338101@qq.com> Date: Sun, 3 Jul 2022 16:32:11 +0800 Subject: [PATCH] fix --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 0 .../etc/hotplug.d/net/21_adjust_network | 7 ++ .../base-files/etc/init.d/adjust_network | 19 ++++ .../ipq40xx/base-files/lib/adjust_network.sh | 89 +++++++++++++++++++ .../base-files/lib/upgrade/platform.sh | 0 root/target/linux/ipq40xx/config-5.4 | 31 ++++--- .../arm/boot/dts/qcom-ipq4019-nhx4019.dts | 0 7 files changed, 136 insertions(+), 10 deletions(-) mode change 100644 => 100755 root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata create mode 100755 root/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network create mode 100755 root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network create mode 100755 root/target/linux/ipq40xx/base-files/lib/adjust_network.sh mode change 100644 => 100755 root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh mode change 100644 => 100755 root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-nhx4019.dts diff --git a/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/root/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata old mode 100644 new mode 100755 diff --git a/root/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network b/root/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network new file mode 100755 index 00000000..7aa4f6f7 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/etc/hotplug.d/net/21_adjust_network @@ -0,0 +1,7 @@ +#!/bin/sh + +[ -f /lib/adjust_network.sh ] && { + . /lib/adjust_network.sh + + adjust_eth_queue +} diff --git a/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network b/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network new file mode 100755 index 00000000..02af8198 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/etc/init.d/adjust_network @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=11 +STOP=98 + +adjust_smp_affinity() { + test -f /lib/adjust_network.sh && { + . /lib/adjust_network.sh + + adjust_eth_queue + adjust_edma_smp_affinity + adjust_radio_smp_affinity + } +} + +boot() { + adjust_smp_affinity +} diff --git a/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh b/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh new file mode 100755 index 00000000..99423022 --- /dev/null +++ b/root/target/linux/ipq40xx/base-files/lib/adjust_network.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# this scripts is used for adjust cpu's choice of interrupts. +# + +################################################ +# Adjust smp_affinity of edma +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# execute only once on start-up. +################################################ +adjust_edma_smp_affinity() { + grep -q edma_eth_ /proc/interrupts || return 0 + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local cpu=0 + local tx_irq_num + + for tx_num in `seq 0 1 15` ; do + cpu=`printf "%x" $((1<<((tx_num/4+0)%nr)))` + tx_irq_num=`grep -m1 edma_eth_tx$tx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` + [ -n "$tx_irq_num" ] && echo $cpu > /proc/irq/$tx_irq_num/smp_affinity + done + + for rx_num in `seq 0 1 7` ; do + cpu=`printf "%x" $((1<<((rx_num/2)%nr)))` + rx_irq_num=`grep -m1 edma_eth_rx$rx_num /proc/interrupts | cut -d ':' -f 1 | tail -n1 | tr -d ' '` + [ -n "$rx_irq_num" ] && echo $cpu > /proc/irq/$rx_irq_num/smp_affinity + done +} + +################################################ +# Adjust smp_affinity of ath10k for 2G and 5G +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# execute only once on start-up. +################################################ +adjust_radio_smp_affinity() { + local irqs="`grep -E 'ath10k' /proc/interrupts | cut -d ':' -f 1 | tr -d ' '`" + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local idx=2 + + for irq in $irqs; do + cpu=`printf "%x" $((1<<((idx)%nr)))` + echo $cpu > /proc/irq/$irq/smp_affinity + idx=$((idx+1)) + done +} + +################################################ +# Adjust queue of eth +# Globals: +# None +# Arguments: +# None +# Returns: +# None +# Remark: +# Each network reboot needs to be executed. +################################################ +adjust_eth_queue() { + local nr=`cat /proc/cpuinfo | grep processor | wc -l` + local idx=0 + + for epath in /sys/class/net/eth[0-9]*; do + test -e $epath || break + echo $epath | grep -q "\." && continue + eth=`basename $epath` + idx=0 + for exps in /sys/class/net/$eth/queues/rx-[0-9]*/rps_cpus; do + test -e $exps || break + cpu=`printf "%x" $((1<<((idx+1)%nr)))` + idx=$((idx+1)) + echo $cpu > $exps + echo 256 > `dirname $exps`/rps_flow_cnt + done + which ethtool >/dev/null 2>&1 && ethtool -K $eth gro off + done + + echo 1024 > /proc/sys/net/core/rps_sock_flow_entries +} diff --git a/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/root/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh old mode 100644 new mode 100755 diff --git a/root/target/linux/ipq40xx/config-5.4 b/root/target/linux/ipq40xx/config-5.4 index f23e8b47..f9403650 100644 --- a/root/target/linux/ipq40xx/config-5.4 +++ b/root/target/linux/ipq40xx/config-5.4 @@ -1,8 +1,6 @@ CONFIG_ALIGNMENT_TRAP=y # CONFIG_APQ_GCC_8084 is not set # CONFIG_APQ_MMCC_8084 is not set -CONFIG_ARM_MODULE_PLTS=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_AR40XX_PHY=y CONFIG_ARCH_32BIT_OFF_T=y CONFIG_ARCH_CLOCKSOURCE_DATA=y @@ -54,6 +52,7 @@ CONFIG_BOUNCE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_QCOM=y CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE_OVERRIDE=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_QCOM=y CONFIG_COMPAT_32BIT_TIME=y @@ -68,14 +67,15 @@ CONFIG_CPU_COPY_V6=y CONFIG_CPU_CP15=y CONFIG_CPU_CP15_MMU=y CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL=y CONFIG_CPU_FREQ_GOV_ATTR_SET=y CONFIG_CPU_FREQ_GOV_COMMON=y # CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set CONFIG_CPU_FREQ_GOV_ONDEMAND=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y # CONFIG_CPU_FREQ_GOV_USERSPACE is not set CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_HAS_ASID=y @@ -184,7 +184,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_74X164=y CONFIG_GPIO_WATCHDOG=y -CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y +# CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y @@ -198,8 +198,6 @@ CONFIG_HWSPINLOCK=y CONFIG_HWSPINLOCK_QCOM=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_OPTEE=y -CONFIG_HZ=100 -CONFIG_HZ_100=y CONFIG_HZ_FIXED=0 CONFIG_I2C=y CONFIG_I2C_BOARDINFO=y @@ -353,6 +351,19 @@ CONFIG_POWER_RESET_MSM=y CONFIG_POWER_SUPPLY=y CONFIG_PPS=y CONFIG_PRINTK_TIME=y +CONFIG_PSTORE=y +# CONFIG_PSTORE_842_COMPRESS is not set +CONFIG_PSTORE_COMPRESS=y +CONFIG_PSTORE_COMPRESS_DEFAULT="deflate" +# CONFIG_PSTORE_CONSOLE is not set +CONFIG_PSTORE_DEFLATE_COMPRESS=y +CONFIG_PSTORE_DEFLATE_COMPRESS_DEFAULT=y +# CONFIG_PSTORE_LZ4HC_COMPRESS is not set +# CONFIG_PSTORE_LZ4_COMPRESS is not set +# CONFIG_PSTORE_LZO_COMPRESS is not set +# CONFIG_PSTORE_PMSG is not set +CONFIG_PSTORE_RAM=y +# CONFIG_PSTORE_ZSTD_COMPRESS is not set CONFIG_PTP_1588_CLOCK=y CONFIG_QCA807X_PHY=y CONFIG_QCOM_A53PLL=y @@ -385,6 +396,9 @@ CONFIG_RATIONAL=y CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y +CONFIG_REED_SOLOMON=y +CONFIG_REED_SOLOMON_DEC8=y +CONFIG_REED_SOLOMON_ENC8=y CONFIG_REFCOUNT_FULL=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y @@ -446,10 +460,7 @@ CONFIG_TIMER_PROBE=y CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y CONFIG_UBIFS_FS=y -CONFIG_UBIFS_FS_ADVANCED_COMPR=y -CONFIG_UBIFS_FS_LZO=y -CONFIG_UBIFS_FS_ZLIB=y -CONFIG_UBIFS_FS_ZSTD=y +# CONFIG_UCLAMP_TASK is not set CONFIG_UEVENT_HELPER_PATH="" CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" CONFIG_UNWINDER_ARM=y diff --git a/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-nhx4019.dts b/root/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-nhx4019.dts old mode 100644 new mode 100755