Skip to content

Commit

Permalink
datapath-windows: OvsFindVportByPortIdAndNicIndex() and external port.
Browse files Browse the repository at this point in the history
We use OvsFindVportByPortIdAndNicIndex() to lookup the vport for a
packte received from the Hyper-V switch. If a packet was indeed received
from the virtual external NIC, we should flag it.

Validation:
1. Install and Uninstall the OVS EXT Driver (without enabling the OVS
   extension on the Hyper-V switch).
2. Install and Uninstall the OVS EXT Driver (with enabling the OVS
   extension on the Hyper-V switch). Hyper-V switch had a few ports.
3. Install and Uninstall the OVS EXT Driver (with enabling the OVS
   extension on the Hyper-V switch). Added a few ports before
   uninstalling.
4. Install the OVS EXT driver, and test the following functionality:
   a) ping between 2 VMs on the same host
   b) ping between 2 VMs on 2 Hyper-Vs - one physical and another
      virtual backed by VLAN (patch port between br-pif and br-int).
   c) ping between 2 VMs on 2 Hyper-Vs - one physical and another
      virtual backed by VXLAN.
   d) Successful uninstallation after these tests.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
nithinrajub authored and blp committed Oct 28, 2014
1 parent 35f2016 commit 3aa40c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions datapath-windows/ovsext/Vport.c
Expand Up @@ -552,9 +552,13 @@ OvsFindVportByPortIdAndNicIndex(POVS_SWITCH_CONTEXT switchContext,
NDIS_SWITCH_PORT_ID portId,
NDIS_SWITCH_NIC_INDEX index)
{
if (portId == switchContext->virtualExternalPortId) {
if (switchContext->virtualExternalVport &&
portId == switchContext->virtualExternalPortId &&
index == switchContext->virtualExternalVport->nicIndex) {
return (POVS_VPORT_ENTRY)switchContext->virtualExternalVport;
} else if (switchContext->internalPortId == portId) {
} else if (switchContext->internalVport &&
portId == switchContext->internalPortId &&
index == switchContext->internalVport->nicIndex) {
return (POVS_VPORT_ENTRY)switchContext->internalVport;
} else {
PLIST_ENTRY head, link;
Expand Down

0 comments on commit 3aa40c8

Please sign in to comment.