Changeset 29234 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 8, 2010 8:26:29 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/testcase/tstIntNetR0.cpp
r28800 r29234 203 203 INTNETIFHANDLE hIf; 204 204 RTMAC Mac; 205 uint32_t cbFrame; 205 206 uint64_t u64Start; 206 207 uint64_t u64End; … … 223 224 /** 224 225 * Send thread. 225 * This is constantly broadcasting frames to the network.226 * This is constantly sending frames to the other interface. 226 227 */ 227 228 DECLCALLBACK(int) SendThread(RTTHREAD Thread, void *pvArg) … … 233 234 * Send g_cbTransfer of data. 234 235 */ 235 uint8_t abBuf[ 4096] = {0};236 uint8_t abBuf[16384] = {0}; 236 237 MYFRAMEHDR *pHdr = (MYFRAMEHDR *)&abBuf[0]; 237 238 uint32_t iFrame = 0; … … 246 247 for (; cbSent < g_cbTransfer; iFrame++) 247 248 { 248 const unsigned cb = iFrame % 1519 + sizeof(RTMAC) * 2 + sizeof(unsigned); 249 pHdr->iFrame = iFrame; 249 const unsigned cb = pArgs->cbFrame 250 ? pArgs->cbFrame 251 : iFrame % 1519 + sizeof(RTMAC) * 2 + sizeof(unsigned); 252 pHdr->iFrame = iFrame; 250 253 251 254 INTNETSG Sg; … … 299 302 while (IntNetRingHasMoreToRead(&pArgs->pBuf->Recv)) 300 303 { 301 uint8_t abBuf[16384 ];304 uint8_t abBuf[16384 + 1024]; 302 305 MYFRAMEHDR *pHdr = (MYFRAMEHDR *)&abBuf[0]; 303 306 uint32_t cb = IntNetRingReadAndSkipFrame(&pArgs->pBuf->Recv, abBuf); … … 449 452 * Do the bi-directional transfer test. 450 453 */ 451 static void tstBidirectionalTransfer(PTSTSTATE pThis )454 static void tstBidirectionalTransfer(PTSTSTATE pThis, uint32_t cbFrame) 452 455 { 453 456 MYARGS Args0; … … 458 461 Args0.Mac.au16[1] = 0; 459 462 Args0.Mac.au16[2] = 0; 463 Args0.cbFrame = cbFrame; 460 464 461 465 MYARGS Args1; … … 466 470 Args1.Mac.au16[1] = 0; 467 471 Args1.Mac.au16[2] = 1; 472 Args1.cbFrame = cbFrame; 468 473 469 474 RTTHREAD ThreadRecv0 = NIL_RTTHREAD; … … 702 707 RTTestISubF("bi-directional benchmark, cbSend=%u, cbRecv=%u, cbTransfer=%u", 703 708 pThis->pBuf0->cbSend, pThis->pBuf0->cbRecv, g_cbTransfer); 704 tstBidirectionalTransfer(pThis); 709 tstBidirectionalTransfer(pThis, 256); 710 711 for (uint32_t cbFrame = 64; cbFrame < cbSend - 64; cbFrame += 8) 712 { 713 RTTestISubF("bi-directional benchmark, cbSend=%u, cbRecv=%u, cbTransfer=%u, cbFrame=%u", 714 pThis->pBuf0->cbSend, pThis->pBuf0->cbRecv, g_cbTransfer, cbFrame); 715 tstBidirectionalTransfer(pThis, cbFrame); 716 } 705 717 } 706 718
Note:
See TracChangeset
for help on using the changeset viewer.