Network buffers, MPC860 and data caching

Till Straumann strauman at SLAC.Stanford.EDU
Mon Oct 30 23:12:45 UTC 2000


Eric Norum wrote:

>
> I believe the following steps in the driver read task are necessary and
> sufficient to deal with the problem.
> 1) Allocate an mbuf cluster.
> 2) Invalidate any cache lines associated with the first 1518 bytes of
> the mbuf cluster buffer.
> 3) Hand the buffer over to the DMA engine to fill.
> 4) Make sure the driver does not read/write the buffer until ownership
> has been returned.

OK, sorry, I somehow missed the fact that mbuf clusters provide the
actual buffer space. As long as these clusters are cache block aligned (and
the current implementation seems to take care to do so - maybe a comment
in bsd_init() stressing the importance of this alignment would be helpful to prevent
inadvertent changes in the future.), I agree to the above 4 steps being the
correct ones.

Wrapping this discussion up:

- The current implemention has to be fixed, moving the
    cache-invalidation before step 3).

- Also, as discussed, the console RX buffer must be cache
    block aligned.


Looking into the mbuf/cluster issue, other questions came to my mind:
It seems that the networking code needs a 2k buffer (mbuf cluster) for
every received packet. How many clusters do you have to configure to cope with
(lots of) small packets? How many do you need for a heavily loaded EPICS IOC?
Is there a good reason for the cluster size being 2k (and not something closer
to an ethernet package)? (Sorry, if this has been discussed already.)

--- Till.




More information about the users mailing list