Changeset 27973 in vbox
- Timestamp:
- Apr 4, 2010 12:33:03 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/pdmnetifs.h
r27841 r27973 86 86 /** Owner mask. */ 87 87 #define PDMSCATTERGATHER_FLAGS_OWNER_MASK UINT32_C(0x00000003) 88 /** Mask of flags available to general use. 89 * The parties using the SG must all agree upon how to use these of course. */ 90 #define PDMSCATTERGATHER_FLAGS_AVL_MASK UINT32_C(0x0000f000) 91 /** Flags reserved for future use, MBZ. */ 92 #define PDMSCATTERGATHER_FLAGS_RVD_MASK UINT32_C(0x00000ff8) 88 93 /** @} */ 89 94 … … 135 140 */ 136 141 DECLR3CALLBACKMEMBER(int, pfnReceive,(PPDMINETWORKDOWN pInterface, const void *pvBuf, size_t cb)); 137 138 142 139 143 /** … … 145 149 * 146 150 * @param pInterface Pointer to this interface. 147 * @param pSgBuf Scatter/gather buffer of the size previously148 * requested. Pass to PDMINETWORKUP::pfnSendBuf or149 * PDMINETWORKUP::pfnFreeBuf.150 *151 151 * @thread Non-EMT. 152 152 */ … … 195 195 * but there could of course be races. 196 196 * 197 * @param pInterface Pointer to the interface structure containing the called function pointer. 197 * @param pInterface Pointer to the interface structure containing the 198 * called function pointer. 198 199 * @param cbMin The minimum buffer size. 200 * @param pGso Pointer to a GSO context (only reference while in 201 * this call). NULL indicates no segmentation 202 * offloading. PDMSCATTERGATHER::pvUser is used to 203 * indicate that a network SG uses GSO, usually by 204 * pointing to a copy of @a pGso. 199 205 * @param ppSgBuf Where to return the buffer. The buffer will be 200 206 * owned by the caller, designation owner number 1. … … 202 208 * @thread Any, but normally EMT. 203 209 */ 204 DECLR3CALLBACKMEMBER(int, pfnAllocBuf,(PPDMINETWORKUP pInterface, size_t cbMin, PPPDMSCATTERGATHER ppSgBuf)); 210 DECLR3CALLBACKMEMBER(int, pfnAllocBuf,(PPDMINETWORKUP pInterface, size_t cbMin, PCPDMNETWORKGSO pGso, 211 PPPDMSCATTERGATHER ppSgBuf)); 205 212 206 213 /** … … 278 285 } PDMINETWORKUP; 279 286 /** PDMINETWORKUP interface ID. */ 280 #define PDMINETWORKUP_IID " f915243e-801a-4868-8979-b6b8594b09cc"287 #define PDMINETWORKUP_IID "0e603bc1-3016-41b4-b521-15c038cda16a" 281 288 282 289 -
trunk/include/VBox/types.h
r26137 r27973 738 738 739 739 /** 740 * Forms of generic segment offloading. 741 */ 742 typedef enum PDMNETWORKGSOTYPE 743 { 744 /** Invalid zero value. */ 745 PDMNETWORKGSOTYPE_INVALID = 0, 746 /** TCP/IPv4. */ 747 PDMNETWORKGSOTYPE_IPV4_TCP, 748 #if 0 /* later */ 749 /** TCP/IPv6. */ 750 PDMNETWORKGSOTYPE_IPV6_TCP, 751 /** UDP/IPv4. */ 752 PDMNETWORKGSOTYPE_IPV4_UDP, 753 /** UDP/IPv6. */ 754 PDMNETWORKGSOTYPE_IPV6_UDP, 755 /** IPv6 over IPv4 tunneling. */ 756 PDMNETWORKGSOTYPE_IPV4_TCPV6, 757 /** TCP/IPv6 over IPv4 tunneling. 758 * The header offsets and sizes relates to IPv4 and TCP, the IPv6 header is 759 * figured out as needed. 760 * @todo Needs checking against facts, this is just an outline of the idea. */ 761 PDMNETWORKGSOTYPE_IPV4_TCPV6_TCP, 762 /** UDP/IPv6 over IPv4 tunneling. 763 * The header offsets and sizes relates to IPv4 and UDP, the IPv6 header is 764 * figured out as needed. 765 * @todo Needs checking against facts, this is just an outline of the idea. */ 766 PDMNETWORKGSOTYPE_IPV4_TCPV6_UDP, 767 #endif 768 /** The end of valid GSO types. */ 769 PDMNETWORKGSOTYPE_END 770 } PDMNETWORKGSOTYPE; 771 772 773 /** 774 * Generic segment offloading context. 775 * 776 * We generally follow the E1000 specs wrt to which header fields we change. 777 * However the GSO type implies where the checksum fields are and that they are 778 * always updated from scratch (no half done pseudo checksums). 779 * 780 * @remarks This is part of the internal network GSO packets. Take great care 781 * when making changes. The size is expected to be exactly 8 bytes. 782 */ 783 typedef struct PDMNETWORKGSO 784 { 785 /** The type of segmentation offloading we're performing (PDMNETWORKGSOTYPE). */ 786 uint8_t u8Type; 787 /** The total header size. */ 788 uint8_t cbHdrs; 789 /** The max segment size (MSS) to apply. */ 790 uint16_t cbMaxSeg; 791 792 /** Offset of the first header (IPv4 / IPv6). */ 793 uint8_t offHdr1; 794 /** The size of the first header (IPv4 / IPv6). */ 795 uint8_t cbHdr1; 796 797 /** Offset of the second header (TCP / UDP). */ 798 uint8_t offHdr2; 799 /** The size of the second header (TCP / UDP). */ 800 uint8_t cbHdr2; 801 } PDMNETWORKGSO; 802 /** Pointer to a GSO context. */ 803 typedef PDMNETWORKGSO *PPDMNETWORKGSO; 804 /** Pointer to a const GSO context. */ 805 typedef PDMNETWORKGSO const *PCPDMNETWORKGSO; 806 807 808 /** 740 809 * The current ROM page protection. 741 810 * -
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r27844 r27973 2110 2110 if (RT_LIKELY(pDrv)) 2111 2111 { 2112 rc = pDrv->pfnAllocBuf(pDrv, cbMin, ppSgBuf);2112 rc = pDrv->pfnAllocBuf(pDrv, cbMin, NULL /*pGso*/, ppSgBuf); 2113 2113 AssertMsg(rc == VINF_SUCCESS || rc == VERR_TRY_AGAIN || rc == VERR_NET_DOWN || rc == VERR_NO_MEMORY, ("%Rrc\n", rc)); 2114 2114 if (RT_FAILURE(rc)) -
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r26932 r27973 388 388 389 389 #ifdef IN_RING3 390 390 391 /** 391 392 * Wakeup the RX thread. -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r27840 r27973 190 190 * @interface_method_impl{PDMINETWORKUP,pfnAllocBuf} 191 191 */ 192 static DECLCALLBACK(int) drvR3IntNetUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, PPPDMSCATTERGATHER ppSgBuf) 192 static DECLCALLBACK(int) drvR3IntNetUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, 193 PCPDMNETWORKGSO pGso, PPPDMSCATTERGATHER ppSgBuf) 193 194 { 194 195 PDRVINTNET pThis = RT_FROM_MEMBER(pInterface, DRVINTNET, INetworkUpR3); 195 196 int rc = VINF_SUCCESS; 196 197 Assert(cbMin < UINT32_MAX / 2); 198 AssertReturn(!pGso, VERR_NOT_IMPLEMENTED); /** @todo GSO buffer allocation. */ 197 199 198 200 /* -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r27842 r27973 417 417 * @interface_method_impl{PDMINETWORKUP,pfnAllocBuf} 418 418 */ 419 static DECLCALLBACK(int) drvNATNetworkUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, PPPDMSCATTERGATHER ppSgBuf) 419 static DECLCALLBACK(int) drvNATNetworkUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, 420 PCPDMNETWORKGSO pGso, PPPDMSCATTERGATHER ppSgBuf) 420 421 { 421 422 PDRVNAT pThis = RT_FROM_MEMBER(pInterface, DRVNAT, INetworkUp); 423 AssertReturn(!pGso, VERR_NOT_IMPLEMENTED); /** @todo GSO buffer allocation. */ 422 424 423 425 /* … … 506 508 { 507 509 PPDMSCATTERGATHER pSgBuf; 508 int rc = drvNATNetworkUp_AllocBuf(pInterface, cb, &pSgBuf);510 int rc = drvNATNetworkUp_AllocBuf(pInterface, cb, NULL /*pGso*/, &pSgBuf); 509 511 if (RT_SUCCESS(rc)) 510 512 { -
trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp
r27843 r27973 85 85 * @interface_method_impl{PDMINETWORKUP,pfnAllocBuf} 86 86 */ 87 static DECLCALLBACK(int) drvNetSnifferUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, PPPDMSCATTERGATHER ppSgBuf) 87 static DECLCALLBACK(int) drvNetSnifferUp_AllocBuf(PPDMINETWORKUP pInterface, size_t cbMin, 88 PCPDMNETWORKGSO pGso, PPPDMSCATTERGATHER ppSgBuf) 88 89 { 89 90 PDRVNETSNIFFER pThis = RT_FROM_MEMBER(pInterface, DRVNETSNIFFER, INetworkUp); 90 91 if (RT_UNLIKELY(!pThis->pIBelowNet)) 91 92 return VERR_NET_DOWN; 92 return pThis->pIBelowNet->pfnAllocBuf(pThis->pIBelowNet, cbMin, p pSgBuf);93 return pThis->pIBelowNet->pfnAllocBuf(pThis->pIBelowNet, cbMin, pGso, ppSgBuf); 93 94 } 94 95 … … 117 118 /* output to sniffer */ 118 119 RTCritSectEnter(&pThis->Lock); 120 /** @todo Deal with GSO here. */ 119 121 PcapFileFrame(pThis->File, pThis->StartNanoTS, 120 122 pSgBuf->aSegs[0].pvSeg,
Note:
See TracChangeset
for help on using the changeset viewer.