tunneling: Use flow flag for GRE checksum calculation.
authorJesse Gross <jesse@nicira.com>
Fri, 27 Mar 2015 05:55:53 +0000 (22:55 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 7 Apr 2015 23:26:56 +0000 (16:26 -0700)
The indication to calculate the GRE checksum is currently the port
config rather than the tunnel flow. Currently there is a one to one
mapping between the two so there is no difference. However, the
kernel datapath must use the flow and it is also potentially more
flexible, so this switches how we decide whether to calculate the
checksum.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pritesh Kothari <pritesh.kothari@cisco.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
lib/netdev-vport.c

index a9639d3..0e0d791 100644 (file)
@@ -1040,7 +1040,7 @@ netdev_gre_build_header(const struct netdev *netdev,
     greh->flags = 0;
 
     options = (ovs_16aligned_be32 *) (greh + 1);
-    if (tnl_cfg->csum) {
+    if (tnl_flow->tunnel.flags & FLOW_TNL_F_CSUM) {
         greh->flags |= htons(GRE_CSUM);
         put_16aligned_be32(options, 0);
         options++;