VirtualBox

Ignore:
Timestamp:
Dec 1, 2011 7:59:21 PM (13 years ago)
Author:
vboxsync
Message:

RTReq refactoring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetNAT.cpp

    r39468 r39498  
    101101    RTSEMEVENT              m_EventUrgSend;
    102102
    103     PRTREQQUEUE             m_pReqQueue;
    104     PRTREQQUEUE             m_pSendQueue;
    105     PRTREQQUEUE             m_pUrgSendQueue;
     103    RTREQQUEUE              m_hReqQueue;
     104    RTREQQUEUE              m_hSendQueue;
     105    RTREQQUEUE              m_hUrgSendQueue;
    106106    volatile uint32_t       cUrgPkt;
    107107    volatile uint32_t       cPkt;
     
    186186    slirp_register_external_event(m_pNATState, m_hWakeupEvent, VBOX_WAKEUP_EVENT_INDEX);
    187187#endif
    188     rc = RTReqCreateQueue(&m_pReqQueue);
    189     AssertReleaseRC(rc);
    190 
    191     rc = RTReqCreateQueue(&m_pSendQueue);
    192     AssertReleaseRC(rc);
    193 
    194     rc = RTReqCreateQueue(&m_pUrgSendQueue);
     188    rc = RTReqQueueCreate(&m_hReqQueue);
     189    AssertReleaseRC(rc);
     190
     191    rc = RTReqQueueCreate(&m_hSendQueue);
     192    AssertReleaseRC(rc);
     193
     194    rc = RTReqQueueCreate(&m_hUrgSendQueue);
    195195    AssertReleaseRC(rc);
    196196
     
    226226        WaitReq.cMillies = 2000; /* 2 secs - the sleep is for some reason uninterruptible... */  /** @todo fix interruptability in SrvIntNet! */
    227227#if 0
    228         RTReqProcess(m_pSendQueue, 0);
    229         RTReqProcess(m_pUrgSendQueue, 0);
     228        RTReqProcess(m_hSendQueue, 0);
     229        RTReqProcess(m_hUrgSendQueue, 0);
    230230#endif
    231231        int rc = SUPR3CallVMMR0Ex(NIL_RTR0PTR, NIL_VMCPUID, VMMR0_DO_INTNET_IF_WAIT, 0, &WaitReq.Hdr);
     
    267267
    268268                    /* don't wait, we may have to wakeup the NAT thread first */
    269                     rc = RTReqCallEx(m_pReqQueue, NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
    270                                      (PFNRT)SendWorker, 2, m, cbFrame);
     269                    rc = RTReqQueueCallEx(m_hReqQueue, NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
     270                                          (PFNRT)SendWorker, 2, m, cbFrame);
    271271                    natNotifyNATThread();
    272272                    AssertReleaseRC(rc);
     
    301301                        memcpy(pvSlirpFrame, pvSegFrame, cbSegFrame);
    302302
    303                         rc = RTReqCallEx(m_pReqQueue, NULL /*ppReq*/, 0 /*cMillies*/,
    304                                          RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
    305                                          (PFNRT)SendWorker, 2, m, cbSegFrame);
     303                        rc = RTReqQueueCallEx(m_hReqQueue, NULL /*ppReq*/, 0 /*cMillies*/,
     304                                              RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
     305                                              (PFNRT)SendWorker, 2, m, cbSegFrame);
    306306                        AssertReleaseRC(rc);
    307307                    }
     
    357357{
    358358    LogFlowFunc(("ENTER: m:%p, pu8Buf:%p, cb:%d\n", m, pu8Buf, cb));
    359     int rc = RTReqCallEx(g_pNAT->m_pUrgSendQueue,  NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
    360                          (PFNRT)IntNetSendWorker, 4, (uintptr_t)1, (uintptr_t)pu8Buf, (uintptr_t)cb, (uintptr_t)m);
     359    int rc = RTReqQueueCallEx(g_pNAT->m_hUrgSendQueue,  NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
     360                              (PFNRT)IntNetSendWorker, 4, (uintptr_t)1, (uintptr_t)pu8Buf, (uintptr_t)cb, (uintptr_t)m);
    361361    ASMAtomicIncU32(&g_pNAT->cUrgPkt);
    362362    RTSemEventSignal(g_pNAT->m_EventUrgSend);
     
    368368    LogFlowFunc(("ENTER: m:%p, pu8Buf:%p, cb:%d\n", m, pu8Buf, cb));
    369369    AssertRelease(g_pNAT == pvUser);
    370     int rc = RTReqCallEx(g_pNAT->m_pSendQueue,  NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
    371                          (PFNRT)IntNetSendWorker, 4, (uintptr_t)0, (uintptr_t)pu8Buf, (uintptr_t)cb, (uintptr_t)m);
     370    int rc = RTReqQueueCallEx(g_pNAT->m_hSendQueue,  NULL /*ppReq*/, 0 /*cMillies*/, RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT,
     371                              (PFNRT)IntNetSendWorker, 4, (uintptr_t)0, (uintptr_t)pu8Buf, (uintptr_t)cb, (uintptr_t)m);
    372372    ASMAtomicIncU32(&g_pNAT->cPkt);
    373373    RTSemEventSignal(g_pNAT->m_EventSend);
     
    524524        }
    525525        /* process _all_ outstanding requests but don't wait */
    526         RTReqProcess(pThis->m_pReqQueue, 0);
     526        RTReqQueueProcess(pThis->m_hReqQueue, 0);
    527527        RTMemFree(polls);
    528528
     
    551551        slirp_select_poll(pThis->m_pNATState, /* fTimeout=*/false, /* fIcmp=*/(dwEvent == WSA_WAIT_EVENT_0));
    552552        /* process _all_ outstanding requests but don't wait */
    553         RTReqProcess(pThis->m_pReqQueue, 0);
     553        RTReqQueueProcess(pThis->m_hReqQueue, 0);
    554554#endif /* RT_OS_WINDOWS */
    555555    }
     
    561561{
    562562    while (g_pNAT->fIsRunning)
    563         RTReqProcess(g_pNAT->m_pSendQueue, 0);
     563        RTReqQueueProcess(g_pNAT->m_hSendQueue, 0);
    564564    return VINF_SUCCESS;
    565565}
     
    567567{
    568568    while (g_pNAT->fIsRunning)
    569         RTReqProcess(g_pNAT->m_pUrgSendQueue, 0);
     569        RTReqQueueProcess(g_pNAT->m_hUrgSendQueue, 0);
    570570    return VINF_SUCCESS;
    571571}
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