mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 08:12:53 +00:00
To keep fork as closely synced with upstream, move NSS packages back into repository. Not sure why they were moved out from my original fork. * nss-firmware * qca-nss-crypto * qca-nss-cfi Removed the following: * mhz (already available in packages repo) * qrtr (unecessary, and has been broken for years) Also moved packages out of `qca` and back into root directory.
54 lines
1.7 KiB
Bash
54 lines
1.7 KiB
Bash
#!/bin/sh /etc/rc.common
|
|
#
|
|
# Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
|
|
#
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
#
|
|
|
|
START=70
|
|
|
|
enable_rps() {
|
|
set_affinity() {
|
|
awk "/$1/{ print substr(\$1, 1, length(\$1)-1) }" /proc/interrupts | while read -r irq; do
|
|
[ -n "$irq" ] && echo "$2" > /proc/irq/"$irq"/smp_affinity
|
|
done
|
|
}
|
|
set_affinity_last() {
|
|
awk "/$1/{sub(/:/,\"\");last=\$1} END{print last}" /proc/interrupts | while read -r irq; do
|
|
[ -n "$irq" ] && echo "$2" > /proc/irq/"$irq"/smp_affinity
|
|
done
|
|
}
|
|
|
|
# assign 3 nss queues to each core
|
|
set_affinity 'nss_queue1' 2
|
|
set_affinity 'nss_queue2' 4
|
|
set_affinity 'nss_queue3' 8
|
|
set_affinity 'nss_queue0' 1
|
|
|
|
# assign nss buffer sos/queues to core 3
|
|
set_affinity 'nss_empty_buf_sos' 8
|
|
set_affinity 'nss_empty_buf_queue' 8
|
|
set_affinity_last 'nss_empty_buf_sos' 8
|
|
|
|
# Enable NSS RPS
|
|
sysctl -w dev.nss.rps.enable=1 > /dev/null 2> /dev/null
|
|
}
|
|
|
|
start() {
|
|
local rps_enabled
|
|
rps_enabled="$(uci_get nss @general[0] enable_rps)"
|
|
if [ "$rps_enabled" -eq 1 ]; then
|
|
enable_rps
|
|
fi
|
|
}
|