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?
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?