summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuraj Jaiswal <jsuraj@codeaurora.org>2021-03-08 16:41:55 +0530
committerSuraj Jaiswal <jsuraj@codeaurora.org>2021-03-09 16:06:58 +0530
commitf2d8a201653c2404f312c76f85a35234cd8f350e (patch)
tree4333c106649323f925e80a97846c6fc75228260f
parente3abf2d2c67f52f4b9ab683b1119c4bd8de771bf (diff)
downloaddata-kernel-f2d8a201653c2404f312c76f85a35234cd8f350e.tar.gz
data-kernel: rps setting
RPS script support to install the RPS setting as per target. Change-Id: Ib5ebb73f620b307508d6f4eeeb87eda0c0bcda4b
-rw-r--r--eth-rps/Android.mk16
-rw-r--r--eth-rps/emac_rps_settings.sh34
2 files changed, 50 insertions, 0 deletions
diff --git a/eth-rps/Android.mk b/eth-rps/Android.mk
new file mode 100644
index 0000000..4bb90f4
--- /dev/null
+++ b/eth-rps/Android.mk
@@ -0,0 +1,16 @@
+#This makefile is only to compile EMAC for AUTO platform
+
+ifeq ($(TARGET_BOARD_AUTO),true)
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := emac_rps_settings.sh
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+LOCAL_SRC_FILES := emac_rps_settings.sh
+include $(BUILD_PREBUILT)
+
+endif
+
+
diff --git a/eth-rps/emac_rps_settings.sh b/eth-rps/emac_rps_settings.sh
new file mode 100644
index 0000000..6fd84e2
--- /dev/null
+++ b/eth-rps/emac_rps_settings.sh
@@ -0,0 +1,34 @@
+#!/vendor/bin/sh
+#Copyright (c) 2019, 2021, The Linux Foundation. All rights reserved.
+#
+#This program is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License version 2 and
+#only version 2 as published by the Free Software Foundation.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+#
+#
+plateform_hana=1
+plateform_talos=2
+plateform_poipu=3
+irq_num=`cat /proc/interrupts | grep -i DWC_ETH_QOS| grep -i gic | awk {'print $1'} | awk -F : {'print $1'}`;
+echo irqnum=$irq_num;
+case $1 in
+ $plateform_hana)
+ echo $2 > /sys/class/net/eth0/queues/rx-0/rps_cpus;
+ ;;
+ $plateform_poipu)
+ echo $2 > /sys/class/net/eth0/queues/rx-0/rps_cpus;
+ ;;
+ $plateform_talos)
+ # Here 08 is forcing ISR to CPU 3
+ echo 08 > /proc/irq/$irq_num/smp_affinity;
+ echo $2 > /sys/class/net/eth0/queues/rx-0/rps_cpus;
+ ;;
+ *)
+ echo "Invalid plateform $1";
+ ;;
+esac