--- zzzz-none-000/linux-4.19.183/net/ipv4/ip_gre.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/net/ipv4/ip_gre.c 2023-06-28 08:54:21.000000000 +0000 @@ -50,6 +50,10 @@ #include #include +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +#include +#endif + /* Problems & solutions -------------------- @@ -117,8 +121,13 @@ u32 id, u32 index, bool truncate, bool is_ipv4); +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) +unsigned int ipgre_net_id __read_mostly; +unsigned int gre_tap_net_id __read_mostly; +#else static unsigned int ipgre_net_id __read_mostly; static unsigned int gre_tap_net_id __read_mostly; +#endif static unsigned int erspan_net_id __read_mostly; static void ipgre_err(struct sk_buff *skb, u32 info, @@ -263,7 +272,9 @@ struct erspan_md2 *md2; int ver; int len; - +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + blog_skip(skb, blog_skip_reason_unknown_proto); /* No blogging */ +#endif itn = net_generic(net, erspan_net_id); iph = ip_hdr(skb); @@ -361,6 +372,14 @@ if (!tun_dst) return PACKET_REJECT; } +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + if(blog_ptr(skb)){ + blog_link(IF_DEVICE, blog_ptr(skb), (void*)tunnel->dev, DIR_RX, + skb->len); + blog_link(GRE_TUNL, blog_ptr(skb), (void*)tunnel, DIR_RX, 0); + blog_link(TOS_MODE, blog_ptr(skb), tunnel, DIR_RX, BLOG_TOS_FIXED); + } +#endif ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); return PACKET_RCVD; @@ -436,7 +455,12 @@ { struct ip_tunnel *tunnel = netdev_priv(dev); +#if (defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG)) + if ((tunnel->parms.o_flags & TUNNEL_SEQ) + && !blog_gre_tunnel_accelerated()) +#else if (tunnel->parms.o_flags & TUNNEL_SEQ) +#endif tunnel->o_seqno++; /* Push GRE header. */ @@ -444,6 +468,14 @@ tunnel->parms.o_flags, proto, tunnel->parms.o_key, htonl(tunnel->o_seqno)); +#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, tnl_params->tos); + + skb->bcm_ext.tunl = tunnel; + +#endif ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol); }