datapath: Clear rxhash when using an action that may affect it
authorSimon Horman <horms@verge.net.au>
Mon, 7 Feb 2011 02:07:14 +0000 (11:07 +0900)
committerJesse Gross <jesse@nicira.com>
Mon, 7 Feb 2011 23:36:41 +0000 (15:36 -0800)
Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: Change version check from 2.6.37 to 2.6.35]
Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/actions.c
datapath/actions.h
datapath/tunnel.c

index 8939377104d6e54e0f9820cad63d9146ce1217c8..c44e00c4cfeedd3d8188c94446424c4e3fa9db83 100644 (file)
@@ -158,6 +158,8 @@ static struct sk_buff *set_nw_addr(struct sk_buff *skb,
                inet_proto_csum_replace4(check, skb, *nwaddr, new_nwaddr, 1);
        csum_replace4(&nh->check, *nwaddr, new_nwaddr);
 
+       skb_clear_rxhash(skb);
+
        *nwaddr = new_nwaddr;
 
        return skb;
@@ -217,6 +219,7 @@ static struct sk_buff *set_tp_port(struct sk_buff *skb,
        port = nla_type(a) == ODP_ACTION_ATTR_SET_TP_SRC ? &th->source : &th->dest;
        inet_proto_csum_replace2(check, skb, *port, nla_get_be16(a), 0);
        *port = nla_get_be16(a);
+       skb_clear_rxhash(skb);
 
        return skb;
 }
index 5ad322f7542b2d3524b62fb29b9c7bb70e2c97bf..3348ae2c2be6f339a356297be4b99de6af14c033 100644 (file)
@@ -20,4 +20,11 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb,
                    const struct sw_flow_key *,
                    const struct nlattr *, u32 actions_len);
 
+static inline void skb_clear_rxhash(struct sk_buff *skb)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)
+       skb->rxhash = 0;
+#endif
+}
+
 #endif /* actions.h */
index 4cabd93c595741ddc04823d922dc74bd082afbf3..a0d9fd959a86ad03375a0b25bbd34388b49ab15a 100644 (file)
@@ -436,6 +436,7 @@ void tnl_rcv(struct vport *vport, struct sk_buff *skb)
 
        skb_dst_drop(skb);
        nf_reset(skb);
+       skb_clear_rxhash(skb);
        secpath_reset(skb);
 
        ecn_decapsulate(skb);
@@ -1203,6 +1204,7 @@ int tnl_send(struct vport *vport, struct sk_buff *skb)
        nf_reset(skb);
        secpath_reset(skb);
        skb_dst_drop(skb);
+       skb_clear_rxhash(skb);
 
        /* Offloading */
        skb = handle_offloads(skb, mutable, rt);