Signed-off-by: Ben Pfaff <[email protected]>
---
 ofproto/ofproto-dpif.c     | 9 +++++++++
 ofproto/ofproto-provider.h | 3 +++
 ofproto/ofproto.c          | 7 ++++++-
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 752d2304a163..098db18c7ffa 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1792,6 +1792,14 @@ set_tables_version(struct ofproto *ofproto_, 
ovs_version_t version)
     ofproto->backer->need_revalidate = REV_FLOW_TABLE;
 }
 
+static void
+packet_type_aware_changed(struct ofproto *ofproto_)
+{
+    struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
+
+    ofproto->backer->need_revalidate = REV_RECONFIGURE;
+}
+
 static struct ofport *
 port_alloc(void)
 {
@@ -5644,6 +5652,7 @@ const struct ofproto_class ofproto_dpif_class = {
     flush,
     query_tables,
     set_tables_version,
+    packet_type_aware_changed,
     port_alloc,
     port_construct,
     port_destruct,
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index fbf3bdaeac8d..749f61b34f8b 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -933,6 +933,9 @@ struct ofproto_class {
      * can be triggered. */
     void (*set_tables_version)(struct ofproto *ofproto, ovs_version_t version);
 
+    /* Called when 'ofproto->packet_type_aware' has changed. */
+    void (*packet_type_aware_changed)(struct ofproto *ofproto);
+
 /* ## ---------------- ## */
 /* ## ofport Functions ## */
 /* ## ---------------- ## */
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 67aaa755f10e..11a26af9f1bb 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -787,7 +787,12 @@ ofproto_set_dp_desc(struct ofproto *p, const char *dp_desc)
 void
 ofproto_set_packet_type_aware(struct ofproto *p, bool pta)
 {
-    p->packet_type_aware = pta;
+    if (pta != p->packet_type_aware) {
+        p->packet_type_aware = pta;
+        if (p->ofproto_class->packet_type_aware_changed) {
+            p->ofproto_class->packet_type_aware_changed(p);
+        }
+    }
 }
 
 int
-- 
2.10.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to