netlink: add "netlink" to the list of kernel features

Reduce the amount of debug messages on module init/detach.

MFC after:	1 week
This commit is contained in:
Alexander V. Chernikov 2023-01-30 11:13:51 +00:00
parent ee49c5d33d
commit 7fc9cfa57c
2 changed files with 6 additions and 6 deletions

View File

@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#include <machine/atomic.h>
MALLOC_DEFINE(M_NETLINK, "netlink", "Memory used for netlink packets");
FEATURE(netlink, "Netlink support");
#define DEBUG_MOD_NAME nl_mod
#define DEBUG_MAX_LEVEL LOG_DEBUG3
@ -156,7 +157,7 @@ netlink_register_proto(int proto, const char *proto_name, nl_handler_f handler)
nl_handlers[proto].cb = handler;
nl_handlers[proto].proto_name = proto_name;
NL_GLOBAL_UNLOCK();
NL_LOG(LOG_DEBUG, "Registered netlink %s(%d) handler", proto_name, proto);
NL_LOG(LOG_DEBUG2, "Registered netlink %s(%d) handler", proto_name, proto);
return (true);
}
@ -170,7 +171,7 @@ netlink_unregister_proto(int proto)
nl_handlers[proto].cb = NULL;
nl_handlers[proto].proto_name = NULL;
NL_GLOBAL_UNLOCK();
NL_LOG(LOG_DEBUG, "Unregistered netlink proto %d handler", proto);
NL_LOG(LOG_DEBUG2, "Unregistered netlink proto %d handler", proto);
return (true);
}
@ -203,12 +204,11 @@ netlink_modevent(module_t mod __unused, int what, void *priv __unused)
switch (what) {
case MOD_LOAD:
NL_LOG(LOG_DEBUG, "Loading");
NL_LOG(LOG_NOTICE, "netlink support is in BETA stage");
NL_LOG(LOG_DEBUG2, "Loading");
break;
case MOD_UNLOAD:
NL_LOG(LOG_DEBUG, "Unload called");
NL_LOG(LOG_DEBUG2, "Unload called");
if (can_unload()) {
NL_LOG(LOG_WARNING, "unloading");
netlink_unloading = 1;

View File

@ -115,7 +115,7 @@ static struct rtbridge *nlbridge_orig_p;
static void
rtnl_load(void *u __unused)
{
NL_LOG(LOG_NOTICE, "rtnl loading");
NL_LOG(LOG_DEBUG2, "rtnl loading");
nlbridge_orig_p = netlink_callback_p;
netlink_callback_p = &nlbridge;
rtnl_neighs_init();