--- zzzz-none-000/linux-4.9.231/net/ipv6/ip6_gre.c 2020-07-22 07:10:54.000000000 +0000 +++ falcon-5590-729/linux-4.9.231/net/ipv6/ip6_gre.c 2022-03-30 12:03:35.000000000 +0000 @@ -565,6 +565,8 @@ if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; + fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); + err = gre_handle_offloads(skb, !!(t->parms.o_flags & TUNNEL_CSUM)); if (err) return -1; @@ -624,6 +626,8 @@ if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; + fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); + if (gre_handle_offloads(skb, !!(t->parms.o_flags & TUNNEL_CSUM))) return -1; @@ -1572,6 +1576,20 @@ .get_link_net = ip6_tnl_get_link_net, }; +#if IS_ENABLED(CONFIG_PPA) +extern uint32_t (*ppa_is_ipv6_gretap_fn)(struct net_device *dev); + +static u32 ppa_is_ipv6_gretap(struct net_device *dev) +{ + /* NOTE: + * To include acelerated counters in ip6gre_tap net_device stats, + * ip6gre_tap netdev_ops pointer (i.e., @ip6gre_tap_netdev_ops) can be modified with a new one. + * This is specifically to overload @ndo_get_stats64, but @ndo_init remains unchanged. + */ + return (dev && dev->netdev_ops && (dev->netdev_ops->ndo_init == ip6gre_tap_netdev_ops.ndo_init)); +} +#endif + /* * And now the modules code and kernel interface. */ @@ -1600,6 +1618,10 @@ if (err < 0) goto tap_ops_failed; +#if IS_ENABLED(CONFIG_PPA) + ppa_is_ipv6_gretap_fn = ppa_is_ipv6_gretap; +#endif + out: return err; @@ -1614,6 +1636,9 @@ static void __exit ip6gre_fini(void) { +#if IS_ENABLED(CONFIG_PPA) + ppa_is_ipv6_gretap_fn = NULL; +#endif rtnl_link_unregister(&ip6gre_tap_ops); rtnl_link_unregister(&ip6gre_link_ops); inet6_del_protocol(&ip6gre_protocol, IPPROTO_GRE);