VirtualBox

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


Ignore:
Timestamp:
Apr 25, 2010 9:40:01 PM (15 years ago)
Author:
vboxsync
Message:

SrvIntNetR0.cpp: Combined the two NoPreempt flags into a direction mask. Hacked sending to the trunk so that we don't take the lock if fNoPreemptDsts applies.

File:
1 edited

Legend:

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

    r28714 r28722  
    293293     * Updated while owning the switch table spinlock.  */
    294294    RTMAC                   MacAddr;
    295     /** Can pfnXmit cope with disabled preemption for the 'wire'. (reported) */
    296     bool                    fWireNoPreempt;
    297     /** Can pfnXmit cope with disabled preemption for the 'host'. (reported) */
    298     bool                    fHostNoPreempt;
    299295    /** Whether to supply physical addresses with the outbound SGs. (reported) */
    300296    bool                    fPhysSG;
     297    /** Explicit alignment. */
     298    bool                    fUnused;
    301299    /** Busy count for tracking destination table references and active sends.
    302300     * Usually incremented while owning the switch table spinlock.  The 30th bit
    303301     * is used to indicate wakeup. */
    304302    uint32_t volatile       cBusy;
     303    /** Mask of destinations that pfnXmit cope with disabled preemption for. */
     304    uint32_t                fNoPreemptDsts;
    305305    /** The GSO capabilities of the wire destination. (reported) */
    306306    uint32_t                fWireGsoCapabilites;
     
    26072607     */
    26082608    int rc;
    2609     if (intnetR0TrunkIfOutLock(pThis))
     2609    if (   (fDst & pThis->fNoPreemptDsts) == fDst
     2610        || intnetR0TrunkIfOutLock(pThis))
    26102611    {
    26112612        if (   pSG->GsoCtx.u8Type == PDMNETWORKGSOTYPE_INVALID
     
    26142615        else
    26152616            rc = intnetR0TrunkIfSendGsoFallback(pThis, pSG, fDst);
    2616         intnetR0TrunkIfOutUnlock(pThis);
     2617
     2618        if ((fDst & pThis->fNoPreemptDsts) != fDst)
     2619            intnetR0TrunkIfOutUnlock(pThis);
    26172620    }
    26182621    else
     
    28182821    /* ASSUMES: that the trunk won't change its report while we're checking. */
    28192822    PINTNETTRUNKIF  pTrunk = pDstTab->pTrunk;
    2820     if (    ((fTrunkDst & INTNETTRUNKDIR_HOST) && (pTrunk->fHostNoPreempt || !pNetwork->MacTab.fHostActive))
    2821         &&  ((fTrunkDst & INTNETTRUNKDIR_WIRE) && (pTrunk->fWireNoPreempt || !pNetwork->MacTab.fWireActive))
    2822        )
     2823    if ((fTrunkDst & pTrunk->fNoPreemptDsts) == fTrunkDst)
    28232824        return true;
    28242825
     
    28592860
    28602861    bool fRc = !pTrunk
    2861             || (   (!pNetwork->MacTab.fHostActive || pTrunk->fHostNoPreempt || fSrc == INTNETTRUNKDIR_HOST)
    2862                 && (!pNetwork->MacTab.fWireActive || pTrunk->fWireNoPreempt || fSrc == INTNETTRUNKDIR_WIRE) );
     2862            || pTrunk->fNoPreemptDsts == (INTNETTRUNKDIR_HOST | INTNETTRUNKDIR_WIRE)
     2863            || (   (!pNetwork->MacTab.fHostActive || (pTrunk->fNoPreemptDsts & INTNETTRUNKDIR_HOST) )
     2864                && (!pNetwork->MacTab.fWireActive || (pTrunk->fNoPreemptDsts & INTNETTRUNKDIR_WIRE) ) );
    28632865
    28642866    RTSpinlockReleaseNoInts(pNetwork->hAddrSpinlock, &Tmp);
     
    47354737        pTrunk->MacAddr.au8[4]            = 0xff;
    47364738        pTrunk->MacAddr.au8[5]            = 0xff;
    4737         //pTrunk->fWireNoPreempt          = false;
    4738         //pTrunk->fHostNoPreempt          = false;
    47394739        //pTrunk->fPhysSG                 = false;
     4740        //pTrunk->fUnused                 = false;
    47404741        //pTrunk->cBusy                   = 0;
     4742        //pTrunk->fNoPreemptDsts          = 0;
    47414743        //pTrunk->fWireGsoCapabilites     = 0;
    47424744        //pTrunk->fHostGsoCapabilites     = 0;
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