use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action in project netvirt by opendaylight.
the class ElanInterfaceManager method setBCGrouponOtherDpns.
@SuppressWarnings("checkstyle:IllegalCatch")
private void setBCGrouponOtherDpns(ElanInstance elanInfo, BigInteger dpId, int elanTag, long groupId) {
int bucketId = 0;
ElanDpnInterfacesList elanDpns = elanUtils.getElanDpnInterfacesList(elanInfo.getElanInstanceName());
if (elanDpns != null) {
List<DpnInterfaces> dpnInterfaces = elanDpns.getDpnInterfaces();
for (DpnInterfaces dpnInterface : dpnInterfaces) {
List<Bucket> remoteListBucketInfo = new ArrayList<>();
if (elanUtils.isDpnPresent(dpnInterface.getDpId()) && !Objects.equals(dpnInterface.getDpId(), dpId) && dpnInterface.getInterfaces() != null && !dpnInterface.getInterfaces().isEmpty()) {
List<Action> listAction = new ArrayList<>();
int actionKey = 0;
listAction.add(new ActionGroup(ElanUtils.getElanLocalBCGId(elanTag)).buildAction(++actionKey));
remoteListBucketInfo.add(MDSALUtil.buildBucket(listAction, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
for (DpnInterfaces otherFes : dpnInterfaces) {
if (elanUtils.isDpnPresent(otherFes.getDpId()) && !Objects.equals(otherFes.getDpId(), dpnInterface.getDpId()) && otherFes.getInterfaces() != null && !otherFes.getInterfaces().isEmpty()) {
try {
List<Action> remoteListActionInfo = elanItmUtils.getInternalTunnelItmEgressAction(dpnInterface.getDpId(), otherFes.getDpId(), elanUtils.isOpenstackVniSemanticsEnforced() ? elanUtils.getVxlanSegmentationId(elanInfo) : elanTag);
if (!remoteListActionInfo.isEmpty()) {
remoteListBucketInfo.add(MDSALUtil.buildBucket(remoteListActionInfo, MDSALUtil.GROUP_WEIGHT, bucketId, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP));
bucketId++;
}
} catch (Exception ex) {
LOG.error("setElanBCGrouponOtherDpns failed due to Exception caught; " + "Logical Group Interface not found between source Dpn - {}, " + "destination Dpn - {} ", dpnInterface.getDpId(), otherFes.getDpId(), ex);
return;
}
}
}
List<Bucket> elanL2GwDevicesBuckets = elanL2GatewayMulticastUtils.getRemoteBCGroupBucketsOfElanL2GwDevices(elanInfo, dpnInterface.getDpId(), bucketId);
remoteListBucketInfo.addAll(elanL2GwDevicesBuckets);
if (remoteListBucketInfo.isEmpty()) {
LOG.debug("No ITM is present on Dpn - {} ", dpnInterface.getDpId());
continue;
}
Group group = MDSALUtil.buildGroup(groupId, elanInfo.getElanInstanceName(), GroupTypes.GroupAll, MDSALUtil.buildBucketLists(remoteListBucketInfo));
LOG.trace("Installing remote bc group {} on dpnId {}", group, dpnInterface.getDpId());
mdsalManager.syncInstallGroup(dpnInterface.getDpId(), group);
}
}
try {
Thread.sleep(WAIT_TIME_FOR_SYNC_INSTALL);
} catch (InterruptedException e1) {
LOG.warn("Error while waiting for remote BC group on other DPNs for ELAN {} to install", elanInfo);
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action in project netvirt by opendaylight.
the class ElanInterfaceManager method createDropBucket.
private void createDropBucket(List<Bucket> listBucket) {
List<Action> actionsInfos = new ArrayList<>();
actionsInfos.add(new ActionDrop().buildAction());
Bucket dropBucket = MDSALUtil.buildBucket(actionsInfos, MDSALUtil.GROUP_WEIGHT, 0, MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP);
listBucket.add(dropBucket);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action in project netvirt by opendaylight.
the class OpenFlow13Utils method createActionNxLoadNsi.
public static Action createActionNxLoadNsi(short value, int order) {
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxLoadRegAction(new DstNxNsiCaseBuilder().setNxNsiDst(Boolean.TRUE).build(), BigInteger.valueOf(value), 7, false));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action in project netvirt by opendaylight.
the class OpenFlow13Utils method createActionNxLoadNshMdtype.
public static Action createActionNxLoadNshMdtype(short value, int order) {
ActionBuilder ab = createActionBuilder(order);
ab.setAction(nxLoadRegAction(new DstNxNshMdtypeCaseBuilder().setNxNshMdtype(Boolean.TRUE).build(), BigInteger.valueOf(value), 7, false));
return ab.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.Action in project netvirt by opendaylight.
the class OpenFlow13Utils method createActionOutPort.
public static Action createActionOutPort(final String portUri, final int order) {
OutputActionBuilder output = new OutputActionBuilder();
Uri value = new Uri(portUri);
output.setOutputNodeConnector(value);
ActionBuilder ab = createActionBuilder(order);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
return ab.build();
}
Aggregations