Update to BngProgrammable API
Setup of an attachment won't trigger counters clean up
Change-Id: I6be72bdedb71bbc6152e8192ec4614a2f812b014
(cherry picked from commit e12d0ea7f3a7590a30c282294e83f7978bda914b)
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/BngProgrammable.java b/core/api/src/main/java/org/onosproject/net/behaviour/BngProgrammable.java
index a35377e..3f6f9e9 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/BngProgrammable.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/BngProgrammable.java
@@ -54,13 +54,15 @@
* BngProgrammable.
* @throws BngProgrammableException while writing on BNG device.
*/
- void cleanUp(ApplicationId appId) throws BngProgrammableException;
+ void cleanUp(ApplicationId appId)
+ throws BngProgrammableException;
/**
* Set up the necessary state to enable termination of the attachment
- * traffic. Make also sure that the state of the given attachment is cleaned
- * up. If the attachment is active, packets will be forwarded/terminated
- * after calling this method, if not they will be dropped.
+ * traffic. If the attachment is active, packets will be
+ * forwarded/terminated after calling this method, if not they will be
+ * dropped. State, if already present in the data plane, will not be cleaned
+ * (e.g., counters).
*
* @param attachmentInfo Attachment information to configure the line
* termination.
@@ -77,8 +79,10 @@
*
* @param attachmentInfo Attachment information to remove the line
* termination.
+ * @throws BngProgrammableException while writing on BNG device.
*/
- void removeAttachment(Attachment attachmentInfo);
+ void removeAttachment(Attachment attachmentInfo)
+ throws BngProgrammableException;
/**
* Read all counters for a given attachment and returns a map with keys
diff --git a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/bng/FabricBngProgrammable.java b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/bng/FabricBngProgrammable.java
index 9b566c0..a58fd9b 100644
--- a/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/bng/FabricBngProgrammable.java
+++ b/pipelines/fabric/impl/src/main/java/org/onosproject/pipelines/fabric/impl/behaviour/bng/FabricBngProgrammable.java
@@ -112,8 +112,7 @@
lstFlowRules.add(buildTPppoeTermV4FlowRule(attachmentInfo));
}
lstFlowRules.add(buildTLineSessionMapFlowRule(attachmentInfo));
- // Clean-up attachment related counters
- this.resetCounters(attachmentInfo);
+
lstFlowRules.forEach(flowRule -> flowRuleService.applyFlowRules(flowRule));
}