Changeset 90931 in vbox for trunk/src/VBox/Devices/Network/DevVirtioNet_1_0.cpp
- Timestamp:
- Aug 27, 2021 5:42:02 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet_1_0.cpp
r90797 r90931 149 149 #define CTRLQIDX (FEATURE_ENABLED(MQ) ? ((VIRTIONET_MAX_QPAIRS - 1) * 2 + 2) : 2) 150 150 151 #define IS_LINK_UP(pState) (pState->virtioNetConfig.uStatus & VIRTIONET_F_LINK_UP)151 #define IS_LINK_UP(pState) !!(pState->virtioNetConfig.uStatus & VIRTIONET_F_LINK_UP) 152 152 #define IS_LINK_DOWN(pState) !IS_LINK_UP(pState) 153 153 … … 2279 2279 PVIRTIOCORE pVirtio = &pThis->Virtio; 2280 2280 2281 2282 if (!pThis->fVirtioReady) 2283 { 2284 LogFunc(("%s Ignoring Tx requests. VirtIO not ready (status=0x%x).\n", 2285 pThis->szInst, pThis->virtioNetConfig.uStatus)); 2286 return; 2287 } 2288 2289 if (!pThis->fCableConnected) 2290 { 2291 Log(("%s Ignoring transmit requests while cable is disconnected.\n", pThis->szInst)); 2292 return; 2293 } 2294 2281 2295 /* 2282 2296 * Only one thread is allowed to transmit at a time, others should skip … … 2287 2301 return; 2288 2302 2289 2290 if (!pThis->fVirtioReady)2291 {2292 LogFunc(("%s Ignoring Tx requests. VirtIO not ready (status=0x%x).\n",2293 pThis->szInst, pThis->virtioNetConfig.uStatus));2294 return;2295 }2296 2297 if (!pThis->fCableConnected)2298 {2299 Log(("%s Ignoring transmit requests while cable is disconnected.\n", pThis->szInst));2300 return;2301 }2302 2303 2303 2304 … … 2486 2487 static void virtioNetR3TempLinkDown(PPDMDEVINS pDevIns, PVIRTIONET pThis, PVIRTIONETCC pThisCC) 2487 2488 { 2489 2488 2490 if (IS_LINK_UP(pThis)) 2489 2491 { … … 2507 2509 PVIRTIONET pThis = PDMDEVINS_2_DATA(pDevIns, PVIRTIONET); 2508 2510 2509 bool fCachedLinkIsUp = IS_LINK_UP(pThis); 2510 bool fActiveLinkIsUp = (enmState == PDMNETWORKLINKSTATE_UP); 2511 bool fRequestedLinkStateIsUp = (enmState == PDMNETWORKLINKSTATE_UP); 2511 2512 2512 2513 if (LogIs7Enabled()) … … 2531 2532 if (enmState == PDMNETWORKLINKSTATE_DOWN_RESUME) 2532 2533 { 2533 if (fCachedLinkIsUp) 2534 2535 if (IS_LINK_UP(pThis)) 2534 2536 { 2535 2537 /* … … 2542 2544 } 2543 2545 } 2544 else if (f ActiveLinkIsUp != fCachedLinkIsUp)2545 { 2546 if (f CachedLinkIsUp)2546 else if (fRequestedLinkStateIsUp != IS_LINK_UP(pThis)) 2547 { 2548 if (fRequestedLinkStateIsUp) 2547 2549 { 2548 2550 Log(("%s Link is up\n", pThis->szInst)); … … 2551 2553 virtioCoreNotifyConfigChanged(&pThis->Virtio); 2552 2554 } 2553 else /* cached Link state isdown */2555 else /* Link requested to be brought down */ 2554 2556 { 2555 2557 /* The link was brought down explicitly, make sure it won't come up by timer. */
Note:
See TracChangeset
for help on using the changeset viewer.