VirtualBox

Changeset 39344 in vbox for trunk


Ignore:
Timestamp:
Nov 17, 2011 11:21:13 AM (13 years ago)
Author:
vboxsync
Message:

e1000: move part of eth header instead of packet body (#4806)

Location:
trunk/src/VBox
Files:
3 edited

Legend:

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

    r39332 r39344  
    32063206    if (cbFrame > 16 && pState->fVTag)
    32073207    {
    3208         E1kLog3(("%s Inserting VLAN tag %08x\n",
     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",
    32093220            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);
    32123221    }
    32133222    /* Update the stats */
     
    37343743                /** @todo Is there any way to indicating errors other than collisions? Like
    37353744                 *        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                }
    37363761            }
    37373762
     
    38243849                /** @todo Is there any way to indicating errors other than collisions? Like
    38253850                 *        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                }
    38263862            }
    38273863
  • trunk/src/VBox/VMM/VMMR0/VMMR0.def

    r39332 r39344  
    9898    nocrt_memcpy
    9999    memcpy=nocrt_memcpy                 ; not-os2
    100     nocrt_memmove
    101100    nocrt_memset
    102101    memset=nocrt_memset                 ; not-os2
  • trunk/src/VBox/VMM/VMMRC/VMMRC.def

    r39332 r39344  
    8686    nocrt_memcpy
    8787    memcpy=nocrt_memcpy                 ; not-os2
    88     nocrt_memmove
    8988    nocrt_memset
    9089    memset=nocrt_memset                 ; not-os2
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