diff mbox series

[ovs-dev] connmgr: Count unsent async messages.

Message ID CAMc2VtTaSd6jMUXVyTHk2SzQOkb9mi=PgbTEquGNeW4_Xi_Y3g@mail.gmail.com
State Accepted
Commit 77610902b5d0db708544e349cc3b1bb2b06f13c6
Headers show
Series [ovs-dev] connmgr: Count unsent async messages. | expand

Checks

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

Commit Message

Francois Aug. 5, 2023, 11:12 a.m. UTC
Add an additional coverage counter for the case where no controller is
available to receive a OFPT_PACKET_IN/NXT_PACKET_IN2 message and so the
message is not sent at all.

This should help investigate issues where controller actions are not
properly executed (for example an OVN reject ACL was supposed to be
executed but ovn-controller was not started and the client ended up timing
out).

Signed-off-by: François Rigault <frigo@amadeus.com>
---
 ofproto/connmgr.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Simon Horman Aug. 7, 2023, 12:21 p.m. UTC | #1
On Sat, Aug 05, 2023 at 01:12:15PM +0200, Francois wrote:
> Add an additional coverage counter for the case where no controller is
> available to receive a OFPT_PACKET_IN/NXT_PACKET_IN2 message and so the
> message is not sent at all.
> 
> This should help investigate issues where controller actions are not
> properly executed (for example an OVN reject ACL was supposed to be
> executed but ovn-controller was not started and the client ended up timing
> out).
> 
> Signed-off-by: François Rigault <frigo@amadeus.com>

Acked-by: Simon Horman <horms@ovn.org>
Ilya Maximets Aug. 15, 2023, 10:58 p.m. UTC | #2
On 8/7/23 14:21, Simon Horman wrote:
> On Sat, Aug 05, 2023 at 01:12:15PM +0200, Francois wrote:
>> Add an additional coverage counter for the case where no controller is
>> available to receive a OFPT_PACKET_IN/NXT_PACKET_IN2 message and so the
>> message is not sent at all.
>>
>> This should help investigate issues where controller actions are not
>> properly executed (for example an OVN reject ACL was supposed to be
>> executed but ovn-controller was not started and the client ended up timing
>> out).
>>
>> Signed-off-by: François Rigault <frigo@amadeus.com>
> 
> Acked-by: Simon Horman <horms@ovn.org>

Thanks, François and Simon!  Applied.

Since it's a very simple debugging-only change,
I also backported it down to 2.17.

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c
index 7b14cae..b092e9e 100644
--- a/ofproto/connmgr.c
+++ b/ofproto/connmgr.c
@@ -1649,6 +1649,8 @@  connmgr_send_table_status(struct connmgr *mgr,
     }
 }

+COVERAGE_DEFINE(connmgr_async_unsent);
+
 /* Given 'pin', sends an OFPT_PACKET_IN message to each OpenFlow controller as
  * necessary according to their individual configurations. */
 void
@@ -1656,6 +1658,7 @@  connmgr_send_async_msg(struct connmgr *mgr,
                        const struct ofproto_async_msg *am)
 {
     struct ofconn *ofconn;
+    bool sent = false;

     LIST_FOR_EACH (ofconn, connmgr_node, &mgr->conns) {
         enum ofputil_protocol protocol = ofconn_get_protocol(ofconn);
@@ -1677,6 +1680,11 @@  connmgr_send_async_msg(struct connmgr *mgr,
                       am->pin.up.base.flow_metadata.flow.in_port.ofp_port,
                       msg, &txq);
         do_send_packet_ins(ofconn, &txq);
+        sent = true;
+    }
+
+    if (!sent) {
+        COVERAGE_INC(connmgr_async_unsent);
     }
 }