diff mbox series

[ovs-dev,v1] ofproto-dpif: avoid unneccesary backer revalidation

Message ID 2022010822583077861788@chinatelecom.cn
State Handled Elsewhere
Headers show
Series [ovs-dev,v1] ofproto-dpif: avoid unneccesary backer revalidation | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test fail github build: failed

Commit Message

Cheng Li Jan. 8, 2022, 2:58 p.m. UTC
If lldp didn't change, we are not supposed to trigger backer
revalidation.

Signed-off-by: lic121 <lic121@chinatelecom.cn>
---
 ofproto/ofproto-dpif.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
1.8.3.1
diff mbox series

Patch

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index bc3df8e..eb0e412 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -2456,10 +2456,10 @@  set_lldp(struct ofport *ofport_,
     struct ofport_dpif *ofport = ofport_dpif_cast(ofport_);
     struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto);
     int error = 0;
+    struct lldp *old_lldp = ofport->lldp;

     if (cfg) {
         if (!ofport->lldp) {
-            ofproto->backer->need_revalidate = REV_RECONFIGURE;
             ofport->lldp = lldp_create(ofport->up.netdev, ofport_->mtu, cfg);
         }

@@ -2471,6 +2471,8 @@  set_lldp(struct ofport *ofport_,
     } else if (ofport->lldp) {
         lldp_unref(ofport->lldp);
         ofport->lldp = NULL;
+    }
+    if (old_lldp != ofport->lldp) {
         ofproto->backer->need_revalidate = REV_RECONFIGURE;
     }