From 821fc2279471ff1bddc856aae2cebc8e8d1fa647 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Thu, 24 Oct 2013 10:23:44 -0700 Subject: [PATCH] Have openflow switch report all flow removals - Current Flow Programmer Service code in protocol_plugins.openflow instructs the switch to report the flow removal event to the controller only for hard or idle timeout flows, during flowmod message creation. Nevrekar pointed out in some switches a removal of openflow flows may be done by other entities. So in order for the app on top of controller to get to know about this flow deletions, we are here enabling the flow removal event report from the switch for all controller installed flows. Change-Id: Iae2f7716b592269fd09c4e2fa4a18ae274367f9d Signed-off-by: Alessandro Boch --- .../openflow/internal/FlowConverter.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowConverter.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowConverter.java index daf1aa8b71..2bbe9c12c6 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowConverter.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowConverter.java @@ -451,13 +451,10 @@ public class FlowConverter { if (port != null) { ((OFFlowMod) fm).setOutPort(port); } - if (command == OFFlowMod.OFPFC_ADD - || command == OFFlowMod.OFPFC_MODIFY + if (command == OFFlowMod.OFPFC_ADD || command == OFFlowMod.OFPFC_MODIFY || command == OFFlowMod.OFPFC_MODIFY_STRICT) { - if (flow.getIdleTimeout() != 0 || flow.getHardTimeout() != 0) { - // Instruct switch to let controller know when flow expires - ((OFFlowMod) fm).setFlags((short) 1); - } + // Instruct switch to let controller know when flow is removed + ((OFFlowMod) fm).setFlags((short) 1); } } else { ((V6FlowMod) fm).setVendor(); @@ -475,13 +472,10 @@ public class FlowConverter { if (port != null) { ((V6FlowMod) fm).setOutPort(port); } - if (command == OFFlowMod.OFPFC_ADD - || command == OFFlowMod.OFPFC_MODIFY + if (command == OFFlowMod.OFPFC_ADD || command == OFFlowMod.OFPFC_MODIFY || command == OFFlowMod.OFPFC_MODIFY_STRICT) { - if (flow.getIdleTimeout() != 0 || flow.getHardTimeout() != 0) { - // Instruct switch to let controller know when flow expires - ((V6FlowMod) fm).setFlags((short) 1); - } + // Instruct switch to let controller know when flow is removed + ((V6FlowMod) fm).setFlags((short) 1); } } logger.trace("Openflow Match: {} Openflow Actions: {}", ofMatch, -- 2.36.6