FEC driver issue on mx253 running linux fsl-2.6.28

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FEC driver issue on mx253 running linux fsl-2.6.28

726 Views
rohith1z
Contributor III

Hi,

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 +

      FEC_ENET_RX_FRSIZE);

  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?

Labels (3)
0 Kudos
2 Replies

586 Views
jimmychan
NXP TechSupport
NXP TechSupport

Seems the 2.6.28 is an old version. The Linux BSP available for the i.MX25PDK is L2.6.31. Please try this BSP

586 Views
rohith1z
Contributor III

Hello,

Thanks for the reply.

I was able to solve the issue as described in my query.Went through the latest sources as you said (L2.6.31) and tested it and it works fine.

As to why TCP doesn't detect data corruption is something which still baffles me.

Anyone got a clue?

0 Kudos