Re: [PATCH net-next v2 1/2] net: lan743x: add "message level" module parameter
From: Jacob Keller <jacob.e.keller@intel.com>
Date: 2026-05-27 20:36:03
Also in:
lkml
On 5/27/2026 11:18 AM, David Thompson wrote:
quoted hunk ↗ jump to hunk
The lan743x driver currently hardcodes the initial value of the msg_enable parameter during probe(), and uses this value for netdev message logging. Instead, the driver should provide a "message level" module parameter to allow users to configure the logging level at load time. Signed-off-by: David Thompson <davthompson@nvidia.com> --- v2: - new patch added in v2 --- drivers/net/ethernet/microchip/lan743x_main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c index f3332417162e..793633cced19 100644 --- a/drivers/net/ethernet/microchip/lan743x_main.c +++ b/drivers/net/ethernet/microchip/lan743x_main.c@@ -28,6 +28,17 @@ #define RFE_RD_FIFO_TH_3_DWORDS 0x3 +#define LAN743X_DEF_MSG_ENABLE \ + (NETIF_MSG_DRV | \ + NETIF_MSG_PROBE | \ + NETIF_MSG_LINK | \ + NETIF_MSG_IFUP | \ + NETIF_MSG_IFDOWN | \ + NETIF_MSG_TX_QUEUED) +static int lan743x_msg_enable = -1; +module_param(lan743x_msg_enable, int, 0); +MODULE_PARM_DESC(lan743x_msg_enable, "Debug message level"); +
I guess many drivers have msg_enable parameters already so this isn't "new", but the netdev maintainers have frowned on adding any module parameters for years. You could handle this by just always using the dynamic debug capability instead of the netdev msg_enable infrastructure, but the driver does already use this infrastructure heavily, so I guess it makes sense to expose it and allow changing the settings during early init prior to when the netdevice is available to userspace.. Since this is a relatively common module parameter and not something "new" or trying to do anything other than aid in debugging I suppose this is likely acceptable. Thanks, Jake
quoted hunk ↗ jump to hunk
static bool pci11x1x_is_a0(struct lan743x_adapter *adapter) { u32 dev_rev = adapter->csr.id_rev & ID_REV_CHIP_REV_MASK_;@@ -3661,9 +3672,7 @@ static int lan743x_pcidev_probe(struct pci_dev *pdev, pci_set_drvdata(pdev, netdev); adapter = netdev_priv(netdev); adapter->netdev = netdev; - adapter->msg_enable = NETIF_MSG_DRV | NETIF_MSG_PROBE | - NETIF_MSG_LINK | NETIF_MSG_IFUP | - NETIF_MSG_IFDOWN | NETIF_MSG_TX_QUEUED; + adapter->msg_enable = netif_msg_init(lan743x_msg_enable, LAN743X_DEF_MSG_ENABLE); netdev->max_mtu = LAN743X_MAX_FRAME_SIZE; of_get_mac_address(pdev->dev.of_node, adapter->mac_address);