--- zzzz-none-000/linux-4.19.183/drivers/net/bonding/bond_main.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/net/bonding/bond_main.c 2023-06-28 08:54:19.000000000 +0000 @@ -1160,6 +1160,15 @@ if (unlikely(!skb)) return RX_HANDLER_CONSUMED; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + + /* NOTE: bond device shouldn't modify the packet; + * also it does not hold its own stats rather gets the cummulative stats from its slave devices [ see:bond_get_stats() ]; + * blog stats are not needed for the same reason; + * blog_link() is needed so that when bond device goes down ; FC will be able to remove the flows + */ + blog_link( IF_DEVICE, blog_ptr(skb), (void*)skb->dev, DIR_RX, skb->len ); +#endif /* defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) */ *pskb = skb; slave = bond_slave_get_rcu(skb->dev); @@ -4197,6 +4206,20 @@ !bond_slave_override(bond, skb)) return NETDEV_TX_OK; +#if defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) + +/* Only XOR or 802.3AD mode can be accelerated by flow-cache -- these are flow-based mode */ +#define BOND_SUPPORTED_ACCL_MODE(mode) (((mode) == BOND_MODE_XOR) || ((mode) == BOND_MODE_8023AD)) + +/* IS_SKB check not needed unless we support flow-cache acceleration to bond device in other modes;*/ + + if (!BOND_SUPPORTED_ACCL_MODE(bond->params.mode)) + blog_skip(skb, blog_skip_reason_bond); + else + blog_link( IF_DEVICE, blog_ptr(skb), (void*)dev, DIR_TX, skb->len ); + +#endif /* defined(CONFIG_BCM_KF_BLOG) && defined(CONFIG_BLOG) */ + switch (BOND_MODE(bond)) { case BOND_MODE_ROUNDROBIN: return bond_xmit_roundrobin(skb, dev);