cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Participant
Participant
2,206 Views
Registered: ‎12-10-2017

AC701 LWIP202 Support for multiple Ethernet interfaces

Hello

 

I am trying to modify Vivado SDK 2018.1 provided UDP perf server for supporting 2 Ethernet interfaces of AC701 Evaluation Kit. One interface is RGMII Copper (RJ45) and another is SFP (Active Copper SFP in Cage). Both interfaces are working fine independently (auto-negotiate to 1000 Mbps) and data transfer happens both ways.

 

The issue arises when I integrate both of them in one application using lwip202 library. Please see attached c file

Both interfaces have different IP/MAC/Subnet . My target is to have one UDP server handling both the interfaces. The server is supposed to receive data on one interface, process it and then send it forward on the other interface.

 

 

 

/* initialize lwIP */
lwip_init();


if (!xemac_add(netif_rj45, NULL, NULL, NULL, mac_ethernet_address_rj45,
XPAR_AXI_ETHERNET_1_BASEADDR)) {
xil_printf("Error adding N/W interface\r\n");
return -1;
}

xil_printf("\r\nRJ45 initialized\r\n");

 

/* Add network interface to the netif_list, and set it as default */
if (!xemac_add(netif, NULL, NULL, NULL, mac_ethernet_address,
PLATFORM_EMAC_BASEADDR)) {
xil_printf("Error adding N/W interface\r\n");
return -1;
}

xil_printf("\r\nSFP initialized\r\n");

netif_set_default(netif_rj45);
/* now enable interrupts */
platform_enable_interrupts();

/* specify that the network if is up */
netif_set_up(netif);
netif_set_up(netif_rj45);

assign_default_ip(&(netif->ip_addr), &(netif->netmask), &(netif->gw),0);
assign_default_ip(&(netif_rj45->ip_addr), &(netif_rj45->netmask), &(netif_rj45->gw),1);

/* setup interrupt handler */

start_application();

while(1)

{

xemacif_input(netif);
xemacif_input(netif_rj45);

}

 

if I run above code, both interfaces comes up (autoneg done, link up and speed set), but I am able to receive and send packets from the interface which got added later .. in above case it is "netif". If I do not perform xemac_add on netif and its related APIs, netif_rj45 works fine.

 

Anyone, please let me know how to handle this situation.

 

Regards,

 

Deepak Gaur

0 Kudos
10 Replies
Highlighted
Moderator
Moderator
2,028 Views
Registered: ‎08-25-2009

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hi @dgaur,

 

Are you using the LWIP echo application from SDK and modify on top of it or you are referring XAPP1026 for UDP perf? More details around the SW application you are trying to run will be helpful.

 

In your description, you are talking about both interfaces are coming up but RJ45 is not working when sending and receiving frames? But you also mentioned RJ45 worked fine if the functions listed are not added. In this case, how about the SFP interface? Is SFP interface always working?

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Highlighted
Participant
Participant
1,997 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

I am using LWIP202 UDP Perf example from Vivado SDK.

 

My objective is to receive data from both SFP and RJ45 interfaces simultaneously. For example, data received from SFP port in Microblaze userspace is processed/modified and sent onto RJ45 port and vice versa.

 

<---> SFP <---> MICROBLAZE <----> RJ45 <-----> 

 

The sample example is using only one interface. I am trying to modify it so that both interfaces can be handled by the same application.

 

RJ45 interface PHY is configured by MDIO I/F while SFP PHY(Finisar Cu SFP) is on I2C bus via pca9548A mux

 

The issue is , data is received on the last added interface only though application is supposed to receive data on all the added interfaces and not just the last one.

 

Please provide any sample application wherein multiple Ethernet interfaces have been handled in one UDP/TCP application using LWIP202 library.

0 Kudos
Highlighted
Participant
Participant
1,989 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Please find attached my design for using both SFP and RJ45 interfaces in AC701 development board. I am able to access SFP module's MSA EEPROM data using i2c interface

0 Kudos
Highlighted
Moderator
Moderator
1,984 Views
Registered: ‎08-25-2009

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hi @dgaur,

 

Would you please check the solution from this forum post and see if that helps?

https://forums.xilinx.com/t5/Embedded-Processor-System-Design/Microblaze-dual-ethernet-problem-with-LWIP/td-p/873021

 

 

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Highlighted
Participant
Participant
1,890 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hello,

 

I tried to implement the solution provided in discussion thread but faced following issues on AC701

 

1. LWIP202 and Ethernet 1/2.5 IP with DMA is not receiving/sending any packets.

2. LWIP202 and Ethernet 1/2.5 IP with FIFO works properly for 1st added interface. I need to check if it work for both interface (RGMII and SFP)

3. I have modified xaxiemacif_fifo.c as per solution provided in discussion thread . Please check if all changes are correct. I think Xilinx must provide a proper solution for this issue.

4. Code to initialize SFPs in 1000 Base-X mode is missing from BSP. I have FINISAR FCLF8522P2BTL Active copper SFP . 

5. In case any changes are made to BSP code, as soon as it is regenerated everything is lost and one has to rewrite it again.

6. In xaxiemacif_physpeed.c get_phy_speed_88E1116R() does not support Auto-MDIX. On AC701 it is not set by default in PHY registers so following is required

 

control |= (7 << 12); /* max number of gigabit atphy_valts */
control |= (1 << 11); /* enable downshift */

control |= (6 << 5); /* Auto MDIX */

 

7. Please see if solution provided in attachment is correct for supporting 2 Ethernet interfaces.

 

8. get_IEEE_phy_speed() in xaxiemacif_physpeed.c doesn't support PHY speed evaluation over I2C interface for XPAR_AXIETHERNET_1_BASEADDR . Moreover this function makes in mandatory to use RGMII interface as 1st Ethernet interface i.e if SFP interface is made 1st , it will try to read MDIO registers ?? It should be possible to define BUS type here for PHY management access.

 

 

Tags (1)
0 Kudos
Highlighted
Participant
Participant
1,872 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hello @nanz

 

Please see our issues in previous email. Only one interface (RGMII is working) and we are not able to receive packets on second one (CuSFP) even though SFP link is up (checked using ethtool on connected PC) . RGMII is at 100 Mbps (AN) and SFP is at 1000 Mbps(AN). I have used SFP initialization as given in sfp.c 

 

Can you please specify type of interface to be used for SFP port i.e SFP only or SFP with SGMII) and the management clock(0/1) . If it is SGMII how MDC/MDIO interface is supposed to be configured using I2C Bus.

 

Attached : design_2eth.pdf

 

Regards

 

Deepak Gaur

 

0 Kudos
Highlighted
Moderator
Moderator
1,855 Views
Registered: ‎08-25-2009

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hi @dgaur,

 

SFP should be 1000Base-x. If you disable the first interface, can you see the 2nd interface up and running? If the 1st interface is completely removed in the design, would SFP have a link up and work fine?

The functions that you have updated in the file look fine to me.

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Highlighted
Participant
Participant
1,842 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hello @nanz

 

I am able to ping both interfaces(100Mbps RGMII and 1000 Mbps SFP)  simultaneously, if they are in the same subnet. If subnets are different only one works i.e the interface which was added later which in my case is SFP.

 

How are packets from different subnet handled by LWIP? How to check the routing table? 

 

Besides occasionally following error crops up after which both ping stops

llfifo: Rx under-read errorllfifo: Rx fifo emptyllfifo: Tx fifo overrun

 

I have used following code snippet (attached) to initialize SFP in 1000Base-X mode via I2C bus.

 

Regards,

 

Deepak Gaur

0 Kudos
Highlighted
Moderator
Moderator
1,795 Views
Registered: ‎08-25-2009

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hi @dgaur,

 

Could you please check this and see if it helps?

http://lwip.100.n7.nabble.com/Communication-between-different-subnets-td1993.html

 

"Don't forget to reply, kudo and accept as solution."
0 Kudos
Highlighted
Participant
Participant
1,568 Views
Registered: ‎12-10-2017

Re: AC701 LWIP202 Support for multiple Ethernet interfaces

Hello @nanz @rpr @saicgpt

 

I am able to ping both interfaces of AC701 configured for different subnets.

 

PC-1 <-----192.168.4.X------>SFP Port (AC701) RJ45 Port <---- 192.168.3.X----> PC-2

 

The SFP Port of AC701 is using Finisar Copper SFP and is configured in 1000Base-X mode while RJ45 port (RGMII) is directly connected using copper cable. Both are in Auto negotiation Mode. After initialization SFP comes up in 1000 Mbps Mode while RJ45 port is in 100 Mbps mode.

 

Though simultaneous pings to both interfaces from their respective PCs are working fine but as soon as I send a small packet (64 Byte) using udp_send() on any one of the AC701 interfaces towards PC, the axi_ethernet (1/2.5G) IP hangs after delivering that only packet to PC. In fact both the axi_ethernet (1/2.5 G) instantiations hangs . Ping also stops and no receive interrupt gets asserted for any on the two associated FIFOs. Nothing happens after that.

 

Some times I get Rx under run and Tx overflow error too though I have set the fifo buffer threshold values to the maximum.

 

Please could you guide me on how to resolve this issue.

 

I am using Vivado 2018.1 + SDK and Artix-7 AC701 reference board

 

Regards,

 

Deepak Gaur

 

Reference: https://forums.xilinx.com/t5/Networking-and-Connectivity/Vivado-2018-1-simulation-for-AXI-Ethernet-in-1000BX-mode/m-p/864078/highlight/true#M13190

0 Kudos