- @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);
- }
- }
- }
-
- /**
- * Returns the bucket info with the given interface as the only bucket.
- */
- private Bucket getLocalBCGroupBucketInfo(InterfaceInfo interfaceInfo, int bucketIdStart) {
- return MDSALUtil.buildBucket(getInterfacePortActions(interfaceInfo), MDSALUtil.GROUP_WEIGHT, bucketIdStart,
- MDSALUtil.WATCH_PORT, MDSALUtil.WATCH_GROUP);
- }
-
- private List<MatchInfo> buildMatchesForVni(Long vni) {