- Timestamp:
- Mar 9, 2016 1:40:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
r59742 r59966 15 15 */ 16 16 #define LOG_GROUP LOG_GROUP_NET_FLT_DRV 17 18 #define VBOXNETLWF_TEST_NO_FRAMES_OVER_2K 19 //#define VBOXNETLWF_TEST_NO_REALLOCATE 17 20 18 21 //#define VBOXNETLWF_SYNC_SEND … … 909 912 #endif /* !VBOXNETLWF_SYNC_SEND */ 910 913 914 #ifdef VBOXNETLWF_TEST_NO_REALLOCATE 915 /* Allocate buffer pools */ 916 NET_BUFFER_LIST_POOL_PARAMETERS PoolParams; 917 NdisZeroMemory(&PoolParams, sizeof(PoolParams)); 918 PoolParams.Header.Type = NDIS_OBJECT_TYPE_DEFAULT; 919 PoolParams.Header.Revision = NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1; 920 PoolParams.Header.Size = sizeof(PoolParams); 921 PoolParams.ProtocolId = NDIS_PROTOCOL_ID_DEFAULT; 922 PoolParams.fAllocateNetBuffer = TRUE; 923 PoolParams.ContextSize = 0; /** @todo Do we need to consider underlying drivers? I think not. */ 924 PoolParams.PoolTag = VBOXNETLWF_MEM_TAG; 925 #ifndef VBOXNETLWF_SYNC_SEND 926 PoolParams.DataSize = 9088; 927 #endif /* !VBOXNETLWF_SYNC_SEND */ 928 929 pModuleCtx->hPool = NdisAllocateNetBufferListPool(hFilter, &PoolParams); 930 if (!pModuleCtx->hPool) 931 { 932 LogError(("vboxNetLwfWinAttach: NdisAllocateNetBufferListPool failed\n")); 933 NdisFreeIoWorkItem(pModuleCtx->hWorkItem); 934 NdisFreeMemory(pModuleCtx, 0, 0); 935 return NDIS_STATUS_RESOURCES; 936 } 937 Log4(("vboxNetLwfWinAttach: allocated NBL+NB pool 0x%p\n", pModuleCtx->hPool)); 938 #endif /* VBOXNETLWF_TEST_NO_REALLOCATE */ 939 911 940 NDIS_FILTER_ATTRIBUTES Attributes; 912 941 NdisZeroMemory(&Attributes, sizeof(Attributes)); … … 1023 1052 1024 1053 NDIS_STATUS Status = NDIS_STATUS_SUCCESS; 1054 #ifndef VBOXNETLWF_TEST_NO_REALLOCATE 1025 1055 ULONG uNewMtuSize = 1500; /* If we fail to find out MTU, we can always assume 1500. */ 1026 1056 PNDIS_RESTART_ATTRIBUTES pAttributes = pParameters->RestartAttributes; … … 1077 1107 1078 1108 vboxNetLwfWinChangeState(pModuleCtx, Status == NDIS_STATUS_SUCCESS ? LwfState_Running : LwfState_Paused, LwfState_Restarting); 1109 #else /* !VBOXNETLWF_TEST_NO_REALLOCATE */ 1110 vboxNetLwfWinChangeState(pModuleCtx, LwfState_Running, LwfState_Restarting); 1111 #endif /* !VBOXNETLWF_TEST_NO_REALLOCATE */ 1079 1112 LogFlow(("<==vboxNetLwfWinRestart: Status = 0x%x\n", Status)); 1080 1113 return Status; … … 1321 1354 } 1322 1355 #else /* !VBOXNETLWF_SYNC_SEND */ 1356 #ifdef VBOXNETLWF_TEST_NO_FRAMES_OVER_2K 1357 AssertReturn(pSG->cbTotal < 2048, NULL); 1358 #else /* !VBOXNETLWF_TEST_NO_FRAMES_OVER_2K */ 1323 1359 AssertReturn(pSG->cbTotal <= VBOXNETLWF_MAX_FRAME_SIZE(pModule->uMtuSize), NULL); 1360 #endif /* !VBOXNETLWF_TEST_NO_FRAMES_OVER_2K */ 1324 1361 PNET_BUFFER_LIST pBufList = NdisAllocateNetBufferList(pModule->hPool, 1325 1362 0 /** @todo ContextSize */,
Note:
See TracChangeset
for help on using the changeset viewer.