core: disable tc cache by default

We no longer use tc objects from the platform cache; disable caching
by default.

The only exception where the cache is needed is in tc tests, as we
look into the platform there to check that objects look as expected.
This commit is contained in:
Beniamino Galvani 2021-09-17 17:48:35 +02:00
parent 864e4e6369
commit d50c4eba9e
4 changed files with 11 additions and 2 deletions

View file

@ -1708,6 +1708,12 @@ nm_platform_get()
void
nm_linux_platform_setup(void)
{
nm_platform_setup(nm_linux_platform_new(FALSE, FALSE, FALSE));
}
void
nm_linux_platform_setup_with_tc_cache(void)
{
nm_platform_setup(nm_linux_platform_new(FALSE, FALSE, TRUE));
}

View file

@ -277,6 +277,7 @@ NMPlatform *nm_platform_get(void);
#define NM_PLATFORM_GET (nm_platform_get())
void nm_linux_platform_setup(void);
void nm_linux_platform_setup_with_tc_cache(void);
/*****************************************************************************/

View file

@ -37,7 +37,9 @@ gboolean
nmtstp_is_root_test(void)
{
g_assert(_nmtstp_setup_platform_func);
return _nmtstp_setup_platform_func == nm_linux_platform_setup;
return NM_IN_SET(_nmtstp_setup_platform_func,
nm_linux_platform_setup,
nm_linux_platform_setup_with_tc_cache);
}
gboolean

View file

@ -202,7 +202,7 @@ test_qdisc_tbf(void)
/*****************************************************************************/
NMTstpSetupFunc const _nmtstp_setup_platform_func = nm_linux_platform_setup;
NMTstpSetupFunc const _nmtstp_setup_platform_func = nm_linux_platform_setup_with_tc_cache;
void
_nmtstp_init_tests(int *argc, char ***argv)