- Timestamp:
- Apr 27, 2010 2:05:25 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r28800 r28830 402 402 * set! 403 403 * 404 * @remarks Will only grab the switch table spinlock (interrupt safe). 404 * @remarks Will only grab the switch table spinlock (interrupt safe). May 405 * signal an event semaphore iff we're racing network cleanup. The 406 * caller must be busy when calling. 405 407 */ 406 408 DECLR0CALLBACKMEMBER(INTNETSWDECISION, pfnPreRecv,(PINTNETTRUNKSWPORT pSwitchPort, … … 411 413 * 412 414 * The frame may be modified when the trunk port on the switch is set to share 413 * the mac address of the host when hitting the wire. Currently rames containing 414 * ARP packets are subject to this, later other protocols like NDP/ICMPv6 may 415 * need editing as well when operating in this mode. 415 * the mac address of the host when hitting the wire. Currently frames 416 * containing ARP packets are subject to this, later other protocols like 417 * NDP/ICMPv6 may need editing as well when operating in this mode. The edited 418 * packet should be forwarded to the host/wire when @c false is returned. 416 419 * 417 420 * @returns true if we've handled it and it should be dropped. … … 419 422 * 420 423 * @param pSwitchPort Pointer to this structure. 421 * @param pSG The (scatter /) gather structure for the frame. 422 * This will only be use during the call, so a temporary one can 423 * be used. The Phys member will not be used. 424 * @param fSrc Where this frame comes from. Only one bit should be set! 425 * 426 * @remarks Will grab the network semaphore. 424 * @param pSG The (scatter /) gather structure for the frame. This 425 * will only be use during the call, so a temporary one can 426 * be used. The Phys member will not be used. 427 * @param fSrc Where this frame comes from. Exactly one bit shall be 428 * set! 429 * 430 * @remarks Will only grab the switch table spinlock (interrupt safe). Will 431 * signal event semaphores. The caller must be busy when calling. 427 432 * 428 433 * @remarks NAT and TAP will use this interface. 429 434 * 430 * @todo Do any of the host require notification before frame modifications? If so,431 * we'll add a callback to INTNETTRUNKIFPORT for this (pfnSGModifying) and432 * a SG flag.435 * @todo Do any of the host require notification before frame modifications? 436 * If so, we'll add a callback to INTNETTRUNKIFPORT for this 437 * (pfnSGModifying) and a SG flag. 433 438 */ 434 439 DECLR0CALLBACKMEMBER(bool, pfnRecv,(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG, uint32_t fSrc)); … … 440 445 * @param pSG Pointer to the (scatter /) gather structure. 441 446 * 442 * @remarks Will not grab any locks. 447 * @remarks Will not grab any locks. The caller must be busy when calling. 443 448 */ 444 449 DECLR0CALLBACKMEMBER(void, pfnSGRetain,(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG)); … … 447 452 * Release a SG. 448 453 * 449 * This is called by the pfnXmit code when done with a SG. This may safe454 * This is called by the pfnXmit code when done with a SG. This may safe 450 455 * be done in an asynchronous manner. 451 456 * … … 453 458 * @param pSG Pointer to the (scatter /) gather structure. 454 459 * 455 * @remarks Will grab the network semaphore. 460 * @remarks May signal an event semaphore later on, currently code won't though. 461 * The caller is busy when making this call. 456 462 */ 457 463 DECLR0CALLBACKMEMBER(void, pfnSGRelease,(PINTNETTRUNKSWPORT pSwitchPort, PINTNETSG pSG)); … … 462 468 * By enabling physical addresses in the scatter / gather segments it should 463 469 * be possible to save some unnecessary address translation and memory locking 464 * in the network stack. (Internal networking knows the physical address for465 * all the INTNETBUF data and that it's locked memory.) There is a negative470 * in the network stack. (Internal networking knows the physical address for 471 * all the INTNETBUF data and that it's locked memory.) There is a negative 466 472 * side effects though, frames that crosses page boundraries will require 467 473 * multiple scather / gather segments. … … 472 478 * @param fEnable Whether to enable or disable it. 473 479 * 474 * @remarks Will grab the network semaphore.480 * @remarks Will not grab any locks. The caller must be busy when calling. 475 481 */ 476 482 DECLR0CALLBACKMEMBER(bool, pfnSetSGPhys,(PINTNETTRUNKSWPORT pSwitchPort, bool fEnable)); … … 485 491 * @param pMacAddr The MAC address. 486 492 * 487 * @remarks May take a spinlock or two. 493 * @remarks May take a spinlock or two. The caller must be busy when calling. 488 494 */ 489 495 DECLR0CALLBACKMEMBER(void, pfnReportMacAddress,(PINTNETTRUNKSWPORT pSwitchPort, PCRTMAC pMacAddr)); … … 499 505 * promiscuous mode, false if not. 500 506 * 501 * @remarks May take a spinlock or two. 507 * @remarks May take a spinlock or two. The caller must be busy when calling. 502 508 */ 503 509 DECLR0CALLBACKMEMBER(void, pfnReportPromiscuousMode,(PINTNETTRUNKSWPORT pSwitchPort, bool fPromiscuous)); … … 515 521 * @param fDst The destination mask (INTNETTRUNKDIR_XXX). 516 522 * 517 * @remarks Does not take any locks. 523 * @remarks Does not take any locks. The caller must be busy when calling. 518 524 */ 519 525 DECLR0CALLBACKMEMBER(void, pfnReportGsoCapabilities,(PINTNETTRUNKSWPORT pSwitchPort, uint32_t fGsoCapabilities, uint32_t fDst)); … … 531 537 * @param fDst The destination mask (INTNETTRUNKDIR_XXX). 532 538 * 533 * @remarks Does not take any locks. 539 * @remarks Does not take any locks. The caller must be busy when calling. 534 540 */ 535 541 DECLR0CALLBACKMEMBER(void, pfnReportNoPreemptDsts,(PINTNETTRUNKSWPORT pSwitchPort, uint32_t fNoPreemptDsts)); … … 543 549 544 550 551 /** 552 * The trunk interface state used set by INTNETTRUNKIFPORT::pfnSetState. 553 */ 554 typedef enum INTNETTRUNKIFSTATE 555 { 556 /** The invalid zero entry. */ 557 INTNETTRUNKIFSTATE_INVALID = 0, 558 /** The trunk is inactive. No calls to INTNETTRUNKSWPORT::pfnRecv or 559 * INTNETTRUNKSWPORT::pfnPreRecv. Calling other methods is OK. */ 560 INTNETTRUNKIFSTATE_INACTIVE, 561 /** The trunk is active, no restrictions on methods or anything. */ 562 INTNETTRUNKIFSTATE_ACTIVE, 563 /** The trunk is about to be disconnected from the internal network. No 564 * calls to any INTNETRUNKSWPORT methods. */ 565 INTNETTRUNKIFSTATE_DISCONNECTING, 566 /** The end of the valid states. */ 567 INTNETTRUNKIFSTATE_END, 568 /** The usual 32-bit type blow up hack. */ 569 INTNETTRUNKIFSTATE_32BIT_HACK = 0x7fffffff 570 } INTNETTRUNKIFSTATE; 571 545 572 /** Pointer to the interface side of a trunk port. */ 546 573 typedef struct INTNETTRUNKIFPORT *PINTNETTRUNKIFPORT; 547 574 /** 548 * This is the port on the trunk interface, i.e. the driver 549 * side which theinternal network is connected to.575 * This is the port on the trunk interface, i.e. the driver side which the 576 * internal network is connected to. 550 577 * 551 578 * This is only used for the in-kernel trunk connections. 552 *553 * @remarks The internal network side is responsible for serializing all calls554 * to this interface. This is (assumed) to be implemented using a lock555 * that is only ever taken before a call to this interface. The lock556 * is referred to as the out-bound trunk port lock.557 579 */ 558 580 typedef struct INTNETTRUNKIFPORT … … 568 590 * @param pIfPort Pointer to this structure. 569 591 * 570 * @remarks The caller may own any locks or none at all, we don't care.592 * @remarks May own the big mutex, no spinlocks. 571 593 */ 572 594 DECLR0CALLBACKMEMBER(void, pfnRetain,(PINTNETTRUNKIFPORT pIfPort)); … … 580 602 * @param pIfPort Pointer to this structure. 581 603 * 582 * @remarks Only the out-bound trunk port lock, unless the caller is certain the 583 * call is not going to cause destruction (wont happen). 604 * @remarks May own the big mutex, no spinlocks. 584 605 */ 585 606 DECLR0CALLBACKMEMBER(void, pfnRelease,(PINTNETTRUNKIFPORT pIfPort)); … … 593 614 * @param pIfPort Pointer to this structure. 594 615 * 595 * @remarks Called holding the out-bound trunk port lock.616 * @remarks Owns the big mutex. 596 617 */ 597 618 DECLR0CALLBACKMEMBER(void, pfnDisconnectAndRelease,(PINTNETTRUNKIFPORT pIfPort)); 598 619 599 620 /** 600 * Changes the active state of the interface. 601 * 602 * The interface is created in the suspended (non-active) state and then activated 603 * when the VM/network is started. It may be suspended and re-activated later 604 * for various reasons. It will finally be suspended again before disconnecting 605 * the interface from the internal network, however, this might be done immediately 606 * before disconnecting and may leave an incoming frame waiting on the internal network 607 * semaphore. So, after the final suspend a pfnWaitForIdle is always called to make sure 608 * the interface is idle before pfnDisconnectAndRelease is called. 621 * Changes the state of the trunk interface. 622 * 623 * The interface is created in the inactive state (INTNETTRUNKIFSTATE_INACTIVE). 624 * When the first connect VM or service is activated, the internal network 625 * activates the trunk (INTNETTRUNKIFSTATE_ACTIVE). The state may then be set 626 * back and forth between INACTIVE and ACTIVE as VMs are paused, added and 627 * removed. 628 * 629 * Eventually though, the network is destroyed as a result of there being no 630 * more VMs left in it and the state is changed to disconnecting 631 * (INTNETTRUNKIFSTATE_DISCONNECTING) and pfnWaitForIdle is called to make sure 632 * there are no active calls in either direction when pfnDisconnectAndRelease is 633 * called. 609 634 * 610 635 * A typical operation to performed by this method is to enable/disable promiscuous 611 * mode on the host network interface. (This is the reason we cannot call this when 612 * owning any semaphores.) 636 * mode on the host network interface when entering/leaving the active state. 613 637 * 614 638 * @returns The previous state. 615 639 * 616 640 * @param pIfPort Pointer to this structure. 617 * @param fActive True if the new state is 'active', false if the new state is 'suspended'. 618 * 619 * @remarks Called holding the out-bound trunk port lock. 620 */ 621 DECLR0CALLBACKMEMBER(bool, pfnSetActive,(PINTNETTRUNKIFPORT pIfPort, bool fActive)); 641 * @param enmState The new state. 642 * 643 * @remarks Owns the big mutex. No racing pfnSetState, pfnWaitForIdle, 644 * pfnDisconnectAndRelease or INTNETTRUNKFACTORY::pfnCreateAndConnect 645 * calls. 646 */ 647 DECLR0CALLBACKMEMBER(INTNETTRUNKIFSTATE, pfnSetState,(PINTNETTRUNKIFPORT pIfPort, INTNETTRUNKIFSTATE enmState)); 622 648 623 649 /** 624 650 * Waits for the interface to become idle. 625 651 * 626 * This method must be called before disconnecting and releasing the 627 * o bject in order to prevent racing incoming/outgoing frames and device652 * This method must be called before disconnecting and releasing the object in 653 * order to prevent racing incoming/outgoing frames and device 628 654 * enabling/disabling. 629 655 * … … 634 660 * an indefinite wait. 635 661 * 636 * @remarks Called holding the out-bound trunk port lock.662 * @remarks Owns the big mutex. No racing pfnDisconnectAndRelease. 637 663 */ 638 664 DECLR0CALLBACKMEMBER(int, pfnWaitForIdle,(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies)); 639 640 /**641 * Gets the MAC address of the host network interface that we're attached to.642 *643 * @param pIfPort Pointer to this structure.644 * @param pMac Where to store the host MAC address.645 *646 * @remarks Called while owning the network and the out-bound trunk port semaphores.647 */648 DECLR0CALLBACKMEMBER(void, pfnGetMacAddress,(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac));649 650 /**651 * Tests whether the host is operating the interface is promiscuous mode.652 *653 * The default behavior of the internal networking 'switch' is to 'autodetect'654 * promiscuous mode on the trunk port, which is when this method is used.655 * For security reasons this default may of course be overridden so that the656 * host cannot sniff at what's going on.657 *658 * Note that this differs from operating the trunk port on the switch in659 * 'promiscuous' mode, because that relates to the bits going to the wire.660 *661 * @returns true / false.662 *663 * @param pIfPort Pointer to this structure.664 *665 * @remarks Usuaully called while owning the network and the out-bound trunk666 * port semaphores.667 */668 DECLR0CALLBACKMEMBER(bool, pfnIsPromiscuous,(PINTNETTRUNKIFPORT pIfPort));669 665 670 666 /** … … 679 675 * @param fDst The destination mask. At least one bit will be set. 680 676 * 681 * @remarks Called holding the out-bound trunk port lock. 682 * 683 * @remarks TAP and NAT will use this interface for all their traffic, see pfnIsHostMac. 684 * 685 * @todo 677 * @remarks No locks. May be called concurrently on several threads. 686 678 */ 687 679 DECLR0CALLBACKMEMBER(int, pfnXmit,(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst)); … … 743 735 744 736 /** The UUID for the (current) trunk factory. (case sensitive) */ 745 #define INTNETTRUNKFACTORY_UUID_STR " 5d347cb7-98e3-411f-916a-67c4becae09b"737 #define INTNETTRUNKFACTORY_UUID_STR "1849823d-33ed-4f23-a32f-ef7203ee2b9f" 746 738 747 739 /** @name INTNETTRUNKFACTORY::pfnCreateAndConnect flags. -
trunk/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c
r28800 r28830 37 37 38 38 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 39 #error "this code is broken" 39 40 40 41 #include <VBox/sup.h> … … 107 108 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 108 109 Log(("vboxNetAdpSetStateWithLock: pThis=%p, state=%d.\n", pThis, enmNewState)); 109 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);110 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 110 111 vboxNetAdpSetState(pThis, enmNewState); 111 RTSpinlockRelease (pThis->hSpinlock, &Tmp);112 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 112 113 } 113 114 … … 125 126 VBOXNETADPSTATE enmState; 126 127 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 127 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);128 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 128 129 enmState = vboxNetAdpGetState(pThis); 129 RTSpinlockRelease (pThis->hSpinlock, &Tmp);130 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 130 131 Log(("vboxNetAdpGetStateWithLock: pThis=%p, state=%d.\n", pThis, enmState)); 131 132 return enmState; … … 148 149 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 149 150 150 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);151 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 151 152 enmActualState = vboxNetAdpGetState(pThis); /** @todo r=bird: ASMAtomicCmpXchgU32()*/ 152 153 if (enmActualState == enmOldState) … … 154 155 else 155 156 fRc = false; 156 RTSpinlockRelease (pThis->hSpinlock, &Tmp);157 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 157 158 158 159 if (fRc) … … 179 180 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 180 181 PVBOXNETADP pThis = &pGlobals->aAdapters[i]; 181 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);182 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 182 183 if ( vboxNetAdpGetState(pThis) 183 184 && !strcmp(pThis->szName, pszName)) 184 185 { 185 RTSpinlockRelease (pThis->hSpinlock, &Tmp);186 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 186 187 return pThis; 187 188 } 188 RTSpinlockRelease (pThis->hSpinlock, &Tmp);189 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 189 190 } 190 191 return NULL; … … 346 347 AssertPtr(pThis); 347 348 Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); 348 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);349 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 349 350 if (vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active) 350 351 { … … 353 354 vboxNetAdpBusy(pThis); 354 355 } 355 RTSpinlockRelease (pThis->hSpinlock, &Tmp);356 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 356 357 Log(("vboxNetAdpPrepareToReceive: fCanReceive=%d.\n", fCanReceive)); 357 358 … … 416 417 * Do a retain/busy, invoke the OS specific code. 417 418 */ 418 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);419 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 419 420 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Active) 420 421 { 421 RTSpinlockRelease (pThis->hSpinlock, &Tmp);422 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 422 423 Log(("vboxNetAdpReceive: Dropping incoming packet for inactive interface %s.\n", 423 424 pThis->szName)); … … 426 427 vboxNetAdpRetain(pThis); 427 428 vboxNetAdpBusy(pThis); 428 RTSpinlockRelease (pThis->hSpinlock, &Tmp);429 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 429 430 430 431 rc = vboxNetAdpPortOsXmit(pThis, pSG, fDst); … … 504 505 505 506 Log(("vboxNetAdpPortSetActive: pThis=%p, fActive=%d, state before: %d.\n", pThis, fActive, vboxNetAdpGetState(pThis))); 506 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);507 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 507 508 508 509 fPreviouslyActive = vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active; … … 522 523 } 523 524 524 RTSpinlockRelease (pThis->hSpinlock, &Tmp);525 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 525 526 Log(("vboxNetAdpPortSetActive: state after: %RTbool.\n", vboxNetAdpGetState(pThis))); 526 527 return fPreviouslyActive; … … 550 551 * Disconnect and release it. 551 552 */ 552 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);553 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 553 554 //Assert(vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Connected); 554 555 Assert(!pThis->cBusy); 555 556 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 556 RTSpinlockRelease (pThis->hSpinlock, &Tmp);557 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 557 558 558 559 vboxNetAdpOsDisconnectIt(pThis); 559 560 pThis->pSwitchPort = NULL; 560 561 561 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);562 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 562 563 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 563 RTSpinlockRelease (pThis->hSpinlock, &Tmp);564 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 564 565 565 566 vboxNetAdpRelease(pThis); … … 606 607 rc = vboxNetAdpOsCreate(pThis, &Mac); 607 608 *ppNew = pThis; 608 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);609 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 609 610 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); 610 RTSpinlockRelease (pThis->hSpinlock, &Tmp);611 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 611 612 return rc; 612 613 } … … 622 623 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 623 624 624 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);625 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 625 626 if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Available || pThis->cBusy) 626 627 { 627 RTSpinlockRelease (pThis->hSpinlock, &Tmp);628 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 628 629 return VERR_INTNET_FLT_IF_BUSY; 629 630 } 630 631 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); 631 RTSpinlockRelease (pThis->hSpinlock, &Tmp);632 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 632 633 vboxNetAdpRelease(pThis); 633 634 634 635 vboxNetAdpOsDestroy(pThis); 635 636 636 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);637 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 637 638 vboxNetAdpSetState(pThis, kVBoxNetAdpState_Invalid); 638 RTSpinlockRelease (pThis->hSpinlock, &Tmp);639 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 639 640 640 641 return rc; … … 842 843 pNew->MyPort.pfnRelease = vboxNetAdpPortRelease; 843 844 pNew->MyPort.pfnDisconnectAndRelease= vboxNetAdpPortDisconnectAndRelease; 844 pNew->MyPort.pfnSet Active = vboxNetAdpPortSetActive;845 pNew->MyPort.pfnSetState = vboxNetAdpPortSetState; 845 846 pNew->MyPort.pfnWaitForIdle = vboxNetAdpPortWaitForIdle; 846 pNew->MyPort.pfnGetMacAddress = vboxNetAdpPortGetMacAddress;847 847 pNew->MyPort.pfnXmit = vboxNetAdpPortXmit; 848 848 pNew->MyPort.u32VersionEnd = INTNETTRUNKIFPORT_VERSION; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h
r28800 r28830 104 104 /** The current interface state. */ 105 105 VBOXNETFTLINSSTATE volatile enmState; 106 /** Active / Suspended indicator. */ 106 /** The trunk state. */ 107 INTNETTRUNKIFSTATE volatile enmTrunkState; 107 108 bool volatile fActive; 108 109 /** Disconnected from the host network interface. */ … … 325 326 326 327 DECLHIDDEN(void) vboxNetFltRetain(PVBOXNETFLTINS pThis, bool fBusy); 328 DECLHIDDEN(bool) vboxNetFltTryRetainBusyActive(PVBOXNETFLTINS pThis); 329 DECLHIDDEN(bool) vboxNetFltTryRetainBusyNotDisconnected(PVBOXNETFLTINS pThis); 327 330 DECLHIDDEN(void) vboxNetFltRelease(PVBOXNETFLTINS pThis, bool fBusy); 328 331 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r28800 r28830 233 233 * Be careful here to avoid problems racing the detached callback. 234 234 */ 235 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);235 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 236 236 if (!ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost)) 237 237 { … … 240 240 ifnet_reference(pIfNet); 241 241 } 242 RTSpinlockRelease (pThis->hSpinlock, &Tmp);242 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 243 243 244 244 return pIfNet; … … 664 664 * behind it in order to avoid problematic races with the detached callback. 665 665 */ 666 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);666 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 667 667 668 668 pIfNet = (ifnet_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfNet); … … 677 677 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 678 678 679 RTSpinlockRelease (pThis->hSpinlock, &Tmp);679 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 680 680 681 681 if (pIfNet) … … 817 817 * Active? Retain the instance and increment the busy counter. 818 818 */ 819 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 820 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 821 const bool fActive = ASMAtomicUoReadBool(&pThis->fActive); 822 if (fActive) 823 vboxNetFltRetain(pThis, true /* fBusy */); 824 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 825 if (!fActive) 819 if (!vboxNetFltTryRetainBusyActive(pThis)) 826 820 return 0; 827 821 … … 919 913 920 914 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 921 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);915 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 922 916 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pIfNet, pIfNet); 923 RTSpinlockRelease (pThis->hSpinlock, &Tmp);917 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 924 918 925 919 /* … … 945 939 Assert(err || pIfFilter); 946 940 947 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);941 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 948 942 pIfNet = (ifnet_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfNet); 949 943 if (pIfNet && !err) … … 953 947 pIfNet = NULL; /* don't dereference it */ 954 948 } 955 RTSpinlockRelease (pThis->hSpinlock, &Tmp);949 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 956 950 957 951 /* Report capabilities. */ 958 if (!pIfNet) 952 if ( !pIfNet 953 && vboxNetFltTryRetainBusyNotDisconnected(pThis)) 959 954 { 960 955 Assert(pThis->pSwitchPort); … … 963 958 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 964 959 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 960 vboxNetFltRelease(pThis, true /*fBusy*/); 965 961 } 966 962 } … … 1163 1159 * Carefully obtain the interface filter reference and detach it. 1164 1160 */ 1165 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1161 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1166 1162 pIfFilter = (interface_filter_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfFilter); 1167 1163 if (pIfFilter) 1168 1164 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pIfFilter, NULL); 1169 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1165 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1170 1166 1171 1167 if (pIfFilter) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c
r28723 r28830 316 316 bool fActive; 317 317 318 fActive = ASMAtomicUoReadBool(&pThis->fActive);318 fActive = vboxNetFltTryRetainBusyActive(pThis); 319 319 320 320 NGI_GET_M(item, m); … … 338 338 { 339 339 ether_demux(ifp, m); 340 if (fActive) 341 vboxNetFltRelease(pThis, true /*fBusy*/); 340 342 return (0); 341 343 } … … 345 347 taskqueue_enqueue_fast(taskqueue_fast, &pThis->u.s.tskin); 346 348 } 347 /* *349 /* 348 350 * Handle mbufs on the outgoing hook, frames going to the interface 349 351 */ … … 351 353 { 352 354 if (mtag != NULL || !fActive) 353 return ether_output_frame(ifp, m); 355 { 356 int rc = ether_output_frame(ifp, m); 357 if (fActive) 358 vboxNetFltRelease(pThis, true /*fBusy*/); 359 return rc; 360 } 354 361 mtx_lock_spin(&pThis->u.s.outq.ifq_mtx); 355 362 _IF_ENQUEUE(&pThis->u.s.outq, m); … … 361 368 m_freem(m); 362 369 } 370 371 if (fActive) 372 vboxNetFltRelease(pThis, true /*fBusy*/); 363 373 return (0); 364 374 } … … 370 380 371 381 /* Prevent node shutdown if we're active */ 372 fActive = ASMAtomicUoReadBool(&pThis->fActive); 373 if (fActive) 382 if (pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE) 374 383 return (EBUSY); 375 384 NG_NODE_UNREF(node); … … 548 557 return VERR_INTERNAL_ERROR; 549 558 550 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 559 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 560 551 561 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.ifp, ifp); 552 562 pThis->u.s.node = node; … … 564 574 TASK_INIT(&pThis->u.s.tskout, 0, vboxNetFltFreeBSDoutput, pThis); 565 575 566 RTSpinlockRelease (pThis->hSpinlock, &Tmp);576 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 567 577 568 578 NG_NODE_SET_PRIVATE(node, pThis); … … 575 585 /** @todo keep these reports up to date, either by polling for changes or 576 586 * intercept some control flow if possible. */ 577 Assert(pThis->pSwitchPort); 578 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 579 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, vboxNetFltFreeBsdIsPromiscuous(pThis)); 580 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 581 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 587 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 588 { 589 Assert(pThis->pSwitchPort); 590 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 591 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, vboxNetFltFreeBsdIsPromiscuous(pThis)); 592 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 593 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 594 vboxNetFltRelease(pThis, true /*fBusy*/); 595 } 582 596 583 597 return VINF_SUCCESS; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
r28800 r28830 351 351 pOverride->pVBoxNetFlt = pThis; 352 352 353 RTSpinlockAcquire (pThis->hSpinlock, &Tmp); /* (this isn't necessary, but so what) */353 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); /* (this isn't necessary, but so what) */ 354 354 ASMAtomicXchgPtr((void * volatile *)&pDev->netdev_ops, pOverride); 355 RTSpinlockRelease (pThis->hSpinlock, &Tmp);355 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 356 356 } 357 357 … … 368 368 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 369 369 370 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);370 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 371 371 if (!pDev) 372 372 pDev = (struct net_device *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pDev); … … 387 387 else 388 388 pOverride = NULL; 389 RTSpinlockRelease (pThis->hSpinlock, &Tmp);389 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 390 390 391 391 if (pOverride) … … 1216 1216 { 1217 1217 PVBOXNETFLTINS pThis = VBOX_FLT_XT_TO_INST(pWork); 1218 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1219 1218 struct sk_buff *pBuf; 1220 1219 … … 1224 1223 * Active? Retain the instance and increment the busy counter. 1225 1224 */ 1226 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 1227 if (ASMAtomicUoReadBool(&pThis->fActive)) 1228 { 1229 vboxNetFltRetain(pThis, true /* fBusy */); 1230 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 1231 1225 if (vboxNetFltTryRetainBusyActive(pThis)) 1226 { 1232 1227 while ((pBuf = skb_dequeue(&pThis->u.s.XmitQueue)) != NULL) 1233 1228 vboxNetFltLinuxForwardToIntNet(pThis, pBuf); … … 1237 1232 else 1238 1233 { 1239 RTSpinlockRelease(pThis->hSpinlock, &Tmp);1240 1234 /** @todo Shouldn't we just drop the packets here? There is little point in 1241 1235 * making them accumulate when the VM is paused and it'll only waste … … 1256 1250 { 1257 1251 #ifdef VBOXNETFLT_WITH_GSO_XMIT_WIRE 1258 struct net_device *pDev; 1259 PINTNETTRUNKSWPORT pSwitchPort; 1260 unsigned int fFeatures; 1261 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1262 1263 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 1264 1265 pSwitchPort = pThis->pSwitchPort; /* this doesn't need to be here, but it doesn't harm. */ 1266 pDev = (struct net_device *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pDev); 1267 if (pDev) 1268 fFeatures = pDev->features; 1269 else 1270 fFeatures = 0; 1271 1272 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 1273 1274 if (pThis->pSwitchPort) 1275 { 1276 /* Set/update the GSO capabilities of the NIC. */ 1277 uint32_t fGsoCapabilites = 0; 1278 if (fFeatures & NETIF_F_TSO) 1279 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV4_TCP); 1280 if (fFeatures & NETIF_F_TSO6) 1281 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV6_TCP); 1252 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 1253 { 1254 struct net_device *pDev; 1255 PINTNETTRUNKSWPORT pSwitchPort; 1256 unsigned int fFeatures; 1257 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1258 1259 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1260 1261 pSwitchPort = pThis->pSwitchPort; /* this doesn't need to be here, but it doesn't harm. */ 1262 pDev = (struct net_device *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pDev); 1263 if (pDev) 1264 fFeatures = pDev->features; 1265 else 1266 fFeatures = 0; 1267 1268 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1269 1270 if (pThis->pSwitchPort) 1271 { 1272 /* Set/update the GSO capabilities of the NIC. */ 1273 uint32_t fGsoCapabilites = 0; 1274 if (fFeatures & NETIF_F_TSO) 1275 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV4_TCP); 1276 if (fFeatures & NETIF_F_TSO6) 1277 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV6_TCP); 1282 1278 # if 0 /** @todo GSO: Test UDP offloading (UFO) on linux. */ 1283 if (fFeatures & NETIF_F_UFO)1284 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV4_UDP);1285 if (fFeatures & NETIF_F_UFO)1286 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV6_UDP);1279 if (fFeatures & NETIF_F_UFO) 1280 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV4_UDP); 1281 if (fFeatures & NETIF_F_UFO) 1282 fGsoCapabilites |= RT_BIT_32(PDMNETWORKGSOTYPE_IPV6_UDP); 1287 1283 # endif 1288 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, fGsoCapabilites, INTNETTRUNKDIR_WIRE); 1284 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, fGsoCapabilites, INTNETTRUNKDIR_WIRE); 1285 } 1286 1287 vboxNetFltRelease(pThis, true /*fBusy*/); 1289 1288 } 1290 1289 #endif /* VBOXNETFLT_WITH_GSO_XMIT_WIRE */ … … 1327 1326 dev_hold(pDev); 1328 1327 1329 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1328 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1330 1329 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pDev, pDev); 1331 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1330 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1332 1331 1333 1332 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n", pDev, pDev->name, atomic_read(&pDev->refcnt))); … … 1353 1352 * the device notification handle. 1354 1353 */ 1355 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1354 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1356 1355 pDev = (struct net_device *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pDev); 1357 1356 if (pDev) … … 1361 1360 pDev = NULL; /* don't dereference it */ 1362 1361 } 1363 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1362 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1364 1363 Log(("vboxNetFltLinuxAttachToInterface: this=%p: Packet handler installed.\n", pThis)); 1365 1364 … … 1371 1370 { 1372 1371 Assert(pThis->pSwitchPort); 1373 vboxNetFltLinuxReportNicGsoCapabilities(pThis); 1374 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 1375 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, vboxNetFltLinuxPromiscuous(pThis)); 1376 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 1372 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 1373 { 1374 vboxNetFltLinuxReportNicGsoCapabilities(pThis); 1375 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 1376 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, vboxNetFltLinuxPromiscuous(pThis)); 1377 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 1378 vboxNetFltRelease(pThis, true /*fBusy*/); 1379 } 1377 1380 } 1378 1381 else … … 1381 1384 vboxNetFltLinuxUnhookDev(pThis, pDev); 1382 1385 #endif 1383 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1386 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1384 1387 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pDev, NULL); 1385 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1388 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1386 1389 dev_put(pDev); 1387 1390 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) released. ref=%d\n", pDev, pDev->name, atomic_read(&pDev->refcnt))); … … 1403 1406 #endif 1404 1407 1405 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1408 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1406 1409 ASMAtomicWriteBool(&pThis->u.s.fRegistered, false); 1407 1410 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 1408 1411 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pDev, NULL); 1409 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1412 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1410 1413 1411 1414 dev_remove_pack(&pThis->u.s.PacketType); … … 1423 1426 { 1424 1427 /* Check if we are not suspended and promiscuous mode has not been set. */ 1425 if (ASMAtomicUoReadBool(&pThis->fActive) && !ASMAtomicUoReadBool(&pThis->u.s.fPromiscuousSet)) 1428 if ( pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE 1429 && !ASMAtomicUoReadBool(&pThis->u.s.fPromiscuousSet)) 1426 1430 { 1427 1431 /* Note that there is no need for locking as the kernel got hold of the lock already. */ … … 1659 1663 /* 1660 1664 * Report the GSO capabilities of the host and device (if connected). 1665 * Note! No need to mark ourselves busy here. 1661 1666 */ 1662 1667 /** @todo duplicate work here now? Attach */ … … 1694 1699 * ways. */ 1695 1700 1696 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1701 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1697 1702 pDev = (struct net_device *)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pDev); 1698 1703 fRegistered = ASMAtomicUoReadBool(&pThis->u.s.fRegistered); 1699 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1704 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1700 1705 1701 1706 if (fRegistered) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r28800 r28830 995 995 */ 996 996 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 997 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);998 const bool fActive = ASMAtomicUoReadBool(&pThis->fActive);997 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 998 const bool fActive = pThis->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE; 999 999 vboxNetFltRetain(pThis, true /* fBusy */); 1000 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1000 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1001 1001 1002 1002 vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream; … … 1060 1060 case DL_NOTE_LINK_UP: 1061 1061 { 1062 const bool fDisconnected = ASMAtomicUoReadBool(&pThis->fActive); 1063 if (fDisconnected) 1064 { 1065 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, false); 1062 if (ASMAtomicXchgBool(&pThis->fDisconnectedFromHost, false)) 1066 1063 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModReadPut: DL_NOTE_LINK_UP.\n")); 1067 }1068 1064 break; 1069 1065 } … … 1071 1067 case DL_NOTE_LINK_DOWN: 1072 1068 { 1073 const bool fDisconnected = ASMAtomicUoReadBool(&pThis->fActive); 1074 if (!fDisconnected) 1075 { 1076 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 1069 if (!ASMAtomicXchgBool(&pThis->fDisconnectedFromHost, true)) 1077 1070 LogFlow((DEVICE_NAME ":VBoxNetFltSolarisModReadPut: DL_NOTE_LINK_DOWN.\n")); 1078 }1079 1071 break; 1080 1072 } … … 1384 1376 sizeof(pThis->u.s.MacAddr), &pThis->u.s.MacAddr)); 1385 1377 1386 vboxNetFltRetain(pThis, true /*fBusy*/); 1387 Assert(pThis->pSwitchPort); 1388 if (pThis->pSwitchPort) 1389 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 1390 vboxNetFltRelease(pThis, true /*fBusy*/); 1378 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 1379 { 1380 Assert(pThis->pSwitchPort); 1381 if (pThis->pSwitchPort) 1382 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 1383 vboxNetFltRelease(pThis, true /*fBusy*/); 1384 } 1391 1385 } 1392 1386 else … … 2611 2605 * Report promiscuousness and capabilities. 2612 2606 */ 2613 Assert(pThis->pSwitchPort); 2614 /** @todo There is no easy way of obtaining the global host side promiscuous 2615 * counter. Currently we just return false. */ 2616 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, false); 2617 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 2618 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 2607 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 2608 { 2609 Assert(pThis->pSwitchPort); 2610 /** @todo There is no easy way of obtaining the global host side promiscuous 2611 * counter. Currently we just return false. */ 2612 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, false); 2613 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 2614 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 2615 vboxNetFltRelease(pThis, true /*fBusy*/); 2616 } 2619 2617 2620 2618 /* -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFltBow-solaris.c
r28800 r28830 619 619 * Active? Retain the instance and increment the busy counter. 620 620 */ 621 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 622 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 623 const bool fActive = ASMAtomicUoReadBool(&pThis->fActive); 624 if (fActive) 625 vboxNetFltRetain(pThis, true /* fBusy */); 626 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 627 if (!fActive) 621 if (!vboxNetFltTryRetainBusyActive(pThis)) 628 622 return; 629 623 … … 840 834 * Report MAC address, promiscuous mode and capabilities. 841 835 */ 842 Assert(pThis->pSwitchPort); 843 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 844 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, false); /** @todo Promisc */ 845 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 846 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 836 if (vboxNetFltTryRetainBusyNotDisconnected(pThis)) 837 { 838 Assert(pThis->pSwitchPort); 839 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 840 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, false); /** @todo Promisc */ 841 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 842 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 843 vboxNetFltRelease(pThis, true /*fBusy*/); 844 } 847 845 848 846 LogFlow((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface successfully attached over '%s'\n", pThis->szName)); -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r28800 r28830 1112 1112 1113 1113 /* using the pPacketQueueSG as an indicator that the packet queue is initialized */ 1114 RTSpinlockAcquire ((pInstance)->hSpinlock, &Tmp);1114 RTSpinlockAcquireNoInts((pInstance)->hSpinlock, &Tmp); 1115 1115 if(pWorker->pSG) 1116 1116 { 1117 1117 pSG = pWorker->pSG; 1118 1118 pWorker->pSG = NULL; 1119 RTSpinlockRelease ((pInstance)->hSpinlock, &Tmp);1119 RTSpinlockReleaseNoInts((pInstance)->hSpinlock, &Tmp); 1120 1120 KeSetEvent(&pWorker->KillEvent, 0, FALSE); 1121 1121 … … 1131 1131 else 1132 1132 { 1133 RTSpinlockRelease ((pInstance)->hSpinlock, &Tmp);1133 RTSpinlockReleaseNoInts((pInstance)->hSpinlock, &Tmp); 1134 1134 } 1135 1135 } … … 3023 3023 Assert(pThis->fDisconnectedFromHost); 3024 3024 Assert(!pThis->fRediscoveryPending); 3025 Assert( !pThis->fActive);3025 Assert(pThis->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE); 3026 3026 #ifndef VBOXNETADP 3027 3027 Assert(pAdapt->PTState.OpState == kVBoxNetDevOpState_Deinitialized); … … 3255 3255 //#endif 3256 3256 3257 RTSpinlockAcquire(pThis->hSpinlock, &Tmp);3258 3257 3259 3258 /* 4. mark as connected */ 3259 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 3260 3260 ASMAtomicUoWriteBool(&pThis->fDisconnectedFromHost, false); 3261 3262 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 3261 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 3263 3262 3264 3263 pAttachInfo->Status = VINF_SUCCESS; … … 3271 3270 /* 5. Report MAC address, promiscuousness and GSO capabilities. */ 3272 3271 /** @todo Keep these up to date, esp. the promiscuous mode bit. */ 3273 if (pThis->pSwitchPort) 3272 if ( pThis->pSwitchPort 3273 && vboxNetFltTryRetainBusyNotDisconnected(pThis)) 3274 3274 { 3275 3275 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); … … 3280 3280 /** @todo We should be able to do pfnXmit at DISPATCH_LEVEL... */ 3281 3281 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 3282 vboxNetFltRelease(pThis, true /*fBusy*/); 3282 3283 } 3283 3284 return; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.h
r28800 r28830 636 636 pNetFlt = PADAPT_2_PVBOXNETFLTINS(pAdapt); 637 637 638 RTSpinlockAcquire ((pNetFlt)->hSpinlock, &Tmp);639 if( !ASMAtomicUoReadBool(&(pNetFlt)->fActive))640 { 641 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);638 RTSpinlockAcquireNoInts((pNetFlt)->hSpinlock, &Tmp); 639 if(pNetFlt->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE) 640 { 641 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 642 642 return NULL; 643 643 } … … 645 645 if(!vboxNetFltWinDoReferenceDevice(pAdapt, &pAdapt->PTState)) 646 646 { 647 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);647 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 648 648 return NULL; 649 649 } … … 651 651 vboxNetFltRetain((pNetFlt), true /* fBusy */); 652 652 653 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);653 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 654 654 655 655 return pNetFlt; … … 660 660 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 661 661 662 RTSpinlockAcquire ((pNetFlt)->hSpinlock, &Tmp);662 RTSpinlockAcquireNoInts((pNetFlt)->hSpinlock, &Tmp); 663 663 #ifndef VBOXNETADP 664 664 if(!vboxNetFltWinDoReferenceDevices(pAdapt, &pAdapt->MPState, &pAdapt->PTState)) … … 667 667 #endif 668 668 { 669 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);669 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 670 670 *pbNetFltActive = false; 671 671 return false; 672 672 } 673 673 674 if( !ASMAtomicUoReadBool(&(pNetFlt)->fActive))674 if(pNetFlt->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE) 675 675 { 676 676 vboxNetFltWinReferenceModePassThru(pNetFlt); 677 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);677 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 678 678 *pbNetFltActive = false; 679 679 return true; … … 682 682 vboxNetFltRetain((pNetFlt), true /* fBusy */); 683 683 vboxNetFltWinReferenceModeNetFlt(pNetFlt); 684 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);684 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 685 685 686 686 *pbNetFltActive = true; … … 704 704 pNetFlt = PADAPT_2_PVBOXNETFLTINS(pAdapt); 705 705 706 RTSpinlockAcquire ((pNetFlt)->hSpinlock, &Tmp);707 if( !ASMAtomicUoReadBool(&(pNetFlt)->fActive))708 { 709 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);706 RTSpinlockAcquireNoInts((pNetFlt)->hSpinlock, &Tmp); 707 if(pNetFlt->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE) 708 { 709 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 710 710 return NULL; 711 711 } … … 713 713 if(!vboxNetFltWinDoIncReferenceDevice(pAdapt, &pAdapt->PTState, v)) 714 714 { 715 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);715 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 716 716 return NULL; 717 717 } … … 719 719 vboxNetFltRetain((pNetFlt), true /* fBusy */); 720 720 721 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);721 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 722 722 723 723 /* we have marked it as busy, so can do the res references outside the lock */ … … 742 742 } 743 743 744 RTSpinlockAcquire ((pNetFlt)->hSpinlock, &Tmp);744 RTSpinlockAcquireNoInts((pNetFlt)->hSpinlock, &Tmp); 745 745 #ifndef VBOXNETADP 746 746 if(!vboxNetFltWinDoIncReferenceDevices(pAdapt, &pAdapt->MPState, &pAdapt->PTState, v)) … … 749 749 #endif 750 750 { 751 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);751 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 752 752 *pbNetFltActive = false; 753 753 return false; 754 754 } 755 755 756 if( !ASMAtomicUoReadBool(&(pNetFlt)->fActive))756 if(pNetFlt->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE) 757 757 { 758 758 vboxNetFltWinIncReferenceModePassThru(pNetFlt, v); 759 759 760 RTSpinlockRelease ((pNetFlt)->hSpinlock, &Tmp);760 RTSpinlockReleaseNoInts((pNetFlt)->hSpinlock, &Tmp); 761 761 *pbNetFltActive = false; 762 762 return true; … … 767 767 vboxNetFltWinIncReferenceModeNetFlt(pNetFlt, v); 768 768 769 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);769 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 770 770 771 771 /* we have marked it as busy, so can do the res references outside the lock */ … … 833 833 } 834 834 835 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);835 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 836 836 #ifdef VBOX_NETFLT_ONDEMAND_BIND 837 837 if(vboxNetFltWinDoIncReferenceDevice(pAdapt, &pAdapt->PTState)) … … 842 842 #endif 843 843 { 844 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);844 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 845 845 return true; 846 846 } 847 847 848 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);848 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 849 849 return false; 850 850 } … … 854 854 PVBOXNETFLTINS pNetFlt = PADAPT_2_PVBOXNETFLTINS(pAdapt); 855 855 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 856 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);856 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 857 857 #ifdef VBOX_NETFLT_ONDEMAND_BIND 858 858 if(vboxNetFltWinDoReferenceDevice(pAdapt, &pAdapt->PTState)) … … 863 863 #endif 864 864 { 865 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);865 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 866 866 return true; 867 867 } 868 868 869 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);869 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 870 870 return false; 871 871 } -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltMp-win.c
r28800 r28830 486 486 * fail any request comming later 487 487 */ 488 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);488 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 489 489 490 490 ASMAtomicUoWriteBool(&pNetFlt->fDisconnectedFromHost, true); … … 494 494 vboxNetFltWinSetOpState(&pAdapt->MPState, kVBoxNetDevOpState_Deinitializing); 495 495 496 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);496 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 497 497 498 498 vboxNetFltWinWaitDereference(&pAdapt->MPState); … … 1001 1001 * If the miniport below is binding, fail the request 1002 1002 */ 1003 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);1003 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1004 1004 1005 1005 if (vboxNetFltWinGetOpState(&pAdapt->PTState) > kVBoxNetDevOpState_Initialized) 1006 1006 { 1007 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1007 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1008 1008 Status = NDIS_STATUS_FAILURE; 1009 1009 break; … … 1017 1017 { 1018 1018 pAdapt->bQueuedRequest = TRUE; 1019 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1019 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1020 1020 Status = NDIS_STATUS_PENDING; 1021 1021 break; … … 1026 1026 if (pAdapt->bStandingBy == TRUE) 1027 1027 { 1028 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1028 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1029 1029 Status = NDIS_STATUS_FAILURE; 1030 1030 break; … … 1032 1032 pAdapt->bOutstandingRequests = TRUE; 1033 1033 1034 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1034 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1035 1035 if(Oid == OID_GEN_CURRENT_PACKET_FILTER && VBOXNETFLT_PROMISCUOUS_SUPPORTED(pAdapt)) 1036 1036 { … … 1050 1050 vboxNetFltWinDereferenceAdapt(pAdapt); 1051 1051 1052 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);1052 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1053 1053 pAdapt->bOutstandingRequests = FALSE; 1054 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1054 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1055 1055 break; 1056 1056 } … … 1346 1346 * If the miniport below is unbinding, fail the request 1347 1347 */ 1348 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);1348 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1349 1349 if (vboxNetFltWinGetOpState(&pAdapt->PTState) > kVBoxNetDevOpState_Initialized) 1350 1350 { 1351 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1351 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1352 1352 Status = NDIS_STATUS_FAILURE; 1353 1353 break; … … 1362 1362 { 1363 1363 pAdapt->bQueuedRequest = TRUE; 1364 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1364 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1365 1365 Status = NDIS_STATUS_PENDING; 1366 1366 break; … … 1371 1371 if (pAdapt->bStandingBy == TRUE) 1372 1372 { 1373 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1373 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1374 1374 Status = NDIS_STATUS_FAILURE; 1375 1375 break; … … 1377 1377 pAdapt->bOutstandingRequests = TRUE; 1378 1378 1379 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1379 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1380 1380 1381 1381 if(Oid == OID_GEN_CURRENT_PACKET_FILTER && VBOXNETFLT_PROMISCUOUS_SUPPORTED(pAdapt)) … … 1413 1413 vboxNetFltWinDereferenceAdapt(pAdapt); 1414 1414 1415 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);1415 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1416 1416 pAdapt->bOutstandingRequests = FALSE; 1417 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1417 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1418 1418 break; 1419 1419 } -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFltPt-win.c
r28800 r28830 299 299 * fail any request comming later 300 300 */ 301 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);301 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 302 302 303 303 ASMAtomicUoWriteBool(&pNetFlt->fDisconnectedFromHost, true); … … 332 332 333 333 334 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);334 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 335 335 336 336 if (CompleteRequest == TRUE) … … 583 583 { 584 584 PVBOXNETFLTINS pNetFltIf = PADAPT_2_PVBOXNETFLTINS(pAdapt); 585 Assert( !pNetFltIf->fActive);585 Assert(pNetFltIf->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE); 586 586 vboxNetFltWinDereferenceModePassThru(pNetFltIf); 587 587 vboxNetFltWinDereferenceAdapt(pAdapt); … … 613 613 if(pAdapt->fProcessingPacketFilter == VBOXNETFLT_PFP_NETFLT) 614 614 { 615 Assert(pNetFltIf-> fActive);615 Assert(pNetFltIf->enmTrunkState == INTNETTRUNKIFSTATE_ACTIVE); 616 616 if(Status == NDIS_STATUS_SUCCESS) 617 617 { … … 625 625 else if(pAdapt->fProcessingPacketFilter == VBOXNETFLT_PFP_PASSTHRU) 626 626 { 627 Assert( !pNetFltIf->fActive);627 Assert(pNetFltIf->enmTrunkState != INTNETTRUNKIFSTATE_ACTIVE); 628 628 629 629 if(Status == NDIS_STATUS_SUCCESS) … … 849 849 Assert(KeGetCurrentIrql() == DISPATCH_LEVEL); 850 850 do{ 851 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);851 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 852 852 853 853 Assert(pAdapt->cReceivedPacketCount < MAX_RECEIVE_PACKET_ARRAY_SIZE); … … 893 893 } 894 894 } 895 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);895 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 896 896 } while(0); 897 897 … … 1089 1089 do 1090 1090 { 1091 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);1091 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 1092 1092 1093 1093 if (pAdapt->cReceivedPacketCount > 0) … … 1103 1103 pAdapt->cReceivedPacketCount = 0; 1104 1104 1105 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1105 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1106 1106 1107 1107 if(!bReturn) … … 1132 1132 1133 1133 /* we are here only in case pAdapt->cReceivedPacketCount == 0 */ 1134 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);1134 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 1135 1135 } while (FALSE); 1136 1136 } … … 2112 2112 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 2113 2113 2114 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);2114 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 2115 2115 2116 2116 if(pAdapt->bClosingAdapter) 2117 2117 { 2118 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2118 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2119 2119 Assert(0); 2120 2120 return false; … … 2122 2122 if (pAdapt->hBindingHandle == NULL) 2123 2123 { 2124 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2124 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2125 2125 Assert(0); 2126 2126 return false; … … 2128 2128 2129 2129 pAdapt->bClosingAdapter = true; 2130 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2130 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2131 2131 2132 2132 /* … … 2177 2177 * Set the Internal Device State, this blocks all new sends or receives 2178 2178 */ 2179 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);2179 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 2180 2180 2181 2181 vboxNetFltWinSetPowerState(&pAdapt->PTState, *pDeviceState); … … 2193 2193 pAdapt->bStandingBy = TRUE; 2194 2194 } 2195 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2195 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2196 2196 #ifndef VBOX_NETFLT_ONDEMAND_BIND 2197 2197 … … 2218 2218 * If the below miniport is going to low power state, complete the queued request 2219 2219 */ 2220 RTSpinlockAcquire (pNetFlt->hSpinlock, &Tmp);2220 RTSpinlockAcquireNoInts(pNetFlt->hSpinlock, &Tmp); 2221 2221 if (pAdapt->bQueuedRequest) 2222 2222 { 2223 2223 pAdapt->bQueuedRequest = FALSE; 2224 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2224 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2225 2225 vboxNetFltWinPtRequestComplete(pAdapt, &pAdapt->Request, NDIS_STATUS_FAILURE); 2226 2226 } 2227 2227 else 2228 2228 { 2229 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2229 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2230 2230 } 2231 2231 #endif … … 2255 2255 2256 2256 #ifdef VBOX_NETFLT_ONDEMAND_BIND 2257 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2257 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2258 2258 #else 2259 2259 /* … … 2268 2268 2269 2269 pAdapt->bOutstandingRequests = TRUE; 2270 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2270 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2271 2271 2272 2272 NdisRequest(&Status, … … 2284 2284 else 2285 2285 { 2286 RTSpinlockRelease (pNetFlt->hSpinlock, &Tmp);2286 RTSpinlockReleaseNoInts(pNetFlt->hSpinlock, &Tmp); 2287 2287 } 2288 2288
Note:
See TracChangeset
for help on using the changeset viewer.