cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
venkatakrishs
Observer
Observer
316 Views
Registered: ‎02-21-2021

AXI Ethernet Lite issue with linux in ARTY-100T board

Hi,

I am currently using Linux 5.5.0-rc1 with custom soc in Xilinx ARTY-100T board. I have enabled AXI Ethernet Lite driver in the Linux Kernel. The probing and open of the network device is done while the interrupt is through the PLIC with interrupt id 29.  When I connect the ethernet cable the kernel throws this log and goes in an infinite loop.

[ 1160.548156] random: fast init done
[ 1174.356597] random: crng init done
[ 1248.949310] swapper: page allocation failure: order:0, mode:0xa20(GFP_ATOMIC), nodemask=(null)
[ 1249.209259] CPU: 0 PID: 0 Comm: swapper Not tainted 5.5.0-rc1-00002-g1606ca44fcdd-dirty #6
[ 1249.505401] Call Trace:
[ 1249.594543] [<ffffffe00098a61c>] walk_stackframe+0x0/0x108
[ 1249.791534] [<ffffffe00098aa60>] show_stack+0x3c/0x50
[ 1249.973083] [<ffffffe000c1170c>] dump_stack+0x2c/0x3c
[ 1250.154327] [<ffffffe000a242f0>] warn_alloc+0xcc/0x144
[ 1250.338958] [<ffffffe000a24af4>] __alloc_pages_slowpath+0x78c/0x90c
[ 1250.564208] [<ffffffe000a24ea0>] __alloc_pages_nodemask+0x198/0x1d8
[ 1250.789398] [<ffffffe000a25290>] page_frag_alloc+0x180/0x198
[ 1250.992919] [<ffffffe000b3ecac>] __netdev_alloc_skb+0xec/0x1a0
[ 1251.202453] [<ffffffe000b100c4>] xemaclite_rx_handler+0x30/0x124
[ 1251.418273] [<ffffffe000b102e8>] xemaclite_interrupt+0x130/0x174
[ 1251.634246] [<ffffffe0009c376c>] __handle_irq_event_percpu+0x7c/0x19c
[ 1251.865661] [<ffffffe0009c3960>] handle_irq_event+0x48/0xac
[ 1252.066009] [<ffffffe0009c7e4c>] handle_fasteoi_irq+0xa0/0x228
[ 1252.275482] [<ffffffe0009c2ea0>] generic_handle_irq+0x34/0x50
[ 1252.482086] [<ffffffe000ab65f4>] plic_handle_irq+0x94/0x104
[ 1252.682220] [<ffffffe000c31b1c>] do_IRQ+0x94/0xac
[ 1252.851043] [<ffffffe000988fcc>] ret_from_exception+0x0/0x10
[ 1253.053100] Mem-Info:
[ 1253.137359] active_anon:799 inactive_anon:1935 isolated_anon:0
[ 1253.137359]  active_file:0 inactive_file:0 isolated_file:0
[ 1253.137359]  unevictable:0 dirty:0 writeback:0 unstable:0
[ 1253.137359]  slab_reclaimable:1159 slab_unreclaimable:5517
[ 1253.137359]  mapped:477 shmem:2494 pagetables:22 bounce:0
[ 1253.137359]  free:536 free_pcp:41 free_cma:0
[ 1254.281677] Node 0 active_anon:3196kB inactive_anon:7740kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:1908kB dirty:0kB writeback:0kB shmem:9976kB writeback_tmp:0kB unstable:0kB all_unreclaimable? no
[ 1255.080505] DMA32 free:2144kB min:5776kB low:6196kB high:6616kB reserved_highatomic:0KB active_anon:3196kB inactive_anon:7740kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:260096kB managed:186520kB mlocked:0kB kernel_stack:152kB pagetables:88kB bounce:0kB free_pcp:164kB local_pcp:164kB free_cma:0kB
[ 1256.124969] lowmem_reserve[]: 0 0 0
[ 1256.250274] DMA32: 0*4kB 0*8kB 0*16kB 1*32kB (U) 1*64kB (U) 0*128kB 0*256kB 0*512kB 0*1024kB 1*2048kB (U) 0*4096kB = 2144kB
[ 1256.650939] 2494 total pagecache pages
[ 1256.785461] 65024 pages RAM
[ 1256.885467] 0 pages HighMem/MovableOnly
[ 1257.023132] 18394 pages reserved
[ 1257.139953] net eth0: Could not allocate receive buffer

I am not sure what is causing this issue. I tried to print the value len from the interrupt handler 

len = ETH_FRAME_LEN + ETH_FCS_LEN;

and has the value 1518.

I am not sure  if the driver is working correctly.

Thanks in advance.

0 Kudos
5 Replies
dpaul24
Scholar
Scholar
300 Views
Registered: ‎08-07-2014

@venkatakrishs ,

1518 for a normal raw Eth frm (non Jumbo frm) is correct.

Break up -: 6 + 6 + 2 + 1500 + 4 (Dst Addr + Src Addr + Ether Type + Max Payload length + FCS)

------------FPGA enthusiast------------
Consider giving "Kudos" if you like my answer. Please mark my post "Accept as solution" if my answer has solved your problem

0 Kudos
venkatakrishs
Observer
Observer
256 Views
Registered: ‎02-21-2021

Hi @dpaul24,

I am able to understand what you are trying to explain but the issue is not in the size now, the issue is that when I connect my cable after logging in the above log reports and the last line in that

[ 1257.139953] net eth0: Could not allocate receive buffer

repeats in an infinite loop and I cannot even use the linux to issue some command like ping or traceroute to check the ethernet connection. It seems to be like a blocking call.

Thanks.

0 Kudos
hokim
Scholar
Scholar
245 Views
Registered: ‎10-21-2015

Hi

swapper: page allocation failure: order:0, mode:0xa20(GFP_ATOMIC), nodemask=(null)

It means that  your system has no remaining memory to allocate a page(4KB)

0 Kudos
venkatakrishs
Observer
Observer
237 Views
Registered: ‎02-21-2021

Hi @hokim,

Can this be due to the irq flags while setting up the interrupt through linux using request_irq?

 

retval = request_irq(dev->irq, xemaclite_interrupt, 0, dev->name, dev);

 

 Also, the unable to allocate buffer error keeps on running in the kernel where I cannot stop it or issue any other command.

0 Kudos
hokim
Scholar
Scholar
214 Views
Registered: ‎10-21-2015

The interrupt seems to work properly

Your log message says nothing except the system can't allocate memory in interrupt service routine.

The memory allocation problem might be caused from kernel memory management or mmu hardware or anything else

0 Kudos