06-26-2018 02:13 AM
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 */
if (!xemac_add(netif_rj45, NULL, NULL, NULL, mac_ethernet_address_rj45,
xil_printf("Error adding N/W interface\r\n");
/* Add network interface to the netif_list, and set it as default */
if (!xemac_add(netif, NULL, NULL, NULL, mac_ethernet_address,
xil_printf("Error adding N/W interface\r\n");
/* now enable interrupts */
/* specify that the network if is up */
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 */
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.
08-31-2018 03:21 AM
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?
09-05-2018 03:55 AM
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.
09-05-2018 04:27 AM
09-05-2018 05:42 AM
Would you please check the solution from this forum post and see if that helps?
09-25-2018 03:52 AM
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.
09-26-2018 04:06 AM
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
09-27-2018 07:47 AM
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.
09-28-2018 03:51 AM
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.
10-02-2018 07:49 AM
10-08-2018 03:21 AM
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