Do not apply rate limit rule on subport 38/73438/6
authorArun Sharma <arun.e.sharma@ericsson.com>
Tue, 26 Jun 2018 09:42:43 +0000 (15:12 +0530)
committerSam Hague <shague@redhat.com>
Sat, 30 Jun 2018 02:18:14 +0000 (02:18 +0000)
Fix details: QoS rate limit rule is applicable on a neutron
port (at trunk level) and can not be applied at subport level.
If port has multiple subports then its total limit of all subports.
Only QoS DSCP policy can be applied on sub port.

Change-Id: Ie75439aa0695412cb989f6076e8d783ed0fdcbb4
Signed-off-by: Arun Sharma <arun.e.sharma@ericsson.com>
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronUtils.java

index fcbf73f60870d0b2d846d17b8e56121aa9f7d850..a1a77424f9306e697f53408821162966d5aeb082 100644 (file)
@@ -449,10 +449,20 @@ public class QosNeutronUtils {
         OvsdbBridgeRef bridgeRefEntry = getBridgeRefEntryFromOperDS(dpId);
         Optional<Node> bridgeNode = MDSALUtil.read(LogicalDatastoreType.OPERATIONAL,
                 bridgeRefEntry.getValue().firstIdentifierOf(Node.class), dataBroker);
-
+        if (!bridgeNode.isPresent()) {
+            LOG.error("bridge not found for dpn {} port {} in operational datastore", dpId, port.getUuid().getValue());
+            return;
+        }
+        LOG.debug("bridgeNode {}", bridgeNode.get().getNodeId().getValue());
 
         TerminationPoint tp = SouthboundUtils.getTerminationPointByExternalId(bridgeNode.get(),
                 port.getUuid().getValue());
+        if (tp == null) {
+            LOG.debug("Skipping setting of bandwidth limit rules for subport {}",
+                    port.getUuid().getValue());
+            return;
+        }
+        LOG.debug("tp: {}", tp.getTpId().getValue());
         OvsdbTerminationPointAugmentation ovsdbTp = tp.augmentation(OvsdbTerminationPointAugmentation.class);
 
         OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();