aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2021-10-22 10:46:39 +0000
committerMatthew Smith <mgsmith@netgate.com>2022-03-04 21:02:37 +0000
commit2286f937d9a805324a8e46ba5a17198c039ba91a (patch)
tree4277f0ffb08494efcef600d02c27975fe0a8d38c /src/plugins
parentf4795a9bd8f488c5d32f9b171aa1d195bb4b8186 (diff)
linux-cp: stop signaling read event on every notif
Type: improvement Currently, read event signal is sent on every notification message received and added in the queue. With this change, signal read event only when all currently available notification messages are received. Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: Ib86d189311ce01f50167e4e97feb99df0292ad96
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/linux-cp/lcp_nl.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/linux-cp/lcp_nl.c b/src/plugins/linux-cp/lcp_nl.c
index 02954c362cf..43f5319fc13 100644
--- a/src/plugins/linux-cp/lcp_nl.c
+++ b/src/plugins/linux-cp/lcp_nl.c
@@ -701,13 +701,6 @@ nl_route_cb (struct nl_msg *msg, void *arg)
msg_info->msg = msg;
nlmsg_get (msg);
- /* notify process node if netlink notification processing is active */
- if (nm->nl_status == NL_STATUS_NOTIF_PROC)
- {
- vlib_process_signal_event (vlib_get_main (), nl_route_process_node.index,
- NL_EVENT_READ, 0);
- }
-
return 0;
}
@@ -725,6 +718,15 @@ lcp_nl_drain_messages (void)
if (err != -NLE_AGAIN)
vlib_process_signal_event (vlib_get_main (), nl_route_process_node.index,
NL_EVENT_ERR, 0);
+ else
+ {
+ /* If netlink notification processing is active, signal process node
+ * there were notifications read
+ */
+ if (nm->nl_status == NL_STATUS_NOTIF_PROC)
+ vlib_process_signal_event (
+ vlib_get_main (), nl_route_process_node.index, NL_EVENT_READ, 0);
+ }
return err;
}