]> git.ipfire.org Git - people/ms/network.git/commitdiff
device_num_queues(): Read correct file for transmit queues
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jun 2017 18:25:38 +0000 (19:25 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 13 Jun 2017 18:25:38 +0000 (19:25 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.device

index ac6ace5b627b10691501413005d32af94f146cae..fc88fecc53638d5088f4968d05a89170c513b3ed 100644 (file)
@@ -1008,7 +1008,7 @@ device_num_queues() {
        local device=${1}
        local type=${2}
 
-       assert isoneof type "" rx tx
+       isset type && assert isoneof type rx tx
 
        local i=0
 
@@ -1036,7 +1036,16 @@ device_queue_get_smp_affinity() {
        local device=${1}
        local queue=${2}
 
-       local path="${SYS_CLASS_NET}/${device}/queues/${queue}/rps_cpus"
+       local path="${SYS_CLASS_NET}/${device}/queues/${queue}"
+
+       case "${queue}" in
+               rx-*)
+                       path="${path}/rps_cpus"
+                       ;;
+               tx-*)
+                       path="${path}/xps_cpus"
+                       ;;
+       esac
        assert [ -r "${path}" ]
 
        __bitmap_to_processor_ids $(<${path})