VirtualBox

Changeset 2910 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
May 29, 2007 11:38:33 AM (18 years ago)
Author:
vboxsync
Message:

Fixed (hopefully - can't test easily) handling of the case where we
run out of descriptors in the middle of a multi-buffer packet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r2867 r2910  
    16721672        {
    16731673            uint8_t *src = &pData->abRecvBuf[8];
    1674             RTGCPHYS crda = CSR_CRDA(pData);
    1675             RMD      rmd;
     1674            RTGCPHYS next_crda, crda = CSR_CRDA(pData);
     1675            RMD      rmd, next_rmd;
    16761676            int      pktcount = 0;
    16771677
     
    17121712            while (size > 0)
    17131713            {
    1714                 /* write back, clear the own bit */
    1715                 pcnetRmdStorePassHost(pData, &rmd, PHYSADDR(pData, crda));
    1716 
    17171714                /* Read the entire next descriptor as we're likely to need it. */
    17181715                if (--i < 1)
    17191716                    i = CSR_RCVRL(pData);
    1720                 crda = pcnetRdraAddr(pData, i);
    1721                 pcnetRmdLoad(pData, &rmd, PHYSADDR(pData, crda));
    1722 
    1723                 if (!rmd.rmd1.own)
    1724                     break;      /* Error - not enough buffer space available. */
     1717                next_crda = pcnetRdraAddr(pData, i);
     1718                pcnetRmdLoad(pData, &next_rmd, PHYSADDR(pData, next_crda));
     1719
     1720                /* Check next descriptor's own bit. If we don't own it, we have
     1721                 * to quit and write error status into the last descriptor we own.
     1722                 */
     1723                if (!next_rmd.rmd1.own)
     1724                    break;
    17251725               
     1726                /* Write back current descriptor, clear the own bit. */
     1727                pcnetRmdStorePassHost(pData, &rmd, PHYSADDR(pData, crda));
     1728
     1729                /* Switch to the next descriptor */
     1730                crda = next_crda;
     1731                rmd  = next_rmd;
     1732
    17261733                count = RT_MIN(4096 - (int)rmd.rmd1.bcnt, size);
    17271734                rbadr = PHYSADDR(pData, rmd.rmd0.rbadr);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette