--- zzzz-none-000/linux-4.4.60/net/ipv6/sit.c 2017-04-08 07:53:53.000000000 +0000 +++ wasp-540e-714/linux-4.4.60/net/ipv6/sit.c 2019-07-03 09:21:34.000000000 +0000 @@ -87,6 +87,21 @@ struct net_device *fb_tunnel_dev; }; +void ipip6_update_offload_stats(struct net_device *dev, void *ptr) +{ + struct pcpu_sw_netstats *tstats = per_cpu_ptr(dev->tstats, 0); + const struct pcpu_sw_netstats *offload_stats = + (struct pcpu_sw_netstats *)ptr; + + u64_stats_update_begin(&tstats->syncp); + tstats->tx_packets += offload_stats->tx_packets; + tstats->tx_bytes += offload_stats->tx_bytes; + tstats->rx_packets += offload_stats->rx_packets; + tstats->rx_bytes += offload_stats->rx_bytes; + u64_stats_update_end(&tstats->syncp); +} +EXPORT_SYMBOL(ipip6_update_offload_stats); + /* * Must be invoked with rcu_read_lock */ @@ -709,6 +724,8 @@ tstats->rx_bytes += skb->len; u64_stats_update_end(&tstats->syncp); + /* Reset the skb_iif to Tunnels interface index */ + skb->skb_iif = tunnel->dev->ifindex; netif_rx(skb); return 0; @@ -984,6 +1001,8 @@ skb_set_inner_ipproto(skb, IPPROTO_IPV6); + /* Reset the skb_iif to Tunnels interface index */ + skb->skb_iif = tunnel->dev->ifindex; err = iptunnel_xmit(NULL, rt, skb, fl4.saddr, fl4.daddr, protocol, tos, ttl, df, !net_eq(tunnel->net, dev_net(dev)));