AnsweredAssumed Answered

FEC driver issue on mx253 running linux fsl-2.6.28

Question asked by Rohith Ramesh on Aug 13, 2013
Latest reply on Aug 15, 2013 by Rohith Ramesh


I'm facing issues with data integrity on transmitted data(TCP) on FEC ethernet PHY.

After a LOT of debugging, issue turns out to be related to rx processing in the fec.c driver.


Issue is: Whenever there is a corruption, it's always in bunches of 32bytes and in the corrupted data, there is always a bitflip in the most significant bit of the most significant nibble in each byte

Eg: 0x81a2 becomes 0x0122 over a 32byte area.


Issue was debugged to fec_enet_rx() function where:

if ((pkt_len - 4) < fec_copy_threshold) {

  skb_reserve(skb, 2);    /*skip 2bytes, so ipheader is align 4bytes*/

  skb_put(skb,pkt_len-4); /* Make room */

  skb_copy_to_linear_data(skb, data, pkt_len-4);

  } else {

  struct sk_buff * pskb = fep->rx_skbuff[rx_index];



  fec_dcache_inv_range(skb->data, skb->data +


  fep->rx_skbuff[rx_index] = skb;

  skb->data = FEC_ADDR_ALIGNMENT(skb->data);

  bdp->cbd_bufaddr = __pa(skb->data);

                        skb_put(pskb,pkt_len-4);        /* Make room */

                        skb = pskb;


fec_copy_threshhold is 192 and setting it to -1 forces the else part and fixes the issue.


My question:

Is it a correct fix?

Does FEC on mx253 has checksum support or needs to be enabled.?

There is another issue of why TCP stack doesn't pick this up and discard the packet?