datapath: Fix tunnel source port selection for mega flow
authorAndy Zhou <azhou@nicira.com>
Tue, 2 Jul 2013 22:58:19 +0000 (15:58 -0700)
committerJesse Gross <jesse@nicira.com>
Wed, 3 Jul 2013 00:25:28 +0000 (17:25 -0700)
commit8199967c72ba25d0532624650b0ef426f06063c3
tree8514c3c1692e47307d1257df183252e2feed182b
parentdc83eda1ac3241c1fe6fc5ccd16ac7f117c07398
datapath: Fix tunnel source port selection for mega flow

Tunnel source port selection was based on hash value cached in the
flow. This no longer works with mega flow, since all flows matching
a mega flow will be transmitted with the same tunnel source port.

This patch computes the tunnel source port at run time based on each
incoming packet. Packets belong to the same micro flow would still get
the same source port, but multiple micro flows hitting the same mega flow
can get different source ports.

Packets injected from the usespace will be assigned to the same
source port as if they are forwarded in the kernel.

Bug #18216

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/tunnel.c