Subject: Re: Best way to set kernel thread affinity for handling a socket?

From: Chris Friesen <[email-masked]>
Date: Thu, 23 Aug 2012 11:56:16 -0600

On 08/23/2012 11:04 AM, Roland Dreier wrote:
> On Wed, Aug 22, 2012 at 9:21 AM, Ben Hutchings
> <[email-masked]>  wrote:
>> With RFS we try to do the reverse: move the packets to match the socket
>> user.   But it's not (yet) turned on by default.  See
>> Documentation/networking/scaling.txt
>
> Fair enough.  However I think at least in this case it sounds like extra
> overhead: it should be easy for us to do everything on the CPU where
> the packets are being received.

In the general case though RFS can be useful.  We have a server with one 
application instance per core.  It's beneficial to be able to steer 
packets destined for a given instance to an eth driver queue whose 
interrupt is handled by the cpu running that instance.

Depending on the hardware being used, it may be possible to do this more 
efficiently.  The ixgbe driver (if the feature is enabled) will 
periodically look at the outgoing tcp traffic and set up hardware flow 
filtering rules to direct incoming traffic for that connection to the 
queue that sent out the messages.

Chris