--- zzzz-none-000/linux-4.9.276/net/ipv6/ip6_gre.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/net/ipv6/ip6_gre.c 2023-04-05 08:19:02.000000000 +0000 @@ -564,6 +564,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; @@ -623,6 +625,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; @@ -1570,6 +1574,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. */ @@ -1598,6 +1616,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; @@ -1612,6 +1634,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);