lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Tue, 25 Nov 2008 16:54:01 +0100
From:	Robert Olsson <robert@...ur.slu.se>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, robert@...ur.slu.se
Subject: [PATCH] Naming interrupt vectors/script



And a bash script attempt to set for RX/TX CPU affinity

Cheers.
				--ro


#! /bin/bash
# 
# Setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
#	char buf[IFNAMSIZ+6];
#
#	sprintf(buf, "%s-%s-%d",
#	        netdev->name,
#		(RX_INTERRUPT ? "rx" : "tx"),
#		queue->index);
#
#  Assuming a device with two RX and TX queues.
#  This script will assign: 
#
#	eth0-rx-0  CPU0
#	eth0-rx-1  CPU1
#	eth0-tx-0  CPU0
#	eth0-tx-1  CPU1
#

set_affinity()
{
    MASK=$((1<<$VEC))
    echo $DEV mask=$MASK for /proc/irq/$IRQ/smp_affinity 
    echo $MASK > /proc/irq/$IRQ/smp_affinity 
}

#
# Set up the desired devices. 
# 

for DEV in eth0 eth1 eth2
do
  for DIR in  rx tx
  do
     for VEC in `seq 0 1 12`
     do
	IRQ=`cat /proc/interrupts | grep $DEV-$DIR-$VEC"$"  | cut  -d:  -f,1`
	if [ -n  "$IRQ" ]; then
	  set_affinity
	fi
     done
  done
done
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ