Author Topic: Number of LAN buffers in M522XX  (Read 7630 times)

Offline FAQ

  • Newbie
  • *
  • Posts: 27
    • View Profile
Number of LAN buffers in M522XX
« on: September 10, 2009, 12:12:03 PM »
In order to save internal SRAM space, can the number of LAN buffers be reduced?
Eg. NUMBER_OF_TX_BUFFERS_IN_ETHERNET_DEVICE from 2 (2*1.5KB) to 1 and NUMBER_OF_RX_BUFFERS_IN_ETHERNET_DEVICE from 6 to 2
Are there consequences for FTP and web server speeds?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Number of LAN buffers in M522XX
« Reply #1 on: September 10, 2009, 12:19:14 PM »
Hi

It is not possible to reduce the number of TX buffers to 1 (it must be >=2) due to a problem in the Ethernet controller (see errata).
By reducing the number of RX buffer the chance of a receiver overrun increases (resulting in a lost reception and the need for TCP – for example – to repeat). This is usually not serious and the lost rx frames tend only to occur in busy networks and when serving web pages with several images that are transferred at the same time.

As long as the overrun doesn’t occur there will be no speed reduction. If the number of under-runs increases (with 6 they are very unlikely) it will be noticeable since there may be a delay in an image (or similar) being displayed in the web server. FTP doesn’t need so many buffers and 2 will probably be OK, but HTTP is a bit more sensitive (try 5 or 4 and see whether there is a difference for your pages and your typical network activity).

Regards

Mark

PS. Note also that the M522XX project has an option USE_MULTIPLE_BUFFERS (see app_hw_m5223x.h). When this is set the RX buffers are configured as many 256 byte buffers. The advantage is that there is a lot more space to receive and queue small frames (such as TCP ACKs or short broadcasts on the network) and the chance of overrun is reduced even with less space. the down side of this setting is however that it is a bit less efficient since there needs to be an extra full size linear buffer (+1.5k) to gather up longer frames to (extra copy). This option is rarely used since the value of 6 RX buffers (when affordable) generally gives good results.