tun, rfs: fix the incorrect hash value
authorZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Thu, 2 Jan 2014 05:24:28 +0000 (13:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Jan 2014 07:41:22 +0000 (02:41 -0500)
The code incorrectly save the queue index as the hash, so this patch
is fixing it with the hash received in the stack receive path.

Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c

index 3cf0457f5c699d337cd86cf2c7796bd92344d6f1..09f66624eaca1eea40793f4c6c5c057f837a2e20 100644 (file)
@@ -378,8 +378,8 @@ static u16 tun_select_queue(struct net_device *dev, struct sk_buff *skb)
        if (txq) {
                e = tun_flow_find(&tun->flows[tun_hashfn(txq)], txq);
                if (e) {
-                       txq = e->queue_index;
                        tun_flow_save_rps_rxhash(e, txq);
+                       txq = e->queue_index;
                } else
                        /* use multiply and shift instead of expensive divide */
                        txq = ((u64)txq * numqueues) >> 32;