Protect VPP -> Linux state propagation behind flag

Introduce lcp_main.lcp_sync, which determines if state changes made
to interfaces in VPP do or don't propagate into Linux.

- Add a startup.conf directive 'lcp-sync' to enable at startup time.
- Add CLI.short_help = "lcp lcp-sync [on|enable|off|disable]",
- Show the current value in "show lcp".

Gate changes in mtu, state and address on lcp_lcp_sync().

When the operator issues 'lcp lcp-sync on', it is prudent to do a
one-off sync of all interface attributes from VPP into Linux.
For this, add a lcp_itf_pair_sync_state_all() function.
This commit is contained in:
Pim van Pelt
2021-08-15 16:07:53 +02:00
parent d23aab2d95
commit 2d00de080b
6 changed files with 104 additions and 11 deletions

View File

@ -25,6 +25,7 @@ typedef struct lcp_main_s
u8 default_namespace[LCP_NS_LEN]; /* default namespace if set */
int default_ns_fd;
u8 lcp_auto_subint; /* Automatically create/delete LCP sub-interfaces */
u8 lcp_sync; /* Automatically sync VPP changes to LCP */
/* Set when Unit testing */
u8 test_mode;
} lcp_main_t;
@ -38,6 +39,11 @@ int lcp_set_default_ns(u8 *ns);
u8 *lcp_get_default_ns(void); /* Returns NULL or shared string */
int lcp_get_default_ns_fd(void);
/*
* Sync state from VPP into all LCP devices
*/
void lcp_itf_pair_sync_state_all ();
#endif
/*