summaryrefslogtreecommitdiffstats
path: root/src/plugins/linux-cp/lcp_nl.h
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2021-10-20 12:15:43 +0000
committerMatthew Smith <mgsmith@netgate.com>2022-03-03 17:04:59 +0000
commit3819205bdb5ac0217b54f074d7645efa5356b561 (patch)
tree343041f13b424f0c4902fe4f59a62ce935e1f720 /src/plugins/linux-cp/lcp_nl.h
parent758ec1371860929f9a4021ec7b22766d33303e83 (diff)
linux-cp: resync with kernel after nl socket error
Type: improvement Currently, if an error happens on the netlink notification socket, the socket gets reopened. A portion of notification messages have been lost because of this and will never arrive on the socket. VPP will be out of sync with the kernel networking state. With this change, synchronize VPP state and the kernel networking state if there was an error polling or reading the notification socket. Signed-off-by: Alexander Chernavin <achernavin@netgate.com> Change-Id: I8cdff89b505cd227535a0acaadb6ee757204c45e
Diffstat (limited to 'src/plugins/linux-cp/lcp_nl.h')
-rw-r--r--src/plugins/linux-cp/lcp_nl.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/plugins/linux-cp/lcp_nl.h b/src/plugins/linux-cp/lcp_nl.h
index 0016da7bbad..7b2fccc29cd 100644
--- a/src/plugins/linux-cp/lcp_nl.h
+++ b/src/plugins/linux-cp/lcp_nl.h
@@ -21,9 +21,13 @@
#include <netlink/route/addr.h>
typedef void (*nl_rt_link_cb_t) (struct rtnl_link *rl, void *ctx);
+typedef void (*nl_rt_link_sync_cb_t) (void);
typedef void (*nl_rt_addr_cb_t) (struct rtnl_addr *ra);
+typedef void (*nl_rt_addr_sync_cb_t) (void);
typedef void (*nl_rt_neigh_cb_t) (struct rtnl_neigh *rr);
+typedef void (*nl_rt_neigh_sync_cb_t) (void);
typedef void (*nl_rt_route_cb_t) (struct rtnl_route *rn);
+typedef void (*nl_rt_route_sync_cb_t) (void);
#define NL_RT_COMMON uword is_mp_safe
@@ -34,6 +38,13 @@ typedef struct nl_rt_link_t_
nl_rt_link_cb_t cb;
} nl_rt_link_t;
+typedef struct nl_rt_link_sync_t_
+{
+ NL_RT_COMMON;
+
+ nl_rt_link_sync_cb_t cb;
+} nl_rt_link_sync_t;
+
typedef struct nl_rt_addr_t_
{
NL_RT_COMMON;
@@ -41,6 +52,13 @@ typedef struct nl_rt_addr_t_
nl_rt_addr_cb_t cb;
} nl_rt_addr_t;
+typedef struct nl_rt_addr_sync_t_
+{
+ NL_RT_COMMON;
+
+ nl_rt_addr_sync_cb_t cb;
+} nl_rt_addr_sync_t;
+
typedef struct nl_rt_neigh_t_
{
NL_RT_COMMON;
@@ -48,6 +66,13 @@ typedef struct nl_rt_neigh_t_
nl_rt_neigh_cb_t cb;
} nl_rt_neigh_t;
+typedef struct nl_rt_neigh_sync_t_
+{
+ NL_RT_COMMON;
+
+ nl_rt_neigh_sync_cb_t cb;
+} nl_rt_neigh_sync_t;
+
typedef struct nl_rt_route_t_
{
NL_RT_COMMON;
@@ -55,18 +80,33 @@ typedef struct nl_rt_route_t_
nl_rt_route_cb_t cb;
} nl_rt_route_t;
+typedef struct nl_rt_route_sync_t_
+{
+ NL_RT_COMMON;
+
+ nl_rt_route_sync_cb_t cb;
+} nl_rt_route_sync_t;
+
#undef NL_RT_COMMON
typedef struct nl_vft_t_
{
nl_rt_link_t nvl_rt_link_add;
nl_rt_link_t nvl_rt_link_del;
+ nl_rt_link_sync_t nvl_rt_link_sync_begin;
+ nl_rt_link_sync_t nvl_rt_link_sync_end;
nl_rt_addr_t nvl_rt_addr_add;
nl_rt_addr_t nvl_rt_addr_del;
+ nl_rt_addr_sync_t nvl_rt_addr_sync_begin;
+ nl_rt_addr_sync_t nvl_rt_addr_sync_end;
nl_rt_neigh_t nvl_rt_neigh_add;
nl_rt_neigh_t nvl_rt_neigh_del;
+ nl_rt_neigh_sync_t nvl_rt_neigh_sync_begin;
+ nl_rt_neigh_sync_t nvl_rt_neigh_sync_end;
nl_rt_route_t nvl_rt_route_add;
nl_rt_route_t nvl_rt_route_del;
+ nl_rt_route_sync_t nvl_rt_route_sync_begin;
+ nl_rt_route_sync_t nvl_rt_route_sync_end;
} nl_vft_t;
extern void nl_register_vft (const nl_vft_t *nv);