- if (vport->ovsType == OVS_VPORT_TYPE_VXLAN) {
- gOvsSwitchContext->vxlanVport = vport;
- } else if (vport->ovsType == OVS_VPORT_TYPE_INTERNAL) {
- gOvsSwitchContext->internalVport = vport;
- gOvsSwitchContext->internalPortId = vport->portId;
- } else if (vport->ovsType == OVS_VPORT_TYPE_NETDEV &&
- vport->isExternal) {
- gOvsSwitchContext->virtualExternalVport = vport;
- gOvsSwitchContext->virtualExternalPortId = vport->portId;
- }
-
- /*
- * insert the port into the hash array of ports: by port number and ovs
- * and ovs (datapath) port name.
- * NOTE: OvsJhashWords has portNo as "1" word. This is ok, because the
- * portNo is stored in 2 bytes only (max port number = MAXUINT16).
- */
- hash = OvsJhashWords(&vport->portNo, 1, OVS_HASH_BASIS);
- InsertHeadList(&gOvsSwitchContext->portNoHashArray[hash & OVS_VPORT_MASK],
- &vport->portNoLink);
-
- hash = OvsJhashBytes(vport->ovsName, portNameLen, OVS_HASH_BASIS);
- InsertHeadList(&gOvsSwitchContext->ovsPortNameHashArray[hash & OVS_VPORT_MASK],
- &vport->ovsNameLink);
+ status = InitOvsVportCommon(gOvsSwitchContext, vport);
+ ASSERT(status == STATUS_SUCCESS);