From 958278aa2919d93061a5c484e40a5eaeb5344734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Rigault?= Date: Sat, 5 Aug 2023 13:12:15 +0200 Subject: [PATCH] connmgr: Count unsent async messages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). Acked-by: Simon Horman Signed-off-by: François Rigault Signed-off-by: Ilya Maximets --- ofproto/connmgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ofproto/connmgr.c b/ofproto/connmgr.c index 7b14cae7733..b092e9e04ef 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); } }