drivers: fix log level after loading
authorThomas Monjalon <thomas@monjalon.net>
Tue, 6 Apr 2021 13:22:03 +0000 (15:22 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 8 Apr 2021 16:32:31 +0000 (18:32 +0200)
commit3be42081bae707c4ad53e62a01a4af82151b8019
treebb1ad65d73fe74cc674a662bb1be4e36098639a7
parent551b29a714b81733da31a9495aa0d8554448c83a
drivers: fix log level after loading

When compiled as a shared object, and loaded at runtime as a plugin,
the drivers should get the log level set earlier at EAL init
by the user through --log-level option.

The function for applying the log level setting is
rte_log_register_type_and_pick_level().
It is called by most drivers via RTE_LOG_REGISTER().

The drivers common/mlx5, bcmfs and e1000 were missing,
so the user-specified log level was not applied when
those drivers were loaded as plugins.
The macro RTE_LOG_REGISTER() is used for those drivers.

The unnecessary protection for double registration
is removed from e1000.

Fixes: 9c99878aa1b1 ("log: introduce logtype register macro")
Fixes: c8e79da7c676 ("crypto/bcmfs: introduce BCMFS driver")
Cc: stable@dpdk.org
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/common/mlx5/mlx5_common.c
drivers/crypto/bcmfs/bcmfs_logs.c
drivers/net/e1000/e1000_logs.c
drivers/net/e1000/em_ethdev.c
drivers/net/e1000/igb_ethdev.c