VirtualBox

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


Ignore:
Timestamp:
Nov 17, 2011 9:27:04 PM (13 years ago)
Author:
vboxsync
Message:

e1000: reverted r74918

File:
1 edited

Legend:

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

    r39344 r39357  
    32063206    if (cbFrame > 16 && pState->fVTag)
    32073207    {
    3208         /*
    3209          * We should have 'adjusted' pvSeg earlier to make room for four
    3210          * additional bytes at the beginning of buffer. Now we move it back.
    3211          */
    3212         uint32_t *pSrc = (uint32_t*)pSg->aSegs[0].pvSeg;
    3213         uint32_t *pDst = pSrc - 1;
    3214         pSg->aSegs[0].pvSeg = pDst;
    3215         *pDst++ = *pSrc++; /* Copy destination address */
    3216         *pDst++ = *pSrc++; /* Copy destination and source addresses */
    3217         *pDst++ = *pSrc++; /* Copy source address */
    3218         *pDst++ = RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16);
    3219         E1kLog3(("%s Inserted VLAN tag %08x\n",
     3208        E1kLog3(("%s Inserting VLAN tag %08x\n",
    32203209            INSTANCE(pState), RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16)));
     3210        memmove((uint8_t*)pSg->aSegs[0].pvSeg + 16, (uint8_t*)pSg->aSegs[0].pvSeg + 12, cbFrame - 12);
     3211        *((uint32_t*)pSg->aSegs[0].pvSeg + 3) = RT_BE2H_U16(VET) | (RT_BE2H_U16(pState->u16VTagTCI) << 16);
    32213212    }
    32223213    /* Update the stats */
     
    37433734                /** @todo Is there any way to indicating errors other than collisions? Like
    37443735                 *        VERR_NET_DOWN. */
    3745                 /*
    3746                  * If allocate a bigger buffer we need to move pvSeg
    3747                  * accordingly, leaving room in front.
    3748                  *
    3749                  * Note that e1kTransmitFrame not necessarily moves it back. In
    3750                  * case of multi-descriptor packet with TSE we won't know if
    3751                  * VLAN tag has to be inserted until the last descriptor is
    3752                  * fetched. If it has not we simply leave pvSeg as it is (+4)
    3753                  * and send the packet without inserting VLAN tag.
    3754                  */
    3755                 if (cbVTag)
    3756                 {
    3757                     Assert(cbVTag == 4);
    3758                     pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg =
    3759                         (uint8_t*)(pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg) + cbVTag;
    3760                 }
    37613736            }
    37623737
     
    38493824                /** @todo Is there any way to indicating errors other than collisions? Like
    38503825                 *        VERR_NET_DOWN. */
    3851                 /*
    3852                  * If allocate a bigger buffer we need to move pvSeg
    3853                  * accordingly, leaving room in front. Also see the comment
    3854                  * in data descriptor processing.
    3855                  */
    3856                 if (cbVTag)
    3857                 {
    3858                     Assert(cbVTag == 4);
    3859                     pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg =
    3860                         (uint8_t*)(pState->CTX_SUFF(pTxSg)->aSegs[0].pvSeg) + cbVTag;
    3861                 }
    38623826            }
    38633827
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