Netdev List
 help / color / mirror / Atom feed
* RPS and forwarding
@ 2010-04-26  2:24 Herbert Xu
  2010-04-26  4:44 ` Tom Herbert
  0 siblings, 1 reply; 11+ messages in thread
From: Herbert Xu @ 2010-04-26  2:24 UTC (permalink / raw)
  To: David S. Miller, netdev

Hi:

I'm sorry I didn't have time to jump into the RPS discussions
earlier, so in a way I'm just getting what I deserved :)

Anyway, I am specifically concerned about the possibility of
reordering of forwarded traffic.

As RPS is doing fuzzy matching, it is possible (and quite likely
if rps_sock_flow_table is small) for a forwarded flow to be hashed
to the same index as a local flow.

In that case we may end up redirecting a forwarded flow.  That
in itself is undesirable because for forwarded flows the best
solution is to stay on the ingress CPU.

What's worse is that if the local flow bounces around different
CPUs, the forwarded flow will follow it.

For a local flow RPS can guarantee original ordering (assuming
we're not doing anything weird like netfilter queueing), but
this doesn't work for forwarded flows.

Even if netif_receive_skb has completed, the forwarded packet
may still be sitting in a hardware TX queue, selected based
on the processing CPU.  If you then bounce the forwarded flow
then packets may be placed in a different hardware TX queue,
causing reordering.

BTW, selecting hardware TX queues for forwarded flows based
on the rxhash is not a good solution, as that causes cache-line
bouncing between CPUs.

Apart from not using RPS on routers, I suppose people doing
forwarding will simply have to maintain a constant RPS table,
and forgo its local redirection capabilities.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-26  7:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-26  2:24 RPS and forwarding Herbert Xu
2010-04-26  4:44 ` Tom Herbert
2010-04-26  4:53   ` Herbert Xu
2010-04-26  5:00     ` Tom Herbert
2010-04-26  6:28       ` David Miller
2010-04-26  6:31         ` Herbert Xu
2010-04-26  7:25           ` Eric Dumazet
2010-04-26  7:30             ` Herbert Xu
2010-04-26  7:38               ` Eric Dumazet
2010-04-26  7:41                 ` Herbert Xu
2010-04-26  5:15   ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox