4.30.2011

How do I bind NIC interrupts to selected CPU?

I read this interesting mailing thread and want to share with all the followers and commuters searching for the solution.

I have a 4 Quad server, am trying to bind NIC eth0 interrupt(s) to CPU4 and
CPU5. As of now, my eth0 is found bind to all the 8's.

grep eth0 /proc/interrupts | awk '{print $NF}' | sort

eth0-0
eth0-1
eth0-2
eth0-3
eth0-4
eth0-5
eth0-6
eth0-7

How to move ahead?

Solution: Follow these steps to get it done.

As I am using Broadcom card(bnx2), I am going to run this command and reboot my machine.

Open the terminal:

echo "options bnx2 disable_msi=1" > /etc/modprobe.d/bnx2.conf

then reboot, after you'll only see one irq for eth0.

Next, run this command:

echo cpumask > /proc/irq/IRQ-OF-ETH0-0/smp_affinity

I believe the mask for cpu4 is 10 and cpu5 is 20.
(don't forget to disable irqbalance)

you can only bind the irqs for one nic to one core at a time.

or you could do something fancy/silly with isolcpus and....

isolcpus all but 4/5 so that all irqs will be scheduled on 4/5. this will
mean that the kernel can only schedule tasks on cpu4/5.

Hope it helps !!!
then use cpusets/taskset/tuna to move all the processes off cpu 4/5... and
you'll have to use taskset/cpuset/tuna for every task to ensure its not
using cpu4/5

How to transfer files through Bluetooth under Ubuntu? - Part-I

Bluetooth is a specification for the use of low-power radio communications to wirelessly link phones, computers and other network devices over short distances. The name Bluetooth is borrowed from Harald Bluetooth, a king in Denmark more than 1,000 years ago.

Bluetooth is the short-range networking facility that allows various items of hardware to work with each other wirelessly. For Bluetooth to work, both devices need to have Bluetooth support. Many mobile phones come with Bluetooth nowadays, and an increasing number of notebook computers do too. It’s also possible to buy very inexpensive Bluetooth USB adapters.

Your PC’s Bluetooth hardware is automatically recognized under Ubuntu, and the low-level driver software is installed by default. Therefore, all you normally need to do is install the software that provides the Bluetooth functionality you require.

Configuring Bluetooth

When two pieces of Bluetooth-compatible hardware need to communicate on a regular basis, they can pair together. This means that they trust each other, so you don’t need to authorize every attempt at communication between the devices. Indeed, some devices won’t communicate unless they’re paired in this way.

Pairing is very simple in practice and works on the principle of a shared personal ID number (PIN). The first Bluetooth device generates the PIN, and then asks the second Bluetooth device to confirm it. Once the user has typed in the PIN, the devices are paired.

Pairing is easily accomplished under Ubuntu and doesn’t require any additional software. However, you will need to edit a configuration file. This only needs to be done once.

Start by opening the central Bluetooth configuration file, hcid.conf, in Gedit, using superuser powers:

Code:

gksu gedit /etc/bluetooth/hcid.conf

Look for the line that reads "security user", and change it so that it reads "security auto".

The default PIN needed to pair with Ubuntu is 1234. For security reasons, it’s wise to change this, and the setting is contained further down in the hcid.conf file. Look for the line that reads

Code:

passkey "1234";

and replace 1234 with the number you desire. For example, if I wanted a PIN of 9435, the line would read

Code:

passkey "9435";

When you’ve finished, save the file, and close Gedit. It’s then necessary to restart the background Bluetooth service. To do this, type the following into a Terminal window (Applications -> Accessores -> Terminal):

Code:

sudo /etc/init.d/bluetooth restart

Following this, I paired my Ubuntu test PC to a Nokia 6680 mobile phone. It’s easiest to initiate pairing on the phone, which should then autosense the PC’s Bluetooth connection.

On my Samsung Champ, I opened the menu, and selected Connections -> Bluetooth. Then I pressed the right arrow key to select Paired Devices and selected Options -> New Paired Device -> More Devices. This made the phone autosense my Ubuntu PC, which was identified by its hostname, followed by -0. In my case, the Ubuntu PC was identified as keir-desktop-0, and I was then prompted to enter the PIN I set earlier. Following this, the two devices were paired.

In the next episode we will discuss how to transfer/receive files through bluetooth.
Till then, bbye.