]> git.proxmox.com Git - ovs.git/commit
ofproto-dpif-upcall: Echo HASH attribute back to datapath.
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Fri, 15 Nov 2019 02:58:59 +0000 (10:58 +0800)
committerBen Pfaff <blp@ovn.org>
Fri, 22 Nov 2019 17:51:57 +0000 (09:51 -0800)
commit0442bfb11d6ccbf11754ef1d6de603b970465302
treebe4a57b4d19e2cae6c6fc23da13a71f620653fef
parentdf711aae1fcefcbbe76835f0b5cb9d03ea5babf7
ofproto-dpif-upcall: Echo HASH attribute back to datapath.

The kernel datapath may sent upcall with hash info,
ovs-vswitchd should get it from upcall and then send
it back.

The reason is that:
| When using the kernel datapath, the upcall don't
| include skb hash info relatived. That will introduce
| some problem, because the hash of skb is important
| in kernel stack. For example, VXLAN module uses
| it to select UDP src port. The tx queue selection
| may also use the hash in stack.
|
| Hash is computed in different ways. Hash is random
| for a TCP socket, and hash may be computed in hardware,
| or software stack. Recalculation hash is not easy.
|
| There will be one upcall, without information of skb
| hash, to ovs-vswitchd, for the first packet of a TCP
| session. The rest packets will be processed in Open vSwitch
| modules, hash kept. If this tcp session is forward to
| VXLAN module, then the UDP src port of first tcp packet
| is different from rest packets.
|
| TCP packets may come from the host or dockers, to Open vSwitch.
| To fix it, we store the hash info to upcall, and restore hash
| when packets sent back.

Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2019-October/364062.html
Link: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=bd1903b7c4596ba6f7677d0dfefd05ba5876707d
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
datapath/linux/compat/include/linux/openvswitch.h
lib/dpif-netlink.c
lib/dpif.h
ofproto/ofproto-dpif-upcall.c