vconn_sent counter is supposed to increase each time send() return
0, no matter if the vconn log debug is on or off.

Signed-off-by: Cheng Li <[email protected]>
---

Notes:
    v2: Increase vconn_sent only if send() return 0.

 lib/vconn.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/vconn.c b/lib/vconn.c
index b55676227..e9603432d 100644
--- a/lib/vconn.c
+++ b/lib/vconn.c
@@ -682,7 +682,6 @@ do_send(struct vconn *vconn, struct ofpbuf *msg)
 
     ofpmsg_update_length(msg);
     if (!VLOG_IS_DBG_ENABLED()) {
-        COVERAGE_INC(vconn_sent);
         retval = (vconn->vclass->send)(vconn, msg);
     } else {
         char *s = ofp_to_string(msg->data, msg->size, NULL, NULL, 1);
@@ -693,6 +692,9 @@ do_send(struct vconn *vconn, struct ofpbuf *msg)
         }
         free(s);
     }
+    if (!retval) {
+        COVERAGE_INC(vconn_sent);
+    }
     return retval;
 }
 
-- 
2.39.3

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

Reply via email to