Re: SO_REUSEPORT - can it be done in kernel?

Eric Dumazet
2011-03-02T02:56:43Z

Le mercredi 02 mars 2011 à 10:39 +0800, Herbert Xu a écrit :

> UDP is a datagram protocol, TCP is not.
>
> Anyway, here is an alternate proposal. When a TCP socket transmits
> for the first time (SYN or SYN-ACK), we pick a queue based on CPU and
> store it in the socket. From then on we stick to that selection.
>

Many TCP apps I know use one thread to perform listen/accept and a pool
of threads to handle each new conn.

Anyway, the SYN-ACK is generated by softirq, not really user choice.
CPU depends if NIC is RX multiqueue or RPS is setup.

All this discussion is about letting process scheduler decide TX queue,
(because user/admin used cpu affinity) or let network stack drive
scheduler : Please migrate this thread on this cpu.

Both schems should be allowed/configurable so that best results are
available.

> We would only allow changes if we can ensure that all transmitted
> packets have left the queue. Or we just never change it like we
> do now.
>

We do change in case of dst/route change. Each device can have different
number of TX queues.