This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Ethernet Frame Check Sequence Incorrect

Other Parts Discussed in Thread: OMAP-L138, OMAPL138

My configuration is CCS v4.2.4, DSP/BIOS v5.41.10.36, NDK 2.20.00.19.

I am using ZOOM development Kit OMAP-L138. this maybe EVM board.

I am communicating with this board and my PC. 

When I caught packets by wireshark, there is always "Ethernet Frame Check Sequence Incorrect" message after ACK Packet from this board.

This problem makes retransmission !! so it increases CPU Load <- RTA CPU Load.

I want to remove this problem. 

Thanks.

  • Can you please attach your Wireshark capture file?

    Please also see this post that discusses this issue:

        http://e2e.ti.com/support/embedded/bios/f/355/t/270257.aspx

    Steve

  • To tell the truth, That post you mentioned is mine I posted.

    and I don't understand this problem yet.

    so I attached wireshark screenshot.

    Please be more specific. Thanks a lot !!

  • I think this is happening because the driver is configured not to send/receive the frame check.  I did a quick test and noticed that it's always 0x0.

    I see some code in the driver (in the NSP product, under ti/drv/omapl138/csl_emac.c) that checks this:

        /* Set the pass RX CRC mode and adjust max buffer accordingly */
        if (localDev.Config.ModeFlags & EMAC_CONFIG_MODEFLG_RXCRC)
        {
            if(corenum == localDev.Config.CoreNum) {
                CSL_FINST(EMAC_REGS->RXMBPENABLE, EMAC_RXMBPENABLE_RXPASSCRC, INCLUDE);
            }
            localDev.PktMTU = (pEMACConfig->PktMTU) + 4;
        }
        else
            localDev.PktMTU = (pEMACConfig->PktMTU);

    I think you may need to configure the driver using the code in bold above and rebuild.  You may need to do it in the function HwPktOpen of ti/drv/omapl138/ethdriver.c.

    You can find some more info on this in spruh77a.pdf "OMAP-L138 DSP+ARM Processor Technical Reference Manual", section "19.2.10.7 Receive Frame Classification"

    Steve

  • Steve, thanks for your reply so much !!

    I checked the file "ti/drv/omapl138/csl_emac.c".

    The file is same with your mention. 

    /* Set the pass RX CRC mode and adjust max buffer accordingly */
        if (localDev.Config.ModeFlags & EMAC_CONFIG_MODEFLG_RXCRC)
        {
            if(corenum == localDev.Config.CoreNum) {
                CSL_FINST(EMAC_REGS->RXMBPENABLE, EMAC_RXMBPENABLE_RXPASSCRC, INCLUDE);
            }
            localDev.PktMTU = (pEMACConfig->PktMTU) + 4;
        }
        else
            localDev.PktMTU = (pEMACConfig->PktMTU);

    How can I do next step after checking this file? This job is very difficult. 

    so I need your help a lot, sorry, but I will wait for your reply....

    Good weekend ^^

  • I corrected HwPktOpen() function of ti/drv/omapl138/ethdriver.c like following and save file.

    uint HwPktOpen( PDINFO *pi )

    {

    ...

    //    ecfg.ModeFlags = EMAC_CONFIG_MODEFLG_RXOFFLENBLOCK |
    //                                  EMAC_CONFIG_MODEFLG_RMII;

          ecfg.ModeFlags = EMAC_CONFIG_MODEFLG_RXOFFLENBLOCK |
                                        EMAC_CONFIG_MODEFLG_RMII |
                                        EMAC_CONFIG_MODEFLG_RXCRC;

    ...

    }

    and compiled my project.

    run and got the packets between board and PC by wireshark.

    But I still got FCS Incorrect packet. 

    How can I do next ?

  • I've been digging into this a little. I think what I told you before is the wrong flag.  I think that is for the receive side only.

    I think the flag that matters is "EMAC_DSC_FLAG_PASSCRC".  From the document mentioned above:

    19.2.5.4.11 Pass CRC (PASSCRC) Flag
    This flag is set by the software application in the SOP packet descriptor before it adds the descriptor to the
    transmit queue. Setting this bit indicates to the EMAC that the 4 byte Ethernet CRC is already present in
    the packet data, and that the EMAC should not generate its own version of the CRC.
    When the CRC flag is cleared, the EMAC generates and appends the 4-byte CRC. The buffer length and
    packet length fields do not include the CRC bytes. When the CRC flag is set, the 4-byte CRC is supplied
    by the software application and is already appended to the end of the packet data. The buffer length and
    packet length fields include the CRC bytes, as they are part of the valid packet data. Note that this flag is
    valid on SOP descriptors only.

    This is new territory for me, but from what I can tell, this bit is not set, so the EMAC should be calculating and setting the CRC.  However, in Wireshark, I too see that the CRC is always 0.  I'm not sure why the EMAC computation of the CRC for all Ethernet frames is 0 ...?

    One thing you could try is set the PASSCRC to true.  But this will require you to compute the check sum yourself, and ensure that the buffer length is correct (e.g. you must be sure to comply to the parts in bold above).

    I *think* the part of the code to do this is in csl_emac.c, in the function emacEnqueueTx:

                if (pPkt->Flags & EMAC_PKT_FLAGS_SOP) {
                    pDescThis->PktFlgLen = ((pPkt->Flags&
                                           (EMAC_PKT_FLAGS_SOP|EMAC_PKT_FLAGS_EOP))
                                           |pPkt->PktLength|EMAC_DSC_FLAG_OWNER|EMAC_DSC_FLAG_PASSCRC);
                }
                else {
                    pDescThis->PktFlgLen = (pPkt->Flags&EMAC_PKT_FLAGS_EOP)
                                           |EMAC_DSC_FLAG_OWNER;
                }

    However, I don't think the above is complete.  In addition to adding the above bolded code, you would need to compute the CRC, append it to the packet data, and update the buffer length.

    Steve

  • Thanks steve !!

    So sorry I am a beginner so I don't have a lot of knowledge about this part.

    and I don't understand your mention especially last sentence "In addition to adding the above bolded code, you would need to compute the CRC, append it to the packet data, and update the buffer length".

    I corrected the file csl_emac.c like above your mention.

    But I will not compute the CRC, and update the buffer length. 

    I need your help again.

    I will wait for your reply. thanks!!

  • eok seob kim,

    From the best I can tell, the driver should be computing the check sum (as stated previously).

    I think that what we are seeing in Wireshark may be a false alarm.  I was reading through the Wireshark wiki, and found the following FAQ:

    http://www.wireshark.org/faq.html#q7.9

    It basically says that frames with CRC errors won't even make it into the capture because they won't make it past the hardware; the NIC will drop all such frames.

    And this make sense - bad frames are dropped at the hardware level.  So, if these frames were truly bad frames, they wouldn't even make it into the OS, and therefore wouldn't even show up in Wireshark.

    Furthermore, I have also tested on Linux and my Wireshark capture there shows all of the frames having CRC errors (with check sum == 0).  But, when I look at the statistics in the OS, it shows that there are no error frames:

    ULA0323418:~/temp/winapps> ifconfig
    eth0      Link encap:Ethernet  HWaddr d4:be:d9:3d:b9:0f  
              inet addr:192.168.1.117  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::d6be:d9ff:fe3d:b90f/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:14190614 errors:0 dropped:0 overruns:0 frame:0
              TX packets:14869449107 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1161074700 (1.1 GB)  TX bytes:951662545307 (951.6 GB)
              Interrupt:20 Memory:e2e00000-e2e20000

    This indicates that the frames showing up in Wireshark as bad are actually not bad.  If they were, they should have shown up in either the dropped, or error count statistics.

    Hope this helps.

    Steve

  • Thank you so much for a long time !!

    I will be relieved at last...

  • Just for reference, this discussion also came up here, and referenced this answer in a different forum.