diff options
author | Ankur Sharma <ankursharma@vmware.com> | 2014-10-15 15:54:52 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-10-15 17:00:23 -0700 |
commit | a74933bc9f3935c50900fcb16c6f61bf6056ca5f (patch) | |
tree | e2cfd57be321e246bde66b1880022ce3a2557f4a /datapath-windows/ovsext/User.c | |
parent | 094a1315c53162b2eddf1fc8213a0e900650e25b (diff) | |
download | openvswitch-a74933bc9f3935c50900fcb16c6f61bf6056ca5f.tar.gz |
datapath-windows: changes to existing PACKET_CMD handler.
In this patch we have made following changes:
OvsPacketExecute =>
Changed the data structure to have packet and
actions as pointer (instead of zero length array). It is done because
we will not do memcpy of packet now, pointer will just point
to corresponding offset in input buffer.
OvsExecuteDpIoctl =>
We only need input buffer now. Hence Changed the function signature.
Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath-windows/ovsext/User.c')
-rw-r--r-- | datapath-windows/ovsext/User.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index f40846c18..31c579cc9 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -319,13 +319,10 @@ OvsNlExecuteCmdHandler(POVS_USER_PARAMS_CONTEXT usrParamsCtx, } NTSTATUS -OvsExecuteDpIoctl(PVOID inputBuffer, - UINT32 inputLength, - UINT32 outputLength) +OvsExecuteDpIoctl(OvsPacketExecute *execute) { NTSTATUS status = STATUS_SUCCESS; NTSTATUS ndisStatus; - OvsPacketExecute *execute; LOCK_STATE_EX lockState; PNET_BUFFER_LIST pNbl; PNL_ATTR actions; @@ -334,35 +331,26 @@ OvsExecuteDpIoctl(PVOID inputBuffer, OVS_PACKET_HDR_INFO layers; POVS_VPORT_ENTRY vport; - if (inputLength < sizeof(*execute) || outputLength != 0) { - return STATUS_INFO_LENGTH_MISMATCH; - } - NdisAcquireSpinLock(gOvsCtrlLock); if (gOvsSwitchContext == NULL) { status = STATUS_INVALID_PARAMETER; goto unlock; } - execute = (struct OvsPacketExecute *) inputBuffer; - if (execute->packetLen == 0) { status = STATUS_INVALID_PARAMETER; goto unlock; } - if (inputLength != sizeof (*execute) + - execute->actionsLen + execute->packetLen) { - status = STATUS_INFO_LENGTH_MISMATCH; - goto unlock; - } - actions = (PNL_ATTR)((PCHAR)&execute->actions + execute->packetLen); + actions = execute->actions; + + ASSERT(actions); /* * Allocate the NBL, copy the data from the userspace buffer. Allocate * also, the forwarding context for the packet. */ - pNbl = OvsAllocateNBLForUserBuffer(gOvsSwitchContext, &execute->packetBuf, + pNbl = OvsAllocateNBLForUserBuffer(gOvsSwitchContext, execute->packetBuf, execute->packetLen); if (pNbl == NULL) { status = STATUS_NO_MEMORY; |