This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x Ethernet Flow Control

Genius 5785 points


Hello,

I'd like to use a function of ethernet port receive flow control on AM335x. How should I set the registers? I use port1 only as RMII. I have following setting.

CPSW_SL1: MACCONTROL.RX_FLOW_EN = 1;
CPSW_PORT: P1_MAX_BLKS.P1_RX_MAX_BLKS = 6;
CPSW_PORT: P1_MAX_BLKS.P1_TX_MAX_BLKS = 14;
CPSW_SS: FLOW_CONTROL.P1_FLOW_EN = 1; // I think it's no meaning for RX.

PC sends ping request to AM335x through a switching hub every second by feeding "ping -t" on Windows. Then AM335x can response ping reply. But few seconds later, AM335x doesn't response. If I don't set for flow control, it's working fine continuously. I see RX_FLOW_ACT bit of MACSTATUS register is active at that time. But I doesn't observe PAUSE FRAME on WireShark from a switching hub. Good Rx Frames register doesn't increase the counter. I don't know what happened. Please give me advise.

I also searched following source code, but I could not find the control code for rx flow control.

\\AM335X_StarterWare_02_00_01_01\third_party\lwip-1.4.0\ports\cpsw\netif\cpswif.c
\\AM335X_StarterWare_02_00_01_01\drivers\cpsw.c
/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/drivers/net/ethernet/ti/cpsw.c
/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/arch/arm/mach-omap2/board-am335xevm.c
/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/arch/arm/mach-omap2/devices.c

Regards,
Kazu

  • Hi Kazu-san,

    I will forward this to the factory team.

  • The only way I could get the flow control pause frames to be issued was by overloading the switch fifos. This is done by sending more packets than the rx fifos can handle. To overload the switch fifos use a linux pc to send flood pings with large packet sizes after enabling flow control. The only way to see if the pause frames were being sent out was by looking at the counter in the cpsw statistics register. I am assuming that Wireshark does not show them because  the laptop hardware is not sending them up despite , this is a guess, also perhaps control frames do not make it out of the MAC.. You can also get Pause Frames by turning off the CPDMA, this blocks up the host fifo. This is also assuming that you have Gig PHYs on your board, otherwise there will not be sufficient traffic to overload the rx fifos.

  • Hello Schuyler,

    Thank you for your advice. PC doesn't send flood pings, so RX FIFO doesn't be overloaded. But RX_FLOW ACT is set after AM335x replied some pings. Does setting RX_FLOW_ACT mean that the pause frame has been sent? I can't see the pause frame as you say even if it's sent. I see the message "Request time out" on PC, but I seem that PC doesn't send ping after RX_FLOW_ACT is set. Does it mean PC has been recieved the pause frame? Please help me.

    Regards,
    Kazu