Skip to content

Commit

Permalink
connmgr: Count unsent async messages.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: François Rigault <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
freedge authored and igsilya committed Aug 15, 2023
1 parent 68ff50a commit 958278a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ofproto/connmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1649,13 +1649,16 @@ 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
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);
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 958278a

Please sign in to comment.