UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
8,414 Views
Registered: ‎01-20-2012

skb_over_panic during DHCP – 2 problems fixed

Using Petalinux on custom Zynq hardware, we were occasionally getting a panic at bootup, during DHCP. The console message was something like:

 

INIT: Entering runlevel: 5

Configuring network interfaces... udhcpc (v1.23.2) started

Sending discover...

skbuff: skb_over_panic: text:c02e46e4 len:5838 put:5838 head:dd656900 data:dd656940 tail:0xdd65800e

 

I traced this back to the file drivers/net/ethernet/Xilinx/xilinx_emacps.c, which calls skb_put() as packets are received. Updating to the latest version of this file (GitHub) seemed to make it happen less often, but didn’t eliminate it.

I added this patch to the function xemacps_rx(), just before skb_put() is called:

   if ((skb->tail+len) > skb->end) {

     dev_err(&lp->pdev->dev, "skb length error %u\n", len);

     dev_kfree_skb(new_skb);

     numbdfree = 0xFFFFFFFF;

     break;

   }

 

I could see the ‘skb length error’ message come up instead of the panic. However, DHCP would fail when this happened:

 

INIT: Entering runlevel: 5

Configuring network interfaces... udhcpc (v1.23.2) started

Sending discover...

xemacps e000b000.ethernet: skb length error 5946

Sending discover...

Sending discover...

No lease, failing

xemacps e000b000.ethernet: Set clk to 124999999 Hz

xemacps e000b000.ethernet: link up (1000/FULL)

 

Apparently the Ethernet interface isn’t fully up when DHCP begins (this is likely the cause of a malformed receive packet that caused the skb_put() issue in the first place). So I modified the /etc/network/interfaces file to set the udhcpc option to retry 10 times instead of 3:

# Wired or wireless interfaces

auto eth0

iface eth0 inet dhcp

udhcpc_opts -t 10

 

This worked.

0 Kudos
3 Replies
Visitor perok
Visitor
5,925 Views
Registered: ‎05-27-2016

Re: skb_over_panic during DHCP – 2 problems fixed

Using a linux kernel tagged xilinx-v2013.4 (any upgrade is for the next generation of my SW), I have applied the above fix since I was getting a corresponding kernel panic.

 

[13860.262335] skbuff: skb_over_panic: text:c02d4e70 len:10733 put:10733 head:d2fe5b00 data:d2fe5b40 tail:0xd2fe852d end:0xd2fe6140 dev:eth0
...

[13860.481291] [<c0400e08>] (skb_panic+0x50/0x5c) from [<c036212c>] (skb_put+0x44/0x50)
[13860.489032] [<c036212c>] (skb_put+0x44/0x50) from [<c02d4e70>] (xemacps_rx_poll+0x1a0/0x354)
[13860.497438] [<c02d4e70>] (xemacps_rx_poll+0x1a0/0x354) from [<c036d8b4>] (net_rx_action+0x68/0x164)

 

Having applied the fix, I randomly get the following

 

[ 4255.439677] xemacps e000b000.ps7-ethernet: skb length error 14641
[ 4255.445778] xemacps e000b000.ps7-ethernet: skb length error 14641
[ 4255.451842] xemacps e000b000.ps7-ethernet: skb length error 14641
[ 4255.457907] xemacps e000b000.ps7-ethernet: skb length error 14641

 

... and it goes on and on...

 

To me, this looks like the same message is handled over and over again.  Is there a way to drop the message and move on to the next?

 

0 Kudos
5,920 Views
Registered: ‎01-20-2012

Re: skb_over_panic during DHCP – 2 problems fixed

It seems unlikely that it's processing the same message but it's possible I guess. Do the messages stop if you unplug the Ethernet cable while they're appearing? If so, it might be something on your network sending rogue packets. Otherwise, all I can suggest is digging through the code and planting some debug messages. It's painful but such is Linux.

0 Kudos
Visitor perok
Visitor
5,884 Views
Registered: ‎05-27-2016

Re: skb_over_panic during DHCP – 2 problems fixed

To answer your question: Yes, the messages continue even after disconnecting the "outside world". I will try to investigate using printouts as you suggested.
0 Kudos