Changeset 46904 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 2, 2013 12:59:56 PM (11 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r46576 r46904 67 67 68 68 #define VNET_TX_DELAY 150 /**< 150 microseconds */ 69 #define VNET_MAX_FRAME_SIZE 6553 6 ///< @todo Is it the right limit?69 #define VNET_MAX_FRAME_SIZE 65535 + 18 /**< Max IP packet size + Ethernet header with VLAN tag */ 70 70 #define VNET_MAC_FILTER_LEN 32 71 71 #define VNET_MAX_VID (1 << 12) … … 386 386 | VNET_F_HOST_TSO4 387 387 | VNET_F_HOST_TSO6 388 /* | VNET_F_HOST_UFO -- Disabled temporarely (see @bugref{6821}) */ 388 | VNET_F_HOST_UFO 389 389 | VNET_F_GUEST_CSUM /* We expect the guest to accept partial TCP checksums (see @bugref{4796}) */ 390 390 | VNET_F_GUEST_TSO4 … … 1155 1155 for (unsigned int i = 1; i < elem.nOut; i++) 1156 1156 uSize += elem.aSegsOut[i].cb; 1157 Log5(("%s vnetTransmitPendingPackets: complete frame is %u bytes.\n", 1158 INSTANCE(pThis), uSize)); 1157 1159 Assert(uSize <= VNET_MAX_FRAME_SIZE); 1158 1160 if (pThis->pDrv) … … 1211 1213 /* Update GSO structure embedded into the frame */ 1212 1214 ((PPDMNETWORKGSO)pSgBuf->pvUser)->cbHdrsTotal = pGso->cbHdrsTotal; 1213 ((PPDMNETWORKGSO)pSgBuf->pvUser)->cbHdrsSeg = pGso->cbHdrs Total;1215 ((PPDMNETWORKGSO)pSgBuf->pvUser)->cbHdrsSeg = pGso->cbHdrsSeg; 1214 1216 Log4(("%s vnetTransmitPendingPackets: adjusted HdrLen to %d.\n", 1215 1217 INSTANCE(pThis), pGso->cbHdrsTotal)); -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r46326 r46904 463 463 Assert(pSgBuf->fFlags == (PDMSCATTERGATHER_FLAGS_MAGIC | PDMSCATTERGATHER_FLAGS_OWNER_1)); 464 464 Assert(pSgBuf->cbUsed <= pSgBuf->cbAvailable); 465 Assert( pHdr->u 16Type == INTNETHDR_TYPE_FRAME466 || pHdr->u 16Type == INTNETHDR_TYPE_GSO);465 Assert( pHdr->u8Type == INTNETHDR_TYPE_FRAME 466 || pHdr->u8Type == INTNETHDR_TYPE_GSO); 467 467 Assert(PDMCritSectIsOwner(&pThis->XmitLock)); 468 468 469 469 /** @todo LATER: try unalloc the frame. */ 470 pHdr->u 16Type = INTNETHDR_TYPE_PADDING;470 pHdr->u8Type = INTNETHDR_TYPE_PADDING; 471 471 IntNetRingCommitFrame(&pThis->CTX_SUFF(pBuf)->Send, pHdr); 472 472 … … 703 703 704 704 Log2(("pHdr=%p offRead=%#x: %.8Rhxs\n", pHdr, pRingBuf->offReadX, pHdr)); 705 uint 16_t u16Type = pHdr->u16Type;706 if ( ( u 16Type == INTNETHDR_TYPE_FRAME707 || u 16Type == INTNETHDR_TYPE_GSO)705 uint8_t u8Type = pHdr->u8Type; 706 if ( ( u8Type == INTNETHDR_TYPE_FRAME 707 || u8Type == INTNETHDR_TYPE_GSO) 708 708 && !pThis->fLinkDown) 709 709 { … … 715 715 if (rc == VINF_SUCCESS) 716 716 { 717 if (u 16Type == INTNETHDR_TYPE_FRAME)717 if (u8Type == INTNETHDR_TYPE_FRAME) 718 718 { 719 719 /* … … 814 814 * NIC is going down, likely because the VM is being reset. Skip the frame. 815 815 */ 816 AssertMsg(IntNetIsValidFrameType(pHdr->u 16Type), ("Unknown frame type %RX16! offRead=%#x\n", pHdr->u16Type, pRingBuf->offReadX));816 AssertMsg(IntNetIsValidFrameType(pHdr->u8Type), ("Unknown frame type %RX16! offRead=%#x\n", pHdr->u8Type, pRingBuf->offReadX)); 817 817 IntNetRingSkipFrame(pRingBuf); 818 818 } … … 831 831 * Link down or unknown frame - skip to the next frame. 832 832 */ 833 AssertMsg(IntNetIsValidFrameType(pHdr->u 16Type), ("Unknown frame type %RX16! offRead=%#x\n", pHdr->u16Type, pRingBuf->offReadX));833 AssertMsg(IntNetIsValidFrameType(pHdr->u8Type), ("Unknown frame type %RX16! offRead=%#x\n", pHdr->u8Type, pRingBuf->offReadX)); 834 834 IntNetRingSkipFrame(pRingBuf); 835 835 STAM_REL_COUNTER_INC(&pBuf->cStatBadFrames); -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r45717 r46904 2688 2688 2689 2689 /* 2690 * @todo: We have to adjust MSS so it does not exceed the value configured 2691 * for the host's interface. 2692 */ 2693 2694 /* 2690 2695 * Carve out the frame segments with the header and frame in different 2691 2696 * scatter / gather segments. … … 3744 3749 while ((pHdr = IntNetRingGetNextFrameToRead(&pIf->pIntBuf->Send)) != NULL) 3745 3750 { 3746 uint 16_t const u16Type = pHdr->u16Type;3747 if (u 16Type == INTNETHDR_TYPE_FRAME)3751 uint8_t const u8Type = pHdr->u8Type; 3752 if (u8Type == INTNETHDR_TYPE_FRAME) 3748 3753 { 3749 3754 /* Send regular frame. */ … … 3754 3759 enmSwDecision = intnetR0NetworkSend(pNetwork, pIf, 0 /*fSrc*/, &Sg, pDstTab); 3755 3760 } 3756 else if (u 16Type == INTNETHDR_TYPE_GSO)3761 else if (u8Type == INTNETHDR_TYPE_GSO) 3757 3762 { 3758 3763 /* Send GSO frame if sane. */ … … 3776 3781 else 3777 3782 { 3778 if (u 16Type != INTNETHDR_TYPE_PADDING)3783 if (u8Type != INTNETHDR_TYPE_PADDING) 3779 3784 STAM_REL_COUNTER_INC(&pIf->pIntBuf->cStatBadFrames); /* ignore */ 3780 3785 enmSwDecision = INTNETSWDECISION_DROP; -
trunk/src/VBox/Devices/Network/testcase/tstIntNet-1.cpp
r44528 r46904 463 463 while ((pHdr = IntNetRingGetNextFrameToRead(pRingBuf))) 464 464 { 465 if (pHdr->u 16Type == INTNETHDR_TYPE_FRAME)465 if (pHdr->u8Type == INTNETHDR_TYPE_FRAME) 466 466 { 467 467 size_t cbFrame = pHdr->cbFrame; … … 540 540 } 541 541 } 542 else if (pHdr->u 16Type == INTNETHDR_TYPE_GSO)542 else if (pHdr->u8Type == INTNETHDR_TYPE_GSO) 543 543 { 544 544 PCPDMNETWORKGSO pGso = IntNetHdrGetGsoContext(pHdr, pBuf); … … 568 568 } 569 569 } 570 else if (pHdr->u 16Type != INTNETHDR_TYPE_PADDING)570 else if (pHdr->u8Type != INTNETHDR_TYPE_PADDING) 571 571 { 572 RTPrintf("tstIntNet-1: Unknown frame type %d\n", pHdr->u 16Type);572 RTPrintf("tstIntNet-1: Unknown frame type %d\n", pHdr->u8Type); 573 573 STAM_REL_COUNTER_INC(&pBuf->cStatBadFrames); 574 574 g_cErrors++;
Note:
See TracChangeset
for help on using the changeset viewer.