[Feature][T106_eSDK]update from T106-V2.01.01.02P56U06.AP.15.05_CAP.15.05 to T106-V2.01.01.02P56U06.AP.15.11_CAP.15.11.01
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: If8f21262a363af23493123574902bf038b8ff297
diff --git a/upstream/linux-5.10/drivers/net/zvnet/zvnet_dev.c b/upstream/linux-5.10/drivers/net/zvnet/zvnet_dev.c
index bea60e1..2a8fcc3 100755
--- a/upstream/linux-5.10/drivers/net/zvnet/zvnet_dev.c
+++ b/upstream/linux-5.10/drivers/net/zvnet/zvnet_dev.c
@@ -72,6 +72,10 @@
module_param(g_wrap_num, int, 0644);
unsigned int g_wrap_timeout = 10;
module_param(g_wrap_timeout, int, 0644);
+/*jb.qi add for debug network package on 20240806 start*/
+unsigned int g_trace_limit = 0;
+module_param(g_trace_limit, int, 0644);
+/*jb.qi add for debug network package on 20240806 end*/
#endif
/*******************************************************************************
@@ -143,7 +147,19 @@
}
}
}
+/*jb.qi add for debug network package on 20240806 start*/
+void zvnet_dump_packet(unsigned char * data, int len, int limit_len)
+{
+ int i = 0;
+ for(i = 0; i < len && i < limit_len; i=i+16)
+ {
+ printk("0x%04x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n",i,
+ *(data+i),*(data+i+1),*(data+i+2),*(data+i+3),*(data+i+4),*(data+i+5),*(data+i+6),*(data+i+7),
+ *(data+i+8),*(data+i+9),*(data+i+10),*(data+i+11),*(data+i+12),*(data+i+13),*(data+i+14),*(data+i+15));
+ }
+}
+/*jb.qi add for debug network package on 20240806 end*/
int zvnet_get_index_by_netdev(struct net_device *net)
{
int i;
@@ -288,6 +304,13 @@
/* make sure we initialize shinfo sequentially */
skb_reset_network_header(skb);
skb_set_kcov_handle(skb, kcov_common_handle());
+ /*jb.qi add for debug network package on 20240806 start*/
+ if(unlikely(g_trace_limit > 0)){
+ printk("-%s-dump_packet-start-%d\n", skb->dev->name, skb->len);
+ zvnet_dump_packet(skb->data, skb->len, g_trace_limit);
+ printk("-%s-dump_packet-end-\n", skb->dev->name);
+ }
+ /*jb.qi add for debug network package on 20240806 end*/
return skb;
}
@@ -451,7 +474,7 @@
}
if(unlikely(skb_headroom(skb) < NET_SKB_PAD || skb->next//|| skb->capHead
- || skb->fclone || skb->cloned || (skb_shinfo(skb)->nr_frags)
+ || skb->fclone || skb->cloned || (skb_shinfo(skb)->nr_frags) || skb->sk || (skb->indev == NULL)
|| (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) || (skb_has_frag_list(skb)))){
int ret_len = skb->len;