use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules in project netvirt by opendaylight.
the class QosNeutronUtils method setPortDscpMarking.
public void setPortDscpMarking(Port port, DscpmarkingRules dscpMark) {
if (!qosEosHandler.isQosClusterOwner()) {
LOG.trace("Not Qos Cluster Owner. Ignoring setting DSCP marking");
return;
}
LOG.trace("Setting DSCP value {} on Port {}", port, dscpMark);
BigInteger dpnId = getDpnForInterface(port.getUuid().getValue());
String ifName = port.getUuid().getValue();
IpAddress ipAddress = port.getFixedIps().get(0).getIpAddress();
Short dscpValue = dscpMark.getDscpMark();
if (dpnId.equals(BigInteger.ZERO)) {
LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
return;
}
// 1. OF rules
addFlow(dpnId, dscpValue, ifName, ipAddress, getInterfaceStateFromOperDS(ifName));
if (qosServiceConfiguredPorts.add(port.getUuid())) {
// bind qos service to interface
bindservice(ifName);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules in project netvirt by opendaylight.
the class QosPolicyChangeListener method add.
private void add(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules input) {
LOG.trace("Adding DscpMarkingRules : key: {}, value={}", identifier, input);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, qosUuid);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortDscpMarking(port, input);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules in project netvirt by opendaylight.
the class QosPolicyChangeListener method update.
private void update(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules original, DscpmarkingRules update) {
LOG.trace("Updating DscpMarkingRules : key: {}, original value={}, update value={}", identifier, original, update);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
update(qosUuid, update);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules in project netvirt by opendaylight.
the class QosPolicyChangeListener method reapplyPolicy.
public void reapplyPolicy(String entityid) {
Uuid policyUuid = Uuid.getDefaultInstance(entityid);
if (!qosNeutronUtils.getQosPolicyMap().get(policyUuid).getBandwidthLimitRules().isEmpty()) {
BandwidthLimitRules bandwidthLimitRules = qosNeutronUtils.getQosPolicyMap().get(policyUuid).getBandwidthLimitRules().get(0);
update(policyUuid, bandwidthLimitRules);
}
if (!qosNeutronUtils.getQosPolicyMap().get(policyUuid).getDscpmarkingRules().isEmpty()) {
DscpmarkingRules dscpmarkingRules = qosNeutronUtils.getQosPolicyMap().get(policyUuid).getDscpmarkingRules().get(0);
update(policyUuid, dscpmarkingRules);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules in project netvirt by opendaylight.
the class QosPolicyChangeListener method update.
private void update(Uuid qosUuid, DscpmarkingRules update) {
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, qosUuid);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortDscpMarking(port, update);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
Aggregations