Changeset 28830 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/freebsd
- Timestamp:
- Apr 27, 2010 2:05:25 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60746
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.