Date: Thu, 13 Feb 2020 21:56:50 -0800 From: Rudy <crapsh@monkeybrains.net> To: net@FreeBSD.org Subject: chelsio_affinity patch to support t6 cards Message-ID: <05fb814c-b55a-d739-e417-bd1b01d256af@monkeybrains.net> In-Reply-To: <d36bcd0c-71c5-e65f-b262-5b0a420a40d9@monkeybrains.net> References: <1aa78c6e-e640-623c-73d3-473df132eb72@monkeybrains.net> <c921825a-3a9c-cc15-78e6-c7e3776ab12a@monkeybrains.net> <bb6c3997-c369-28c3-9d85-c9cca526e093@monkeybrains.net> <d36bcd0c-71c5-e65f-b262-5b0a420a40d9@monkeybrains.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Supports t6 as well as t5 cards. Also, is this desired? Rudy --- chelsio_affinity.orig 2020-02-13 21:04:43.032596000 -0800 +++ chelsio_affinity 2020-02-13 21:50:37.675528000 -0800 @@ -26,8 +26,9 @@ chelsio_affinity_start() { # Need a Chelsio NIC - NQ=$(/sbin/sysctl -ni dev.cxl.0.nrxq) - if [ -z "${NQ}" ]; then + NQcxl=$(/sbin/sysctl -ni dev.cxl.0.nrxq) + NQcc=$(/sbin/sysctl -ni dev.cc.0.nrxq) + if [ -z "${NQcc}" && -z "${NQcxl}"]; then echo "No Chelsio NIC port detected" exit 0; fi @@ -42,16 +43,30 @@ # Exclude some CPU from binding NCPU=$((NCPU - ${chelsio_affinity_avoidncpu})) CPU=${chelsio_affinity_firstcpu} - cxl=$(sysctl dev.cxl. | grep -c nrxq) - for i in $(seq 0 $((cxl - 1))); do - for IRQ in `/usr/bin/vmstat -ai |\ - /usr/bin/sed -nE "/t5nex0:${i}a/s/irq([[:digit:]]+):.*/\1/p"`; do - echo "Bind t5nex0:${i}a IRQ ${IRQ} to CPU ${CPU}" - /usr/bin/cpuset -l ${CPU} -x ${IRQ} - CPU=$(((CPU + 1) % NCPU)) + if [ ! -z "${NQcxl}" ]; then + cxl=$(sysctl dev.cxl. | grep -c nrxq) + for i in $(seq 0 $((cxl - 1))); do + for IRQ in `/usr/bin/vmstat -ai |\ + /usr/bin/sed -nE "/t5nex[01234567]:${i}a/s/irq([[:digit:]]+):.*/\1/p"`; do + echo "Bind t5nex_:${i}a IRQ ${IRQ} to CPU ${CPU}" + /usr/bin/cpuset -l ${CPU} -x ${IRQ} + CPU=$(((CPU + 1) % NCPU)) + done + CPU=${chelsio_affinity_firstcpu} done - CPU=${chelsio_affinity_firstcpu} - done + fi + if [ ! -z "${NQcc}" ]; then + cc=$(sysctl dev.cc. | grep -c nrxq) + for i in $(seq 0 $((cc - 1))); do + for IRQ in `/usr/bin/vmstat -ai |\ + /usr/bin/sed -nE "/t6nex[01234567]:${i}a/s/irq([[:digit:]]+):.*/\1/p"`; do + echo "Bind t6nex_:${i}a IRQ ${IRQ} to CPU ${CPU}" + /usr/bin/cpuset -l ${CPU} -x ${IRQ} + CPU=$(((CPU + 1) % NCPU)) + done + CPU=${chelsio_affinity_firstcpu} + done + fi }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05fb814c-b55a-d739-e417-bd1b01d256af>