cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Voyager
Voyager
383 Views
Registered: ‎05-25-2016

zynq - AXI Ethernet working but can't ping out

Jump to solution

Hello,

I think I have finally gotten the AXI ethernet subsystem working in linux with a zynq (zedboard), but have an issue when I run ping.  It seems that I can ping the zynq, but I can't ping FROM the zynq on the AXI Ethernet subsystem in PL.  eth1 is the Axi ethernet subsystem in PL and eth0 is the standard GEM ethernet link hard IP in the zynq.

My zynq comes up with eth1 having ipv6 info/addresses but nothing for ipv4

 

81.jpg

I assign an ip address to eth1 with "ifconfig eth1 192.168.1.17 netmask 255.255.255.0

82.jpg

all looks good.  From my build machine (where I build petalinux, vivado etc...) I can ping the zynq on eth1 at the 192.168.1.17 address

83.jpg

My issue is when I try to ping FROM the zynq to anything else.  I use the following command: 

84.jpg

I get stuck here with 100% packet loss.  If I look at my interrupts for the DMA the two interrupt lins show many triggers on eth1.

85.jpg

It seems as though this is missing some sort of driver/sowftware/linux config setting I'm unaware of.  I've also noticed that I can't seem to pull a DHCP ip address on eth1, but can on eth2.  When I try to force eth1 to pull an address it doesn't pull a 192.168.1.X address, but instead it pulls some crazy random address.  I just have a basic 4 port router connected the zynq and my build machine.  

Does anyone see what I'm missing here?

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Scholar
Scholar
360 Views
Registered: ‎05-28-2013

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

You have two interfaces (eth0 and eth1) both on the same subnet of 192.168.1.x/255.255.255.0. Linux does not prevent you setting interfaces this way, but as you have found, it does not behave as you might expect.

Fundamentally, the Linux kernel will route all outgoing packets. What this means is that it will determine which interface to use, for each packet, based on the destination IP, and the current routing table. It does NOT consider which interface a packet was received on.

When you have multiple interfaces for the same subnet, then whichever one happens to be listed first (or have higher metric) will be used. When you send your ping to 192.168.1.119 (or any other address in the subnet), the packets will go out either eth0 or eth1 (depending which one happens to be first in the routing table -- typically this will be the interface that was first configured, but don't rely on that.)

If you move the ethernet cable to the other interface, you may find that ping suddenly works. Of course, this isn't a good solution. In general under Linux, you want to avoid multiple interfaces on the same subnet, except for special circumstances such as channel bonding or dynamic fail-over (redundancy).

FYI, for testing, there is a tool called "arping" which allows you to specify the outgoing interface.

View solution in original post

8 Replies
Highlighted
Voyager
Voyager
381 Views
Registered: ‎05-25-2016

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

Here is my device tree and XSA.  This is the final device tree decompiled with dtc tool.

 

0 Kudos
Highlighted
Scholar
Scholar
361 Views
Registered: ‎05-28-2013

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

You have two interfaces (eth0 and eth1) both on the same subnet of 192.168.1.x/255.255.255.0. Linux does not prevent you setting interfaces this way, but as you have found, it does not behave as you might expect.

Fundamentally, the Linux kernel will route all outgoing packets. What this means is that it will determine which interface to use, for each packet, based on the destination IP, and the current routing table. It does NOT consider which interface a packet was received on.

When you have multiple interfaces for the same subnet, then whichever one happens to be listed first (or have higher metric) will be used. When you send your ping to 192.168.1.119 (or any other address in the subnet), the packets will go out either eth0 or eth1 (depending which one happens to be first in the routing table -- typically this will be the interface that was first configured, but don't rely on that.)

If you move the ethernet cable to the other interface, you may find that ping suddenly works. Of course, this isn't a good solution. In general under Linux, you want to avoid multiple interfaces on the same subnet, except for special circumstances such as channel bonding or dynamic fail-over (redundancy).

FYI, for testing, there is a tool called "arping" which allows you to specify the outgoing interface.

View solution in original post

Highlighted
Voyager
Voyager
214 Views
Registered: ‎05-25-2016

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

Hi @rfs613 thank you for the reply!

It turns out you are correct.  When I bring eth0 down and eth1 up there is no success.  I can't ping in or out so it looks like my axi ethernet subsystem isn't working after all.  I'll have to go back to the drawing board and review my PL implementation and my device tree to see if there is something wrong

0 Kudos
Highlighted
Scholar
Scholar
205 Views
Registered: ‎05-21-2015

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

You might also want to review the Linux "route" command.  Perhaps a slight adjustment of the routing table would be the difference between success and failure.

Dan

0 Kudos
Highlighted
Voyager
Voyager
203 Views
Registered: ‎05-25-2016

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

@dgisselq thank you for the comment!  I will look into this once I get the driver working.  

Other than turning on a higher level of kernel debug messages - do you guys know of a good debugging strategy if I can use ifconfig to bring up the link and see no errors, but the link doesn't work?

 

0 Kudos
Highlighted
Scholar
Scholar
191 Views
Registered: ‎05-21-2015

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

@m3atwad,

The way to debug this is via wireshark.  Use wireshark to see what's actually crossing the network wires.  That'll make debugging a whole lot easier.

Dan

0 Kudos
Highlighted
Voyager
Voyager
189 Views
Registered: ‎05-25-2016

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

1-4 - thanks @dgisselq I will work on that today.  I have the feeling I won't see any packets in or out.

0 Kudos
Highlighted
Scholar
Scholar
175 Views
Registered: ‎05-21-2015

Re: zynq - AXI Ethernet working but can't ping out

Jump to solution

@m3atwad,

If so, that result alone would tell you a lot about what you need to do and where you need to look.

Dan

0 Kudos