0

I have a situation where packets are not coming at Ethernet PHY. I am using DMA ring buffer, the data are copied from physical wire to ring buffer then I am pushing it to upper layer stack. In the DMA ring buffer there are two counters consumer index and producer index as well as there are two pointers read pointer and writer pointer. The counter says that how many packets are came from physical layer whereas consumer buffer is used to keep the index of consumed buffer that has pushed to upper layer. Read and write pointers are used to pick the data.

In my current situation my producer and consumer index are becoming similar, it means that there are no packets coming in the DMA ring buffer whereas the packets are continuously pumped to the device connected to PC (wireshark logs confirm that packet is routing.)

We are making our bootloader OS independent, so here our implementation is doing many things(flow management, parsing the initial packet and pushing it to the upper layers ) within a single execution (introducing some timers)where as in its previous implementation which is VxWorks, things are happening in different threads and they were using their IP stack. After further debugging the issue, I have observed that packets are dropping due to RX_BUFFER overflow. I discovered that there are some issue in setting MAC multicast address in the filters at hardware level that might be a reason for the same. My observation is that first time its work fine. But after soft reset I am not able to put the filter again. I have doubt on a couple of more issue and I am probing the same.

1> Initialize ethernet driver.
2> LWIP (IP stack) initialization.
3> Registering callback functions.
4> Start Ethernet PHY driver.
5> Form DHCP connection.
6> Ethernet driver keeps polling, to accept DHCP offer.
7> Join IGMP
8> Poll for multicast packet
9> parse the packet and join other multicast group
10> start polling for multicast packet again. Here after step 4, randomly I am receiving RX_BUFFER overflow message at any step onwards. The max MTU size set is 1500 byte, and the size of Buffer is 2K.

Any suggestion to sort/narrow down the issue?

rspr
  • 155
  • 1
  • 3
  • 12
  • We need to see some code. What OS are you using? – Mike Pennington Nov 17 '12 at 13:12
  • @Mike:we are not using any OS here, the etherenet driver is provided by SOC vendor(Broadcom). Let me elaborate a bit more, this is the part of booltloader implementation for an embedded device,our aim is making the bootloader OS independent. Earlier it was using VxWorks for Ethernet stack. – rspr Nov 18 '12 at 13:24
  • @Mike: I have explained my implementation/current observation above editing the question. – rspr Nov 19 '12 at 04:32
  • we need to see some code – Mike Pennington Nov 19 '12 at 10:15
  • @Mike: This is a commercial project so I am not allow to put the code directly in an open source forum without prior permission from the organisation, if u let me know the concerned area..I can explain that section or write some equivalent pseudo code. – rspr Nov 19 '12 at 17:48
  • This question stands no chance of being answered unless we have some way to know what is wrong with your existing SW or FW implementation. Pseudo-code is a start, but I cannot assure it is sufficient... – Mike Pennington Nov 19 '12 at 17:49
  • @Mike: we are constantly following up the problem and also in touch with Broadcom guys(SOC vendor) to sort out the same. The reason to post the problem, is not only to get the direct solution rather than using the experts experience to narrow down or understand the actual problem. Please let me know your concerns I will try to provide u as much information as I can. – rspr Nov 19 '12 at 17:55
  • OK, like I said, pseudocode is a start... – Mike Pennington Nov 19 '12 at 18:01
  • Its goining in this way:- 1> Initialize ethernet driver. 2> LWIP (IP stack) initialization. 3> Registering callback functions. 4> Start Ethernet PHY driver. 5> From DHCP connection. 6> Ethernet driver keeps polling, to accept DHCP offer. 7> Join IGMP 8> Poll for multicast packet 9> parse the packet and join other multicast group 10> start polling for multicast packet again. Here after step 4, randomly I am receiving RX_BUFFER overflow message at any step onwards. The max MTU size set is 1500 byte, and the size of Buffer is 2K. – rspr Nov 20 '12 at 06:40

1 Answers1

0

We are in touch with Broadcom for the above problem, we fixed the issue and tested it. I would like to update the modification that has been done.

  • After receiving the data packets from PHY layer we are flushing the PHY RX buffer. This section has removed because its already managed by PHY layer.

  • We have also made some minor modification in the flow of LWIP stack.

rspr
  • 155
  • 1
  • 3
  • 12