--- zzzz-none-000/linux-4.19.183/net/ipv6/ip6_gre.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/net/ipv6/ip6_gre.c 2023-06-28 08:54:21.000000000 +0000 @@ -58,6 +58,10 @@ #include #include +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +#include +#endif + static bool log_ecn_error = true; module_param(log_ecn_error, bool, 0644); @@ -117,9 +121,15 @@ /* Given src, dst and key, find appropriate for input tunnel. */ +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev, + const struct in6_addr *remote, const struct in6_addr *local, + __be32 key, __be16 gre_proto) +#else static struct ip6_tnl *ip6gre_tunnel_lookup(struct net_device *dev, const struct in6_addr *remote, const struct in6_addr *local, __be32 key, __be16 gre_proto) +#endif { struct net *net = dev_net(dev); int link = dev->ifindex; @@ -250,6 +260,9 @@ return NULL; } +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +EXPORT_SYMBOL(ip6gre_tunnel_lookup); +#endif static struct ip6_tnl __rcu **__ip6gre_bucket(struct ip6gre_net *ign, const struct __ip6_tnl_parm *p) @@ -733,6 +746,15 @@ struct ip6_tnl *tunnel = netdev_priv(dev); __be16 protocol; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + blog_link(IF_DEVICE, blog_ptr(skb), (void*)dev, DIR_TX, skb->len); + blog_link(GRE_TUNL, blog_ptr(skb), (void*)tunnel, DIR_TX, 0); + blog_link(TOS_MODE, blog_ptr(skb), tunnel, DIR_TX, + (tunnel->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) ? + BLOG_TOS_INHERIT : BLOG_TOS_FIXED); + + skb->bcm_ext.tunl = tunnel; +#endif if (dev->type == ARPHRD_ETHER) IPCB(skb)->flags = 0; @@ -773,12 +795,21 @@ gre_build_header(skb, tunnel->tun_hlen, flags, protocol, tunnel_id_to_key32(tun_info->key.tun_id), +#if (defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG)) + (flags & TUNNEL_SEQ) && !blog_gre_tunnel_accelerated() ? + htonl(tunnel->o_seqno): 0); +#else (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) - : 0); - + : 0); +#endif } else { if (tunnel->parms.o_flags & TUNNEL_SEQ) +#if (defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG)) + if (!blog_gre_tunnel_accelerated()) + tunnel->o_seqno++; +#else tunnel->o_seqno++; +#endif gre_build_header(skb, tunnel->tun_hlen, tunnel->parms.o_flags, protocol, tunnel->parms.o_key,