package org.opendaylight.ovsdb.southbound.ovsdb.transact;
import static org.opendaylight.ovsdb.lib.operations.Operations.op;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
+ import java.util.concurrent.ExecutionException;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
+ import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent;
+ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+ import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.ovsdb.lib.error.SchemaVersionMismatchException;
import org.opendaylight.ovsdb.lib.notation.UUID;
import org.opendaylight.ovsdb.lib.operations.TransactionBuilder;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.ovsdb.schema.openvswitch.Port;
+ import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
import org.opendaylight.ovsdb.southbound.SouthboundConstants;
+ import org.opendaylight.ovsdb.southbound.SouthboundProvider;
import org.opendaylight.ovsdb.utils.yang.YangUtils;
+ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbQosRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.Queues;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfd;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+ import com.google.common.base.Optional;
import com.google.common.collect.Sets;
+ import com.google.common.util.concurrent.CheckedFuture;
public class TerminationPointUpdateCommand implements TransactCommand {
@Override
public void execute(TransactionBuilder transaction, BridgeOperationalState state,
AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> events) {
- execute(transaction, TransactUtils.extractCreatedOrUpdated(events, OvsdbTerminationPointAugmentation.class));
+ execute(transaction, state, TransactUtils.extractCreatedOrUpdated(events, OvsdbTerminationPointAugmentation.class));
}
@Override
public void execute(TransactionBuilder transaction, BridgeOperationalState state,
Collection<DataTreeModification<Node>> modifications) {
- execute(transaction,
+ execute(transaction, state,
TransactUtils.extractCreatedOrUpdated(modifications, OvsdbTerminationPointAugmentation.class));
}
- private void execute(TransactionBuilder transaction,
+ private void execute(TransactionBuilder transaction, BridgeOperationalState state,
Map<InstanceIdentifier<OvsdbTerminationPointAugmentation>,
OvsdbTerminationPointAugmentation> createdOrUpdated) {
LOG.trace("TerminationPointUpdateCommand called");
for (Entry<InstanceIdentifier<OvsdbTerminationPointAugmentation>,
OvsdbTerminationPointAugmentation> terminationPointEntry : createdOrUpdated.entrySet()) {
- updateTerminationPoint(transaction, terminationPointEntry.getKey(), terminationPointEntry.getValue());
+ updateTerminationPoint(transaction, state, terminationPointEntry.getKey(), terminationPointEntry.getValue());
}
}
- public void updateTerminationPoint(TransactionBuilder transaction,
+ public void updateTerminationPoint(TransactionBuilder transaction, BridgeOperationalState state,
InstanceIdentifier<OvsdbTerminationPointAugmentation> iid,
OvsdbTerminationPointAugmentation terminationPoint) {
if (terminationPoint != null) {
iid.firstIdentifierOf(OvsdbTerminationPointAugmentation.class), terminationPoint.getName());
// Update port
+ OvsdbBridgeAugmentation operBridge = state.getBridgeNode(iid).get().getAugmentation(OvsdbBridgeAugmentation.class);
Port port = TyperUtils.getTypedRowWrapper(
transaction.getDatabaseSchema(), Port.class);
- updatePort(terminationPoint, port);
+ updatePort(terminationPoint, port, operBridge);
Port extraPort = TyperUtils.getTypedRowWrapper(
transaction.getDatabaseSchema(), Port.class);
extraPort.setName("");
updateInterfaceExternalIds(terminationPoint, ovsInterface);
updateInterfaceLldp(terminationPoint, ovsInterface);
updateInterfaceBfd(terminationPoint, ovsInterface);
+ updateInterfacePolicing(terminationPoint, ovsInterface);
}
private void updatePort(
final OvsdbTerminationPointAugmentation terminationPoint,
- final Port port) {
+ final Port port,
+ final OvsdbBridgeAugmentation operBridge) {
updatePortOtherConfig(terminationPoint, port);
updatePortVlanTag(terminationPoint, port);
updatePortVlanTrunk(terminationPoint, port);
updatePortVlanMode(terminationPoint, port);
updatePortExternalIds(terminationPoint, port);
- updatePortQos(terminationPoint, port);
+ updatePortQos(terminationPoint, port, operBridge);
}
private void updatePortQos(
final OvsdbTerminationPointAugmentation terminationPoint,
- final Port port) {
+ final Port port,
+ final OvsdbBridgeAugmentation operBridge) {
Set<UUID> uuidSet = Sets.newHashSet();
- Uuid qosUuid = terminationPoint.getQos();
- if (qosUuid != null) {
- uuidSet.add(new UUID(qosUuid.getValue()));
+
+ // First check if QosEntry is present and use that
+ if (terminationPoint.getQosEntry() != null && !terminationPoint.getQosEntry().isEmpty()) {
+ OvsdbQosRef qosRef = terminationPoint.getQosEntry().iterator().next().getQosRef();
+ Uri qosId = qosRef.getValue().firstKeyOf(QosEntries.class).getQosId();
+ OvsdbNodeAugmentation operNode = getOperNode(operBridge);
+ if (operNode != null && operNode.getQosEntries() != null &&
+ !operNode.getQosEntries().isEmpty()) {
+ for (QosEntries qosEntry : operNode.getQosEntries()) {
+ if (qosEntry.getQosId().equals(qosId)) {
+ uuidSet.add(new UUID(qosEntry.getQosUuid().getValue()));
+ }
+ }
+ }
+ if (uuidSet.size() == 0) {
+ uuidSet.add(new UUID(SouthboundConstants.QOS_NAMED_UUID_PREFIX +
+ TransactUtils.bytesToHexString(qosId.getValue().getBytes())));
+ }
+ } else {
+ // Second check if Qos is present and use that (deprecated)
+ // Do not bother to check if QosEntry and Qos are consistent if both are present
+ Uuid qosUuid = terminationPoint.getQos();
+ if (qosUuid != null) {
+ uuidSet.add(new UUID(qosUuid.getValue()));
+ }
}
port.setQos(uuidSet);
}
+ private OvsdbNodeAugmentation getOperNode(final OvsdbBridgeAugmentation operBridge) {
+ @SuppressWarnings("unchecked")
+ InstanceIdentifier<Node> iidNode = (InstanceIdentifier<Node>)operBridge.getManagedBy().getValue();
+ OvsdbNodeAugmentation operNode = null;
+ ReadOnlyTransaction transaction = SouthboundProvider.getDb().newReadOnlyTransaction();
+ CheckedFuture<Optional<Node>, ReadFailedException> future =
+ transaction.read(LogicalDatastoreType.OPERATIONAL, iidNode);
+ try {
+ Optional<Node> nodeOptional = future.get();
+ if (nodeOptional.isPresent()) {
+ operNode = nodeOptional.get().getAugmentation(OvsdbNodeAugmentation.class);
+ }
+ } catch (InterruptedException | ExecutionException e) {
+ LOG.warn("Error reading from datastore", e);
+ }
+ return operNode;
+ }
private void updateOfPort(
final OvsdbTerminationPointAugmentation terminationPoint,
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("lldp", "Interface", e);
}
}
}
}
} catch (SchemaVersionMismatchException e) {
- LOG.debug("bfd column for Interface Table unsupported for this version of ovsdb schema", e);
+ schemaMismatchLog("bfd", "Interface", e);
}
}
+ private void updateInterfacePolicing(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ Long ingressPolicingRate = terminationPoint.getIngressPolicingRate();
+ if (ingressPolicingRate != null) {
+ ovsInterface.setIngressPolicingRate(ingressPolicingRate);
+ }
+ Long ingressPolicingBurst = terminationPoint.getIngressPolicingBurst();
+ if (ingressPolicingBurst != null) {
+ ovsInterface.setIngressPolicingBurst(ingressPolicingBurst);
+ }
+ }
+
private void updatePortExternalIds(
final OvsdbTerminationPointAugmentation terminationPoint,
final Port port) {
package org.opendaylight.ovsdb.southbound.transactions.md;
+import static org.opendaylight.ovsdb.southbound.SouthboundUtil.schemaMismatchLog;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.opendaylight.ovsdb.schema.openvswitch.Bridge;
import org.opendaylight.ovsdb.schema.openvswitch.Interface;
import org.opendaylight.ovsdb.schema.openvswitch.Port;
+ import org.opendaylight.ovsdb.schema.openvswitch.Qos;
import org.opendaylight.ovsdb.southbound.OvsdbConnectionInstance;
import org.opendaylight.ovsdb.southbound.SouthboundConstants;
import org.opendaylight.ovsdb.southbound.SouthboundMapper;
import org.opendaylight.ovsdb.southbound.SouthboundUtil;
+ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.l2.types.rev130827.VlanId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbQosRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagedNodeEntry;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntriesKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfd;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortExternalIdsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortOtherConfigsBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.QosEntry;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.QosEntryBuilder;
+ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.QosEntryKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Trunks;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.TrunksBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
private Map<UUID, Interface> interfaceUpdatedRows;
private Map<UUID, Interface> interfaceOldRows;
private Map<UUID, Bridge> bridgeUpdatedRows;
+ private Map<UUID, Qos> qosUpdatedRows;
public OvsdbPortUpdateCommand(OvsdbConnectionInstance key, TableUpdates updates,
DatabaseSchema dbSchema) {
super(key, updates, dbSchema);
interfaceUpdatedRows = TyperUtils.extractRowsUpdated(Interface.class, updates, dbSchema);
interfaceOldRows = TyperUtils.extractRowsOld(Interface.class, updates, dbSchema);
bridgeUpdatedRows = TyperUtils.extractRowsUpdated(Bridge.class, updates, dbSchema);
+ qosUpdatedRows = TyperUtils.extractRowsUpdated(Qos.class, updates, dbSchema);
}
@Override
getInstanceIdentifier(bridgeIid.get(), portUpdate.getValue());
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
new OvsdbTerminationPointAugmentationBuilder();
- buildTerminationPoint(tpAugmentationBuilder,portUpdate.getValue());
+ buildTerminationPoint(transaction, tpPath, tpAugmentationBuilder, node, portUpdate);
UUID interfaceUUID = (UUID)portUpdate.getValue().getInterfacesColumn().getData().toArray()[0];
if (interfaceUpdatedRows.containsKey(interfaceUUID)) {
buildTerminationPoint(tpAugmentationBuilder,
}
}
- private void buildTerminationPoint(OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder,
- Port portUpdate) {
+ private void buildTerminationPoint(ReadWriteTransaction transaction,
+ InstanceIdentifier<TerminationPoint> tpPath,
+ OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder,
+ Node node, Entry<UUID, Port> portUpdate) {
tpAugmentationBuilder
- .setName(portUpdate.getName());
+ .setName(portUpdate.getValue().getName());
tpAugmentationBuilder.setPortUuid(new Uuid(
- portUpdate.getUuid().toString()));
- updatePort(portUpdate, tpAugmentationBuilder);
+ portUpdate.getValue().getUuid().toString()));
+ updatePort(transaction, node, tpPath, portUpdate, tpAugmentationBuilder);
}
private void buildTerminationPoint(OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder,
updateInterface(interfaceUpdate, type,ovsdbTerminationPointBuilder);
}
- private void updatePort(final Port port,
+ private void updatePort(final ReadWriteTransaction transaction, final Node node,
+ final InstanceIdentifier<TerminationPoint> tpPath, final Entry<UUID, Port> port,
final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
- updateVlan(port, ovsdbTerminationPointBuilder);
- updateVlanTrunks(port, ovsdbTerminationPointBuilder);
- updateVlanMode(port, ovsdbTerminationPointBuilder);
- updateQos(port, ovsdbTerminationPointBuilder);
- updatePortExternalIds(port, ovsdbTerminationPointBuilder);
- updatePortOtherConfig(port, ovsdbTerminationPointBuilder);
+ updateVlan(port.getValue(), ovsdbTerminationPointBuilder);
+ updateVlanTrunks(port.getValue(), ovsdbTerminationPointBuilder);
+ updateVlanMode(port.getValue(), ovsdbTerminationPointBuilder);
+ updateQos(transaction, node, tpPath, port, ovsdbTerminationPointBuilder);
+ updatePortExternalIds(port.getValue(), ovsdbTerminationPointBuilder);
+ updatePortOtherConfig(port.getValue(), ovsdbTerminationPointBuilder);
}
private void updateInterface(final Interface interf,
updateInterfaceLldp(interf, ovsdbTerminationPointBuilder);
updateInterfaceBfd(interf, ovsdbTerminationPointBuilder);
updateInterfaceBfdStatus(interf, ovsdbTerminationPointBuilder);
+ updateInterfacePolicing(interf, ovsdbTerminationPointBuilder);
}
private void updateVlan(final Port port,
}
}
- private void updateQos(final Port port,
- final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
- if (port.getQosColumn() == null) {
+ private void updateQos(final ReadWriteTransaction transaction, final Node node, InstanceIdentifier<TerminationPoint> tpPath,
+ final Entry<UUID, Port> port, final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
+ if (port.getValue() == null) {
return;
}
- Collection<UUID> qosUuidCol = port.getQosColumn().getData();
+ Collection<UUID> qosUuidCol = port.getValue().getQosColumn().getData();
if (!qosUuidCol.isEmpty()) {
- Iterator<UUID> itr = qosUuidCol.iterator();
- UUID qosUuid = itr.next();
+ UUID qosUuid = qosUuidCol.iterator().next();
ovsdbTerminationPointBuilder.setQos(new Uuid(qosUuid.toString()));
+
+ NodeId nodeId = node.getNodeId();
+ OvsdbNodeAugmentation ovsdbNode = node.getAugmentation(OvsdbNodeAugmentation.class);
+
+ // Delete an older QoS entry
+ if (portOldRows.containsKey(port.getKey()) &&
+ portOldRows.get(port.getKey()).getQosColumn() != null) {
+ Collection<UUID> oldQos = portOldRows.get(port.getKey()).getQosColumn().getData();
+ if (!oldQos.isEmpty()) {
+ UUID oldQosUuid = oldQos.iterator().next();
+ if (!oldQosUuid.equals(qosUuid)) {
+ InstanceIdentifier<QosEntries> oldQosIid = getQosIid(nodeId, ovsdbNode, oldQosUuid);
+ if (oldQosIid != null) {
+ InstanceIdentifier<QosEntry> oldPortQosIid = tpPath
+ .augmentation(OvsdbTerminationPointAugmentation.class)
+ .child(QosEntry.class,
+ new QosEntryKey(new Long(SouthboundConstants.PORT_QOS_LIST_KEY)));
+ // new QosEntryKey(new OvsdbQosRef(oldQosIid)));
+ transaction.delete(LogicalDatastoreType.OPERATIONAL, oldPortQosIid);
+ }
+ }
+ }
+ }
+
+ InstanceIdentifier<QosEntries> qosIid = getQosIid(nodeId, ovsdbNode, qosUuid);
+ if (qosIid != null) {
+ List<QosEntry> qosList = new ArrayList<>();
+ OvsdbQosRef qosRef = new OvsdbQosRef(qosIid);
+ qosList.add(new QosEntryBuilder()
+ .setKey(new QosEntryKey(new Long(SouthboundConstants.PORT_QOS_LIST_KEY)))
+ .setQosRef(qosRef).build());
+ ovsdbTerminationPointBuilder.setQosEntry(qosList);
+ }
+ }
+ }
+
+ private InstanceIdentifier<QosEntries> getQosIid(NodeId nodeId, OvsdbNodeAugmentation ovsdbNode, UUID qosUuid) {
+ // Search for the QoS entry first in the operational datastore
+ for (QosEntries qosEntry : ovsdbNode.getQosEntries()) {
+ if (qosEntry.getQosUuid().equals(new Uuid(qosUuid.toString()))) {
+ return SouthboundMapper.createInstanceIdentifier(nodeId)
+ .augmentation(OvsdbNodeAugmentation.class)
+ .child(QosEntries.class, new QosEntriesKey(qosEntry.getQosId()));
+ }
+ }
+
+ // Search for the QoS entry in the current OVS updates
+ for (Entry<UUID, Qos> qosUpdate : qosUpdatedRows.entrySet()) {
+ Qos qos = qosUpdate.getValue();
+ if (qos.getUuid().equals(qosUuid)) {
+ if (qos.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) {
+ return (InstanceIdentifier<QosEntries>) SouthboundUtil.deserializeInstanceIdentifier(
+ qos.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY));
+ } else {
+ return SouthboundMapper.createInstanceIdentifier(nodeId)
+ .augmentation(OvsdbNodeAugmentation.class)
+ .child(QosEntries.class, new QosEntriesKey(
+ new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString())));
+ }
+ }
}
+ LOG.debug("QoS UUID {} assigned to port not found in operational node {} or QoS updates", qosUuid, ovsdbNode);
+ return SouthboundMapper.createInstanceIdentifier(nodeId)
+ .augmentation(OvsdbNodeAugmentation.class)
+ .child(QosEntries.class, new QosEntriesKey(
+ new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString())));
}
private void updateOfPort(final Interface interf,
ovsdbTerminationPointBuilder.setInterfaceLldp(interfaceLldpList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("lldp column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("lldp", "Interface", e);
}
}
ovsdbTerminationPointBuilder.setInterfaceBfdStatus(interfaceBfdStatusList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("bfd-status column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("bfd", "Interface", e);
}
}
ovsdbTerminationPointBuilder.setInterfaceBfd(interfaceBfdList);
}
} catch (SchemaVersionMismatchException e) {
- // We don't care about the exception stack trace here
- LOG.debug("bfd column for Interface Table unsupported for this version of ovsdb schema. {}", e.getMessage());
+ schemaMismatchLog("bfd", "Interface", e);
+
}
}
+ private void updateInterfacePolicing(final Interface interf,
+ final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
+
+ Long ingressPolicingRate = null;
+ if (interf.getIngressPolicingRateColumn() != null) {
+ ingressPolicingRate = interf.getIngressPolicingRateColumn().getData();
+ }
+ if (ingressPolicingRate != null) {
+ if (ingressPolicingRate >= 0) {
+ ovsdbTerminationPointBuilder
+ .setIngressPolicingRate(ingressPolicingRate);
+ } else {
+ LOG.debug("Received negative value for ingressPolicingRate from ovsdb for {} {}",
+ interf.getName(),ingressPolicingRate);
+ }
+ }
+
+ Long ingressPolicingBurst = null;
+ if (interf.getIngressPolicingBurstColumn() != null) {
+ ingressPolicingBurst = interf.getIngressPolicingBurstColumn().getData();
+ }
+ if (ingressPolicingBurst != null) {
+ if (ingressPolicingBurst >= 0) {
+ ovsdbTerminationPointBuilder
+ .setIngressPolicingBurst(ingressPolicingBurst);
+ } else {
+ LOG.debug("Received negative value for ingressPolicingBurst from ovsdb for {} {}",
+ interf.getName(),ingressPolicingBurst);
+ }
+ }
+ }
+
private boolean portQosCleared(Entry<UUID, Port> portUpdate) {
if (portUpdate.getValue().getQosColumn() == null) {
return false;