Changeset 35922 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Feb 9, 2011 8:04:14 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r35353 r35922 472 472 { 473 473 RTMemFree(pSgBuf); 474 /** @todo Implement the VERR_TRY_AGAIN semantics. */ 475 return VERR_NO_MEMORY; 474 return VERR_TRY_AGAIN; 476 475 } 477 476 } … … 487 486 RTMemFree(pSgBuf->pvUser); 488 487 RTMemFree(pSgBuf); 489 /** @todo Implement the VERR_TRY_AGAIN semantics. */ 490 return VERR_NO_MEMORY; 488 return VERR_TRY_AGAIN; 491 489 } 492 490 } … … 907 905 AssertRC(rc); 908 906 drvNATUrgRecvWakeup(pThis->pDrvIns, pThis->pUrgRecvThread); 907 } 908 909 /** 910 * Function called by slirp to wake up device after VERR_TRY_AGAIN 911 */ 912 void slirp_output_pending(void *pvUser) 913 { 914 PDRVNAT pThis = (PDRVNAT)pvUser; 915 Assert(pThis); 916 pThis->pIAboveNet->pfnXmitPending(pThis->pIAboveNet); 909 917 } 910 918 -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r35346 r35922 70 70 int slirp_can_output(void * pvUser); 71 71 void slirp_output(void * pvUser, struct mbuf *m, const uint8_t *pkt, int pkt_len); 72 void slirp_output_pending(void * pvUser); 72 73 void slirp_urg_output(void *pvUser, struct mbuf *, const uint8_t *pu8Buf, int cb); 73 74 void slirp_post_sent(PNATState pData, void *pvArg); -
trunk/src/VBox/Devices/Network/slirp/misc.c
r35861 r35922 126 126 uma_zone_t master_zone; 127 127 void *area; 128 bool fPending; /* has some sense only in case master_zone == NULL */ 128 129 }; 129 130 131 static inline bool slirp_zone_has_pending(uma_zone_t zone) 132 { 133 return ( zone->master_zone == NULL 134 && zone->fPending); 135 } 136 137 static inline void slirp_zone_check_and_send_pending(uma_zone_t zone) 138 { 139 if (slirp_zone_has_pending(zone)) 140 { 141 zone->fPending = false; 142 slirp_output_pending(zone->pData->pvUser); 143 } 144 } 130 145 131 146 static void *slirp_uma_alloc(uma_zone_t zone, … … 152 167 LIST_REMOVE(it, list); 153 168 LIST_INSERT_HEAD(&zone->used_items, it, list); 169 slirp_zone_check_and_send_pending(zone); 154 170 ret = (void *)&it[1]; 155 171 } 156 172 else 157 173 { 174 AssertMsgFailed(("NAT: item initialization failed for zone %s\n", zone->name)); 158 175 ret = NULL; 159 176 } … … 165 182 /* We're on master zone and we cant allocate more */ 166 183 Log2(("NAT: no room on %s zone\n", zone->name)); 167 AssertMsgFailed(("NAT: OOM!")); 184 /* AssertMsgFailed(("NAT: OOM!")); */ 185 zone->fPending = true; 168 186 break; 169 187 } … … 225 243 LIST_INSERT_HEAD(&zone->free_items, it, list); 226 244 zone->cur_items--; 245 slirp_zone_check_and_send_pending(zone); 227 246 RTCritSectLeave(&zone->csZone); 228 247 } … … 378 397 master_zone->cur_items--; 379 398 RTCritSectLeave(&master_zone->csZone); 399 slirp_zone_check_and_send_pending(master_zone); 380 400 } 381 401 } -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r35346 r35922 992 992 CONTINUE_NO_UNLOCK(udp); 993 993 } 994 else995 {996 do_slowtimo = 1; /* Let socket expire */997 }998 994 } 999 995
Note:
See TracChangeset
for help on using the changeset viewer.