2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

datapath-windows: nuke port # argument in IP helper

Port # doesn't make much sense since it has not been computed yet.

Also, get rid of OVS_DEFAULT_PORT_NO and use OVS_DPPORT_NUMBER_INVALID
instead.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
This commit is contained in:
Nithin Raju
2015-11-25 12:00:56 -08:00
committed by Gurucharan Shetty
parent 9be4a83733
commit 12e888bae3
8 changed files with 18 additions and 20 deletions

View File

@@ -291,7 +291,7 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
* If the packet will not be encapsulated, consume the tunnel context * If the packet will not be encapsulated, consume the tunnel context
* by clearing it. * by clearing it.
*/ */
if (ovsFwdCtx->srcVportNo != OVS_DEFAULT_PORT_NO) { if (ovsFwdCtx->srcVportNo != OVS_DPPORT_NUMBER_INVALID) {
POVS_VPORT_ENTRY vport = OvsFindVportByPortNo( POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(
ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo); ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo);

View File

@@ -88,6 +88,7 @@
#include "Flow.h" #include "Flow.h"
#include "Checksum.h" #include "Checksum.h"
#include "PacketParser.h" #include "PacketParser.h"
#include "Vport.h"
/* /*
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -418,7 +419,7 @@ OvsAllocateFixSizeNBL(PVOID ovsContext,
OvsInitNBLContext(ctx, OVS_BUFFER_FROM_FIX_SIZE_POOL | OvsInitNBLContext(ctx, OVS_BUFFER_FROM_FIX_SIZE_POOL |
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT, size, OVS_BUFFER_PRIVATE_FORWARD_CONTEXT, size,
OVS_DEFAULT_PORT_NO); OVS_DPPORT_NUMBER_INVALID);
line = __LINE__; line = __LINE__;
allocate_done: allocate_done:
OVS_LOG_LOUD("Allocate Fix NBL: %p, line: %d", nbl, line); OVS_LOG_LOUD("Allocate Fix NBL: %p, line: %d", nbl, line);
@@ -531,7 +532,7 @@ OvsAllocateVariableSizeNBL(PVOID ovsContext,
OvsInitNBLContext(ctx, OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA | OvsInitNBLContext(ctx, OVS_BUFFER_PRIVATE_MDL | OVS_BUFFER_PRIVATE_DATA |
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT | OVS_BUFFER_PRIVATE_FORWARD_CONTEXT |
OVS_BUFFER_FROM_ZERO_SIZE_POOL, OVS_BUFFER_FROM_ZERO_SIZE_POOL,
size, OVS_DEFAULT_PORT_NO); size, OVS_DPPORT_NUMBER_INVALID);
OVS_LOG_LOUD("Allocate variable size NBL: %p", nbl); OVS_LOG_LOUD("Allocate variable size NBL: %p", nbl);
return nbl; return nbl;
@@ -583,7 +584,8 @@ OvsInitExternalNBLContext(PVOID ovsContext,
* we use first nb to decide whether we need advance or retreat during * we use first nb to decide whether we need advance or retreat during
* complete. * complete.
*/ */
OvsInitNBLContext(ctx, flags, NET_BUFFER_DATA_LENGTH(nb), OVS_DEFAULT_PORT_NO); OvsInitNBLContext(ctx, flags, NET_BUFFER_DATA_LENGTH(nb),
OVS_DPPORT_NUMBER_INVALID);
return ctx; return ctx;
} }
@@ -799,7 +801,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
srcNb = NET_BUFFER_LIST_FIRST_NB(nbl); srcNb = NET_BUFFER_LIST_FIRST_NB(nbl);
OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize, OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize,
OVS_DEFAULT_PORT_NO); OVS_DPPORT_NUMBER_INVALID);
InterlockedIncrement((LONG volatile *)&srcCtx->refCount); InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
@@ -1053,7 +1055,7 @@ OvsFullCopyNBL(PVOID ovsContext,
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT; OVS_BUFFER_PRIVATE_FORWARD_CONTEXT;
OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(firstNb), OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(firstNb),
OVS_DEFAULT_PORT_NO); OVS_DPPORT_NUMBER_INVALID);
#ifdef DBG #ifdef DBG
OvsDumpNetBufferList(nbl); OvsDumpNetBufferList(nbl);

View File

@@ -294,8 +294,6 @@ typedef struct _OVS_EVENT_ENTRY {
UINT32 type; UINT32 type;
} OVS_EVENT_ENTRY, *POVS_EVENT_ENTRY; } OVS_EVENT_ENTRY, *POVS_EVENT_ENTRY;
#define OVS_DEFAULT_PORT_NO 0xffffffff
#define OVS_DEFAULT_EVENT_STATUS 0xffffffff
typedef struct _OVS_EVENT_STATUS { typedef struct _OVS_EVENT_STATUS {
uint32_t numberEntries; uint32_t numberEntries;

View File

@@ -38,7 +38,7 @@ KSTART_ROUTINE OvsStartIpHelper;
* queued. * queued.
*/ */
static BOOLEAN ovsInternalIPConfigured; static BOOLEAN ovsInternalIPConfigured;
static UINT32 ovsInternalPortNo; static BOOLEAN ovsInternalAdapterUp;
static GUID ovsInternalNetCfgId; static GUID ovsInternalNetCfgId;
static MIB_IF_ROW2 ovsInternalRow; static MIB_IF_ROW2 ovsInternalRow;
static MIB_IPINTERFACE_ROW ovsInternalIPRow; static MIB_IPINTERFACE_ROW ovsInternalIPRow;
@@ -1059,7 +1059,7 @@ VOID
OvsInternalAdapterDown(VOID) OvsInternalAdapterDown(VOID)
{ {
NdisAcquireSpinLock(&ovsIpHelperLock); NdisAcquireSpinLock(&ovsIpHelperLock);
ovsInternalPortNo = OVS_DEFAULT_PORT_NO; ovsInternalAdapterUp = FALSE;
ovsInternalIPConfigured = FALSE; ovsInternalIPConfigured = FALSE;
NdisReleaseSpinLock(&ovsIpHelperLock); NdisReleaseSpinLock(&ovsIpHelperLock);
@@ -1070,8 +1070,7 @@ OvsInternalAdapterDown(VOID)
VOID VOID
OvsInternalAdapterUp(UINT32 portNo, OvsInternalAdapterUp(GUID *netCfgInstanceId)
GUID *netCfgInstanceId)
{ {
POVS_IP_HELPER_REQUEST request; POVS_IP_HELPER_REQUEST request;
@@ -1088,7 +1087,7 @@ OvsInternalAdapterUp(UINT32 portNo,
request->command = OVS_IP_HELPER_INTERNAL_ADAPTER_UP; request->command = OVS_IP_HELPER_INTERNAL_ADAPTER_UP;
NdisAcquireSpinLock(&ovsIpHelperLock); NdisAcquireSpinLock(&ovsIpHelperLock);
ovsInternalPortNo = portNo; ovsInternalAdapterUp = TRUE;
InsertHeadList(&ovsIpHelperRequestList, &request->link); InsertHeadList(&ovsIpHelperRequestList, &request->link);
ovsNumIpHelperRequests++; ovsNumIpHelperRequests++;
if (ovsNumIpHelperRequests == 1) { if (ovsNumIpHelperRequests == 1) {
@@ -1160,7 +1159,7 @@ OvsEnqueueIpHelperRequest(POVS_IP_HELPER_REQUEST request)
NdisAcquireSpinLock(&ovsIpHelperLock); NdisAcquireSpinLock(&ovsIpHelperLock);
if (ovsInternalPortNo == OVS_DEFAULT_PORT_NO || if (ovsInternalAdapterUp == FALSE ||
ovsInternalIPConfigured == FALSE) { ovsInternalIPConfigured == FALSE) {
NdisReleaseSpinLock(&ovsIpHelperLock); NdisReleaseSpinLock(&ovsIpHelperLock);
OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG); OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG);
@@ -1554,7 +1553,7 @@ OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle)
RtlZeroMemory(&ovsInternalIPRow, sizeof (MIB_IPINTERFACE_ROW)); RtlZeroMemory(&ovsInternalIPRow, sizeof (MIB_IPINTERFACE_ROW));
ovsInternalIP = 0; ovsInternalIP = 0;
ovsInternalPortNo = OVS_DEFAULT_PORT_NO; ovsInternalAdapterUp = FALSE;
InitializeListHead(&ovsSortedIPNeighList); InitializeListHead(&ovsSortedIPNeighList);

View File

@@ -114,7 +114,7 @@ typedef struct _OVS_IP_HELPER_THREAD_CONTEXT {
NTSTATUS OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle); NTSTATUS OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle);
VOID OvsCleanupIpHelper(VOID); VOID OvsCleanupIpHelper(VOID);
VOID OvsInternalAdapterUp(UINT32 portNo, GUID *netCfgInstanceId); VOID OvsInternalAdapterUp(GUID *netCfgInstanceId);
VOID OvsInternalAdapterDown(VOID); VOID OvsInternalAdapterDown(VOID);
NTSTATUS OvsFwdIPHelperRequest(PNET_BUFFER_LIST nbl, UINT32 inPort, NTSTATUS OvsFwdIPHelperRequest(PNET_BUFFER_LIST nbl, UINT32 inPort,

View File

@@ -564,7 +564,6 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
OvsClearAllSwitchVports(switchContext); OvsClearAllSwitchVports(switchContext);
goto cleanup; goto cleanup;
} }
// OvsPostEvent(OVS_DEFAULT_PORT_NO, OVS_DEFAULT_EVENT_STATUS);
cleanup: cleanup:
if (status != NDIS_STATUS_SUCCESS) { if (status != NDIS_STATUS_SUCCESS) {

View File

@@ -434,7 +434,7 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0);
ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl, ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl,
vport ? vport->portNo : vport ? vport->portNo :
OVS_DEFAULT_PORT_NO, OVS_DPPORT_NUMBER_INVALID,
NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP, NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP,
&key, NULL, &layers, actions, &key, NULL, &layers, actions,
execute->actionsLen); execute->actionsLen);
@@ -1208,4 +1208,4 @@ OvsReadPacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
status = OvsReadDpIoctl(instance->fileObject, usrParamsCtx->outputBuffer, status = OvsReadDpIoctl(instance->fileObject, usrParamsCtx->outputBuffer,
usrParamsCtx->outputLength, replyLen); usrParamsCtx->outputLength, replyLen);
return status; return status;
} }

View File

@@ -447,7 +447,7 @@ HvConnectNic(POVS_SWITCH_CONTEXT switchContext,
NdisReleaseRWLock(switchContext->dispatchLock, &lockState); NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
if (nicParam->NicType == NdisSwitchNicTypeInternal) { if (nicParam->NicType == NdisSwitchNicTypeInternal) {
OvsInternalAdapterUp(portNo, &nicParam->NetCfgInstanceId); OvsInternalAdapterUp(&nicParam->NetCfgInstanceId);
} }
done: done: