MPC866 FEC's Receive processing thru pre allocated buffers

Ganesh Kumar ganeshkumar at
Fri Aug 28 22:04:56 EST 2009

Hi All,

I've already sent this almost before 6-7 hours, but the
mail did not appear on the Aug 2009 archives, So I'm sending
it again. Sorry for this!!. Thanks in advance.

        I'm working on MPC860 with Linux Kernel 2.4.18.
As I'm fine tuning the FEC(Fast Ethernet Controller) driver,
I came across the receive side processing of the ethernet frames
where in the Rx BD rings are preallocated with the buffers and each time
a new frame is received, the whole frame will get copied from the Buffer
Descriptors to the external memory by allocating the skb.
Is this the right way to do that ?, as memcpy is not efficient inside the
So I did some changes in the RX BDs initialization, like allocate the skb
and initialize the BD's address pointer with the skb->data(using __pa)
and then on reception of the frame I take out the skb from theBD and allocate
a new skb and reinit the BD address with the newly allocated skb->data.

It works for normal conditions, but if I load the driver then
I receive lots of corrupted frames, So I tried increasing the RX_RING_SIZE(16)
and also enabling the receive dscriptor active only after I come out of the 
while loop (inside fec_enet_rx) 
Increasing the Rx ring eliminated the frame corruption and runs fine on load

But if I configure my Linux box in bridge mode then it doesn't work,
i.e., the bridging doesn't happen,

   PC-1 ---->eth0  [Bridge machine] eth1 ----> PC-2
What I mean here is if we initiate a ping from the 
PC-1 to PC-2, I don't get any response,
it continously try to resole the ARP.

What may be the reason??
Thanks in advance

Please do CC to me as I'm not subscribed to this list.


More information about the Linuxppc-dev mailing list