mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 05:47:55 +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:
parent
9be4a83733
commit
12e888bae3
@ -291,7 +291,7 @@ OvsDetectTunnelPkt(OvsForwardingContext *ovsFwdCtx,
|
||||
* If the packet will not be encapsulated, consume the tunnel context
|
||||
* by clearing it.
|
||||
*/
|
||||
if (ovsFwdCtx->srcVportNo != OVS_DEFAULT_PORT_NO) {
|
||||
if (ovsFwdCtx->srcVportNo != OVS_DPPORT_NUMBER_INVALID) {
|
||||
|
||||
POVS_VPORT_ENTRY vport = OvsFindVportByPortNo(
|
||||
ovsFwdCtx->switchContext, ovsFwdCtx->srcVportNo);
|
||||
|
@ -88,6 +88,7 @@
|
||||
#include "Flow.h"
|
||||
#include "Checksum.h"
|
||||
#include "PacketParser.h"
|
||||
#include "Vport.h"
|
||||
|
||||
/*
|
||||
* --------------------------------------------------------------------------
|
||||
@ -418,7 +419,7 @@ OvsAllocateFixSizeNBL(PVOID ovsContext,
|
||||
|
||||
OvsInitNBLContext(ctx, OVS_BUFFER_FROM_FIX_SIZE_POOL |
|
||||
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT, size,
|
||||
OVS_DEFAULT_PORT_NO);
|
||||
OVS_DPPORT_NUMBER_INVALID);
|
||||
line = __LINE__;
|
||||
allocate_done:
|
||||
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 |
|
||||
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT |
|
||||
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);
|
||||
return nbl;
|
||||
@ -583,7 +584,8 @@ OvsInitExternalNBLContext(PVOID ovsContext,
|
||||
* we use first nb to decide whether we need advance or retreat during
|
||||
* 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;
|
||||
}
|
||||
|
||||
@ -799,7 +801,7 @@ OvsPartialCopyNBL(PVOID ovsContext,
|
||||
|
||||
srcNb = NET_BUFFER_LIST_FIRST_NB(nbl);
|
||||
OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(srcNb) - copySize,
|
||||
OVS_DEFAULT_PORT_NO);
|
||||
OVS_DPPORT_NUMBER_INVALID);
|
||||
|
||||
InterlockedIncrement((LONG volatile *)&srcCtx->refCount);
|
||||
|
||||
@ -1053,7 +1055,7 @@ OvsFullCopyNBL(PVOID ovsContext,
|
||||
OVS_BUFFER_PRIVATE_FORWARD_CONTEXT;
|
||||
|
||||
OvsInitNBLContext(dstCtx, flags, NET_BUFFER_DATA_LENGTH(firstNb),
|
||||
OVS_DEFAULT_PORT_NO);
|
||||
OVS_DPPORT_NUMBER_INVALID);
|
||||
|
||||
#ifdef DBG
|
||||
OvsDumpNetBufferList(nbl);
|
||||
|
@ -294,8 +294,6 @@ typedef struct _OVS_EVENT_ENTRY {
|
||||
UINT32 type;
|
||||
} OVS_EVENT_ENTRY, *POVS_EVENT_ENTRY;
|
||||
|
||||
#define OVS_DEFAULT_PORT_NO 0xffffffff
|
||||
#define OVS_DEFAULT_EVENT_STATUS 0xffffffff
|
||||
|
||||
typedef struct _OVS_EVENT_STATUS {
|
||||
uint32_t numberEntries;
|
||||
|
@ -38,7 +38,7 @@ KSTART_ROUTINE OvsStartIpHelper;
|
||||
* queued.
|
||||
*/
|
||||
static BOOLEAN ovsInternalIPConfigured;
|
||||
static UINT32 ovsInternalPortNo;
|
||||
static BOOLEAN ovsInternalAdapterUp;
|
||||
static GUID ovsInternalNetCfgId;
|
||||
static MIB_IF_ROW2 ovsInternalRow;
|
||||
static MIB_IPINTERFACE_ROW ovsInternalIPRow;
|
||||
@ -1059,7 +1059,7 @@ VOID
|
||||
OvsInternalAdapterDown(VOID)
|
||||
{
|
||||
NdisAcquireSpinLock(&ovsIpHelperLock);
|
||||
ovsInternalPortNo = OVS_DEFAULT_PORT_NO;
|
||||
ovsInternalAdapterUp = FALSE;
|
||||
ovsInternalIPConfigured = FALSE;
|
||||
NdisReleaseSpinLock(&ovsIpHelperLock);
|
||||
|
||||
@ -1070,8 +1070,7 @@ OvsInternalAdapterDown(VOID)
|
||||
|
||||
|
||||
VOID
|
||||
OvsInternalAdapterUp(UINT32 portNo,
|
||||
GUID *netCfgInstanceId)
|
||||
OvsInternalAdapterUp(GUID *netCfgInstanceId)
|
||||
{
|
||||
POVS_IP_HELPER_REQUEST request;
|
||||
|
||||
@ -1088,7 +1087,7 @@ OvsInternalAdapterUp(UINT32 portNo,
|
||||
request->command = OVS_IP_HELPER_INTERNAL_ADAPTER_UP;
|
||||
|
||||
NdisAcquireSpinLock(&ovsIpHelperLock);
|
||||
ovsInternalPortNo = portNo;
|
||||
ovsInternalAdapterUp = TRUE;
|
||||
InsertHeadList(&ovsIpHelperRequestList, &request->link);
|
||||
ovsNumIpHelperRequests++;
|
||||
if (ovsNumIpHelperRequests == 1) {
|
||||
@ -1160,7 +1159,7 @@ OvsEnqueueIpHelperRequest(POVS_IP_HELPER_REQUEST request)
|
||||
|
||||
NdisAcquireSpinLock(&ovsIpHelperLock);
|
||||
|
||||
if (ovsInternalPortNo == OVS_DEFAULT_PORT_NO ||
|
||||
if (ovsInternalAdapterUp == FALSE ||
|
||||
ovsInternalIPConfigured == FALSE) {
|
||||
NdisReleaseSpinLock(&ovsIpHelperLock);
|
||||
OvsFreeMemoryWithTag(request, OVS_IPHELPER_POOL_TAG);
|
||||
@ -1554,7 +1553,7 @@ OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle)
|
||||
RtlZeroMemory(&ovsInternalIPRow, sizeof (MIB_IPINTERFACE_ROW));
|
||||
ovsInternalIP = 0;
|
||||
|
||||
ovsInternalPortNo = OVS_DEFAULT_PORT_NO;
|
||||
ovsInternalAdapterUp = FALSE;
|
||||
|
||||
InitializeListHead(&ovsSortedIPNeighList);
|
||||
|
||||
|
@ -114,7 +114,7 @@ typedef struct _OVS_IP_HELPER_THREAD_CONTEXT {
|
||||
NTSTATUS OvsInitIpHelper(NDIS_HANDLE ndisFilterHandle);
|
||||
VOID OvsCleanupIpHelper(VOID);
|
||||
|
||||
VOID OvsInternalAdapterUp(UINT32 portNo, GUID *netCfgInstanceId);
|
||||
VOID OvsInternalAdapterUp(GUID *netCfgInstanceId);
|
||||
VOID OvsInternalAdapterDown(VOID);
|
||||
|
||||
NTSTATUS OvsFwdIPHelperRequest(PNET_BUFFER_LIST nbl, UINT32 inPort,
|
||||
|
@ -564,7 +564,6 @@ OvsActivateSwitch(POVS_SWITCH_CONTEXT switchContext)
|
||||
OvsClearAllSwitchVports(switchContext);
|
||||
goto cleanup;
|
||||
}
|
||||
// OvsPostEvent(OVS_DEFAULT_PORT_NO, OVS_DEFAULT_EVENT_STATUS);
|
||||
|
||||
cleanup:
|
||||
if (status != NDIS_STATUS_SUCCESS) {
|
||||
|
@ -434,7 +434,7 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute)
|
||||
NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0);
|
||||
ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl,
|
||||
vport ? vport->portNo :
|
||||
OVS_DEFAULT_PORT_NO,
|
||||
OVS_DPPORT_NUMBER_INVALID,
|
||||
NDIS_SEND_FLAGS_SWITCH_DESTINATION_GROUP,
|
||||
&key, NULL, &layers, actions,
|
||||
execute->actionsLen);
|
||||
@ -1208,4 +1208,4 @@ OvsReadPacketCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx,
|
||||
status = OvsReadDpIoctl(instance->fileObject, usrParamsCtx->outputBuffer,
|
||||
usrParamsCtx->outputLength, replyLen);
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
@ -447,7 +447,7 @@ HvConnectNic(POVS_SWITCH_CONTEXT switchContext,
|
||||
NdisReleaseRWLock(switchContext->dispatchLock, &lockState);
|
||||
|
||||
if (nicParam->NicType == NdisSwitchNicTypeInternal) {
|
||||
OvsInternalAdapterUp(portNo, &nicParam->NetCfgInstanceId);
|
||||
OvsInternalAdapterUp(&nicParam->NetCfgInstanceId);
|
||||
}
|
||||
|
||||
done:
|
||||
|
Loading…
x
Reference in New Issue
Block a user