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>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 12 Sep 2022 19:43:14 +0400 (MSK)
From:   Василий Умрихин 
        <umrihin@...evt.ru>
To:     netdev <netdev@...r.kernel.org>
Subject: RFH, is it possible to set ndo_start_xmit() cpu affinity in
 ethernet driver?

Hi netdev,

On the receiving side we have the opportunity to choose the CPU that will process the receive queue (RPS). 
On the sender side XPS selects the send queue for the given CPU, but there is no way to select the CPU on which ndo_start_xmit() will be launched.
Taskset is able to bind user task, but in ndo_start_xmit() binding differs.
In my case CPU0 reserved for polling kthread, because our NIC have no interrupts, therefore it is necessary. I need nothing else to run on this CPU. 

For example, setting CPU1 for RPS on both nodes:

host1: echo 0x2 > /sys/class/net//queues/rx-0/rps_cpus 
host2: echo 0x2 > /sys/class/net//queues/rx-0/rps_cpus 

Then run iperf on two nodes: 

host1: taskset -c 1 iperf -s 
host2: taskset -c 1 iperf -c host1 

After adding pr_info("cpu%d\n", smp_processor_id()); in my ndo_start_xmit() method, see in dmesg: 

host1: dmesg | grep cpu0 | wc -l
0 
host2: dmesg | grep cpu0 | wc -l
6512

Is it possible to choose the CPU on which ndo_start_xmit() will be launched on the sender side?

Kind regards, Vasiliy

Powered by blists - more mailing lists