aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 2ac2164a1e39..40b426edc9e6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -297,13 +297,12 @@ static void tun_flow_cleanup(unsigned long data)
297 spin_unlock_bh(&tun->lock); 297 spin_unlock_bh(&tun->lock);
298} 298}
299 299
300static void tun_flow_update(struct tun_struct *tun, struct sk_buff *skb, 300static void tun_flow_update(struct tun_struct *tun, u32 rxhash,
301 u16 queue_index) 301 u16 queue_index)
302{ 302{
303 struct hlist_head *head; 303 struct hlist_head *head;
304 struct tun_flow_entry *e; 304 struct tun_flow_entry *e;
305 unsigned long delay = tun->ageing_time; 305 unsigned long delay = tun->ageing_time;
306 u32 rxhash = skb_get_rxhash(skb);
307 306
308 if (!rxhash) 307 if (!rxhash)
309 return; 308 return;
@@ -1010,6 +1009,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1010 int copylen; 1009 int copylen;
1011 bool zerocopy = false; 1010 bool zerocopy = false;
1012 int err; 1011 int err;
1012 u32 rxhash;
1013 1013
1014 if (!(tun->flags & TUN_NO_PI)) { 1014 if (!(tun->flags & TUN_NO_PI)) {
1015 if ((len -= sizeof(pi)) > total_len) 1015 if ((len -= sizeof(pi)) > total_len)
@@ -1162,12 +1162,13 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1162 skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY; 1162 skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY;
1163 } 1163 }
1164 1164
1165 rxhash = skb_get_rxhash(skb);
1165 netif_rx_ni(skb); 1166 netif_rx_ni(skb);
1166 1167
1167 tun->dev->stats.rx_packets++; 1168 tun->dev->stats.rx_packets++;
1168 tun->dev->stats.rx_bytes += len; 1169 tun->dev->stats.rx_bytes += len;
1169 1170
1170 tun_flow_update(tun, skb, tfile->queue_index); 1171 tun_flow_update(tun, rxhash, tfile->queue_index);
1171 return total_len; 1172 return total_len;
1172} 1173}
1173 1174