Skip to content

Commit

Permalink
Added(rss-ladder): warning about using few queues on same cpu.
Browse files Browse the repository at this point in the history
  • Loading branch information
strizhechenko committed Jul 9, 2017
1 parent 4144459 commit 87824d5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion netutils_linux_tuning/rss_ladder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from netutils_linux_hardware.assessor_math import any2int
from netutils_linux_monitoring.numa import Numa
from netutils_linux_monitoring.colors import wrap, YELLOW

MAX_QUEUE_PER_DEVICE = 16

Expand Down Expand Up @@ -100,7 +101,12 @@ def smp_affinity_list_apply(self, smp_affinity):
'* 4' is in case of NIC has more queues than socket has CPUs
:param smp_affinity: list of tuples(irq, queue_name, socket)
"""
for irq, queue_name, socket_cpu in smp_affinity:
affinity = list(smp_affinity)
cpus = [socket_cpu for irq, queue, socket_cpu in affinity]
if len(set(cpus)) != len(cpus):
warning = "WARNING: some CPUs process multiple queues, consider reduce queue count for this network device"
print_(wrap(warning, YELLOW))
for irq, queue_name, socket_cpu in affinity:
print_(" - {0}: irq {1} {2} -> {3}".format(self.options.dev, irq, queue_name, socket_cpu))
if self.options.dry_run:
continue
Expand Down

0 comments on commit 87824d5

Please sign in to comment.