Ethernet message loss wit XMOS Ethernet MAC 3.3.0 and 3.4.0

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
BEBDigitalAudio
Experienced Member
Posts: 81
Joined: Thu Nov 11, 2010 7:45 pm

Ethernet message loss wit XMOS Ethernet MAC 3.3.0 and 3.4.0

Postby BEBDigitalAudio » Fri Apr 23, 2021 1:24 pm

Hi everybody,

I have found a very strange problem with XMOS Ethernet MAC 3.3.0 and 3.4.0. I am using mii_ethernet_mac component for feed an IP stack wrote by myself. On XS1 processors, the previous Ethernet component provided by XMOS was working perfectly.

On XL216, I am forced to use the new Ethernet component (the old one is not compatible with xTimeComposer), and I have found a very strange issue. When there are network load peaks on the network, the XL216 misses packets. For exemple, if I receive 3 packets or more packets in less than 100 microseconds, my IP stack only gets two. All other packets are lost.

XMOS documentation XM006386 says that rx_bufsize_words define the size of the low level and should be set to 1500 minimum (which is Ethernet MTU). Whatever the value I set here, it can't get more than 2 Ethernet packets if the time between the packets is less than roughly 100 microseconds. And 100 microseconds is the time taken by my IP stack to process incoming messages, so it looks like the XMOS driver is unable to buffer more than 2 packets.

In mii.xc, function mii_handler allocates buffers based on rx_bufsize_words (I see the amount of memory changing as expected when I compile my project), but it does not seem to change anything, the burst limit is 2 packets.
The confusing thing is that XMOS driver speaks of two buffer banks (is it related to the burst limit I see? no idea).

And looking to mii_ethernet_aux.xc source (in mii_ethernet_mac.xc), I see something strange

Code: Select all

      case mii_incoming_packet(mii_info):
        int * unsafe data;
        int nbytes;
        unsigned timestamp;
        {data, nbytes, timestamp} = i_mii.get_incoming_packet();

        if (incoming_data) {
          // Can only handle one packet at a time at this level				// <--- ????? Ouch, does it mean that we can only receive one packet if we are already processing one ?
          i_mii.release_packet(data);
          break;
        }
The function is where my incoming packets are lost in fact. I have set a breakpoint where the section I noted with "????"' and I see that any packet received while my IP stack is already processing a packet calls the i_mii.release_packet(data) line, throwing away the burst packets.

Has anybody else using XMOS Ethernet component already seen something like that ?

Am I wrong when I consider that rx_bufsize_word is supposed to allocate more room in the buffers and make the XL216 be able to deal with network bursts ?

Benoit

Who is online

Users browsing this forum: No registered users and 4 guests