diff mbox series

[ovs-dev,v2] vconn: Count vconn_sent regardless of log level.

Message ID 20240106092320.1168843-1-lic121@chinatelecom.cn
State Accepted
Commit 2535d171a311e998a3e6926c306645a46bc36f9a
Delegated to: Ilya Maximets
Headers show
Series [ovs-dev,v2] vconn: Count vconn_sent regardless of log level. | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/intel-ovs-compilation fail test: fail

Commit Message

Cheng Li Jan. 6, 2024, 9:23 a.m. UTC
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 <lic121@chinatelecom.cn>
---

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

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

Comments

Eelco Chaudron Jan. 8, 2024, 9:37 a.m. UTC | #1
On 6 Jan 2024, at 10:23, Cheng Li wrote:

> 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 <lic121@chinatelecom.cn>

Thanks for catching and fixing this! The change looks good to me.

Acked-by: Eelco Chaudron <echaudro@redhat.com>
Ilya Maximets Jan. 9, 2024, 12:08 p.m. UTC | #2
On 1/8/24 10:37, Eelco Chaudron wrote:
> 
> 
> On 6 Jan 2024, at 10:23, Cheng Li wrote:
> 
>> 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 <lic121@chinatelecom.cn>
> 
> Thanks for catching and fixing this! The change looks good to me.
> 
> Acked-by: Eelco Chaudron <echaudro@redhat.com>
> 


Thanks!  Applied and backported down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

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;
 }