e1000e, igbvf: fix default message level
Subsystems (4)
PATCH 1/1 e1000e, igbvf: fix default message level
The intent here was to enable both NETIF_MSG_DRV and NETIF_MSG_PROBE messages, but in the original code only the NETIF_MSG_DRV bit was set.
NETIF_MSG_DRV and NETIF_MSG_PROBE are bits 0 and 1, they are not supposed to be used to do a shift. I think the confusion is because the msg_enable can also be controlled through ethtool which passes a bit number that is used to do a bit shift.
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
@@ -2649,7 +2649,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, adapter->flags = ei->flags; adapter->hw.back = adapter; adapter->hw.mac.type = ei->mac; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =NETIF_MSG_DRV |NETIF_MSG_PROBE ;/* PCI config space info */
drivers/net/ethernet/intel/e1000e/netdev.c +1 -1
@@ -6172,7 +6172,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, adapter->hw.adapter = adapter; adapter->hw.mac.type = ei->mac; adapter->max_hw_frame_size = ei->max_hw_frame_size; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =NETIF_MSG_DRV |NETIF_MSG_PROBE ; mmio_start =pci_resource_start (pdev,0 ); mmio_len =pci_resource_len (pdev,0 );
Quoted 10 lines · Dan Carpenter
The intent here was to enable both
NETIF_MSG_DRVandNETIF_MSG_PROBEmessages, but in the original code only theNETIF_MSG_DRVbit was set.
NETIF_MSG_DRVandNETIF_MSG_PROBEare bits 0 and 1, they are not supposed to be used to do a shift. I think the confusion is because themsg_enablecan also be controlled through ethtool which passes a bit
number that is used to do a bit shift.Signed-off-by Dan Carpenter <[email protected]>
Thanks Dan! I will add the patch to my queue.
Quoted 7 lines · Dan Carpenter
The intent here was to enable both
NETIF_MSG_DRVandNETIF_MSG_PROBEmessages, but in the original code only theNETIF_MSG_DRVbit was set.
NETIF_MSG_DRVandNETIF_MSG_PROBEare bits 0 and 1, they are not supposed to be used to do a shift. I think the confusion is because themsg_enablecan also be controlled through ethtool which passes a bit number that is used to do a bit shift.
[...]
No, the ethtool interface also uses a mask.
However netif_msg_init() is commonly used to initialise the msg_enable mask based on a module parameter that's a bit number.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
PATCH 1/1 intel: make wired ethernet driver message level consistent
In reply to Dan CarpenterDan Carpenter noticed that ixgbevf initial default was different than the rest. But the problem is broader than that, only one Intel driver (ixgb) was doing it right.
The convention for default debug level should be consistent among Intel drivers and follow established convention.
Compile tested only.
---
Supersedes patch from Dan Carpenter
drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +++-- drivers/net/ethernet/intel/e1000e/netdev.c | 7 ++++++- drivers/net/ethernet/intel/igb/igb_main.c | 7 ++++++- drivers/net/ethernet/intel/igbvf/netdev.c | 7 ++++++- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 ++++++- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 8 +++++++- 6 files changed, 34 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +3 -2
@@ -215,7 +215,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 NeMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -static int debug =NETIF_MSG_DRV |NETIF_MSG_PROBE ; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );
@@ -979,7 +980,7 @@ static int __devinit e1000_probe(struct adapter =netdev_priv (netdev); adapter->netdev = netdev; adapter->pdev = pdev; - adapter->msg_enable = (1 << debug) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT ); adapter->bars = bars; adapter->need_ioport = need_ioport;
drivers/net/ethernet/intel/e1000e/netdev.c +6 -1
@@ -60,6 +60,11 @@char e1000e_driver_name[] ="e1000e" ;const char e1000e_driver_version[] =DRV_VERSION ; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +static void e1000e_disable_aspm (struct pci_dev *pdev,u16 state);static const struct e1000_info *e1000_info_tbl[] = {
@@ -6175,7 +6180,7 @@ static int __devinit e1000_probe(struct adapter->hw.adapter = adapter; adapter->hw.mac.type = ei->mac; adapter->max_hw_frame_size = ei->max_hw_frame_size; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT ); mmio_start =pci_resource_start (pdev,0 ); mmio_len =pci_resource_len (pdev,0 );
drivers/net/ethernet/intel/igb/igb_main.c +6 -1
@@ -238,6 +238,11 @@ MODULE_DESCRIPTION("Intel(R) Gigabit EthMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); +#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +struct igb_reg_info {u32 ofs;char *name;
@@ -1882,7 +1887,7 @@ static int __devinit igb_probe(struct pc adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable =NETIF_MSG_DRV |NETIF_MSG_PROBE ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT ); mmio_start =pci_resource_start (pdev,0 ); mmio_len =pci_resource_len (pdev,0 );
drivers/net/ethernet/intel/igbvf/netdev.c +6 -1
@@ -55,6 +55,11 @@ static const char igbvf_driver_string[] static const char igbvf_copyright[] "Copyright (c) 2009 - 2012 Intel Corporation."; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +static int igbvf_poll (struct napi_struct *napi,int budget);static void igbvf_reset (struct igbvf_adapter *);static void igbvf_set_interrupt_capability (struct igbvf_adapter *);
@@ -2649,7 +2654,7 @@ static int __devinit igbvf_probe(struct adapter->flags = ei->flags; adapter->hw.back = adapter; adapter->hw.mac.type = ei->mac; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT );/* PCI config space info */
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +6 -1
@@ -136,6 +136,11 @@ module_param(allow_unsupported_sfp, uintMODULE_PARM_DESC (allow_unsupported_sfp,"Allow unsupported and untested SFP+ modules on 82599-based adapters" ); +#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +MODULE_AUTHOR ("Intel Corporation, <[email protected]>" );MODULE_DESCRIPTION ("Intel(R) 10 Gigabit PCI Express Network Driver" );MODULE_LICENSE ("GPL" );
@@ -7638,7 +7643,7 @@ static int __devinit ixgbe_probe(struct adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable = (1 <<DEFAULT_DEBUG_LEVEL_SHIFT ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT ); hw->hw_addr =ioremap (pci_resource_start (pdev,0 ),pci_resource_len (pdev,0 ));
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +7 -1
@@ -92,6 +92,12 @@ MODULE_LICENSE("GPL");MODULE_VERSION (DRV_VERSION );#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); + + +#define DEFAULT_DEBUG_LEVEL_SHIFT 3/* forward decls */ static void ixgbevf_set_itr_msix (struct ixgbevf_q_vector *q_vector);
@@ -3367,7 +3373,7 @@ static int __devinit ixgbevf_probe(struc adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable = (1 <<DEFAULT_DEBUG_LEVEL_SHIFT ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT );/* * call save state here in standalone driver because it relies on
Re: [PATCH] intel: make wired ethernet driver message level consistent
Quoted 6 lines · Stephen Hemminger
Dan Carpenter noticed that ixgbevf initial default was different than the rest. But the problem is broader than that, only one Intel driver (ixgb) was doing it right.
The convention for default debug level should be consistent among Intel drivers and follow established convention.
[...]
drivers/net/ethernet/intel/e1000/e1000_main.c MODULE_DESCRIPTION("Intel(R) PRO/1000 Ne · line 218
Quoted 8 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +1
-1@@ -215,7 +215,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 NeMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -static int debug =NETIF_MSG_DRV |NETIF_MSG_PROBE ; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3
Wonder if this should really be 2 (enable DRV and PROBE) or 3 (enable DRV, PROBE and LINK; equivalent to current behaviour)?
drivers/net/ethernet/intel/e1000/e1000_main.c static int __devinit e1000_probe(struct · line 983
Quoted 10 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +2
-1+static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );@@ -979,7 +980,7 @@ static int __devinit e1000_probe(struct adapter =netdev_priv (netdev); adapter->netdev = netdev; adapter->pdev = pdev; - adapter->msg_enable = (1 << debug) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT );
[...]
This works, but not the way you intended. The first parameter is supposed to be a module parameter with a default of -1. The second parameter is supposed to be the bitmask to use when that default is not overridden.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Re: [PATCH] intel: make wired ethernet driver message level consistent
Quoted 14 lines · On Sun, 11 Mar 2012 00:38:57 +0000 Ben Hutchings <[email protected]>…
Quoted 6 lines · Stephen Hemminger
Dan Carpenter noticed that ixgbevf initial default was different than the rest. But the problem is broader than that, only one Intel driver (ixgb) was doing it right.
The convention for default debug level should be consistent among Intel drivers and follow established convention.
[...]
Quoted 6 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +0
-0@@ -215,7 +215,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 NeMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION );
Quoted 5 lines
drivers/net/ethernet/intel/e1000/e1000_main.c MODULE_DESCRIPTION("Intel(R) PRO/1000 Ne · line 218
Quoted 2 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +1
-1-static int debug =NETIF_MSG_DRV |NETIF_MSG_PROBE ; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3Wonder if this should really be 2 (enable DRV and PROBE) or 3 (enable DRV, PROBE and LINK; equivalent to current behaviour)?
That is really up to intel, the link up/down is useful, but nuisance with lots of devices.
Quoted 12 lines
Quoted 10 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +2
-1+static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );@@ -979,7 +980,7 @@ static int __devinit e1000_probe(struct adapter =netdev_priv (netdev); adapter->netdev = netdev; adapter->pdev = pdev; - adapter->msg_enable = (1 << debug) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT );[...]
Quoted 4 lines
This works, but not the way you intended. The first parameter is supposed to be a module parameter with a default of -1. The second parameter is supposed to be the bitmask to use when that default is not overridden.
I'll fix that.
Re: [PATCH] intel: make wired ethernet driver message level consistent
Quoted 38 lines · Stephen Hemminger
Quoted 14 lines · On Sun, 11 Mar 2012 00:38:57 +0000 Ben Hutchings <[email protected]>…
Quoted 6 lines · Stephen Hemminger
Dan Carpenter noticed that ixgbevf initial default was different than the rest. But the problem is broader than that, only one Intel driver (ixgb) was doing it right.
The convention for default debug level should be consistent among Intel drivers and follow established convention.
[...]
Quoted 6 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +0
-0@@ -215,7 +215,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 NeMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION );Quoted 5 lines
drivers/net/ethernet/intel/e1000/e1000_main.c MODULE_DESCRIPTION("Intel(R) PRO/1000 Ne · line 218
Quoted 2 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +1
-1-static int debug =NETIF_MSG_DRV |NETIF_MSG_PROBE ; +#define DEFAULT_DEBUG_LEVEL_SHIFT 3Wonder if this should really be 2 (enable DRV and PROBE) or 3 (enable DRV, PROBE and LINK; equivalent to current behaviour)?
That is really up to intel, the link up/down is useful, but nuisance with lots of devices.
Quoted 12 lines
Quoted 10 lines
drivers/net/ethernet/intel/e1000/e1000_main.c +2
-1+static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );@@ -979,7 +980,7 @@ static int __devinit e1000_probe(struct adapter =netdev_priv (netdev); adapter->netdev = netdev; adapter->pdev = pdev; - adapter->msg_enable = (1 << debug) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT );[...]
Quoted 8 lines
Quoted 4 lines
This works, but not the way you intended. The first parameter is supposed to be a module parameter with a default of -1. The second parameter is supposed to be the bitmask to use when that default is not overridden.
I'll fix that.
Stephen, I await you updated patch with the fix, thanks!
PATCH 1/1 intel: make wired ethernet driver message level consistent (rev2)
Dan Carpenter noticed that ixgbevf initial default was different than the rest. But the problem is broader than that, only one Intel driver (ixgb) was doing it almost right.
The convention for default debug level should be consistent among Intel drivers and follow established convention.
Compile tested only.
---
rev2 - use msg mask for default as expected rather than shift
drivers/net/ethernet/intel/e1000/e1000_main.c | 5 +++-- drivers/net/ethernet/intel/e1000e/netdev.c | 7 ++++++- drivers/net/ethernet/intel/igb/igb_main.c | 7 ++++++- drivers/net/ethernet/intel/igbvf/netdev.c | 7 ++++++- drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +++--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++++++--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 7 +++++-- 7 files changed, 35 insertions(+), 13 deletions(-)
drivers/net/ethernet/intel/e1000/e1000_main.c +3 -2
@@ -215,7 +215,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/1000 NeMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -static int debug =NETIF_MSG_DRV |NETIF_MSG_PROBE ; +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );
@@ -979,7 +980,7 @@ static int __devinit e1000_probe(struct adapter =netdev_priv (netdev); adapter->netdev = netdev; adapter->pdev = pdev; - adapter->msg_enable = (1 << debug) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE ); adapter->bars = bars; adapter->need_ioport = need_ioport;
drivers/net/ethernet/intel/e1000e/netdev.c +6 -1
@@ -60,6 +60,11 @@char e1000e_driver_name[] ="e1000e" ;const char e1000e_driver_version[] =DRV_VERSION ; +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +static void e1000e_disable_aspm (struct pci_dev *pdev,u16 state);static const struct e1000_info *e1000_info_tbl[] = {
@@ -6175,7 +6180,7 @@ static int __devinit e1000_probe(struct adapter->hw.adapter = adapter; adapter->hw.mac.type = ei->mac; adapter->max_hw_frame_size = ei->max_hw_frame_size; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE ); mmio_start =pci_resource_start (pdev,0 ); mmio_len =pci_resource_len (pdev,0 );
drivers/net/ethernet/intel/igb/igb_main.c +6 -1
@@ -238,6 +238,11 @@ MODULE_DESCRIPTION("Intel(R) Gigabit EthMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +struct igb_reg_info {u32 ofs;char *name;
@@ -1882,7 +1887,7 @@ static int __devinit igb_probe(struct pc adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable =NETIF_MSG_DRV |NETIF_MSG_PROBE ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE ); mmio_start =pci_resource_start (pdev,0 ); mmio_len =pci_resource_len (pdev,0 );
drivers/net/ethernet/intel/igbvf/netdev.c +6 -1
@@ -55,6 +55,11 @@ static const char igbvf_driver_string[]static const char igbvf_copyright[] ="Copyright (c) 2009 - 2012 Intel Corporation." ; +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +static int igbvf_poll (struct napi_struct *napi,int budget);static void igbvf_reset (struct igbvf_adapter *);static void igbvf_set_interrupt_capability (struct igbvf_adapter *);
@@ -2649,7 +2654,7 @@ static int __devinit igbvf_probe(struct adapter->flags = ei->flags; adapter->hw.back = adapter; adapter->hw.mac.type = ei->mac; - adapter->msg_enable = (1 <<NETIF_MSG_DRV |NETIF_MSG_PROBE ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE );/* PCI config space info */
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +6 -3
@@ -136,13 +136,16 @@ module_param(allow_unsupported_sfp, uintMODULE_PARM_DESC (allow_unsupported_sfp,"Allow unsupported and untested SFP+ modules on 82599-based adapters" ); +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" ); +MODULE_AUTHOR ("Intel Corporation, <[email protected]>" );MODULE_DESCRIPTION ("Intel(R) 10 Gigabit PCI Express Network Driver" );MODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -#define DEFAULT_DEBUG_LEVEL_SHIFT 3 -static void ixgbe_service_event_schedule (struct ixgbe_adapter *adapter) { if (!test_bit(__IXGBE_DOWN, &adapter->state) &&
@@ -7638,7 +7641,7 @@ static int __devinit ixgbe_probe(struct adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable = (1 <<DEFAULT_DEBUG_LEVEL_SHIFT ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE ); hw->hw_addr =ioremap (pci_resource_start (pdev,0 ),pci_resource_len (pdev,0 ));
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +5 -2
@@ -91,7 +91,10 @@ MODULE_DESCRIPTION("Intel(R) 82599 VirtuMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -#define DEFAULT_DEBUG_LEVEL_SHIFT 3 +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ; +module_param (debug, int,0 ); +MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );/* forward decls */ static void ixgbevf_set_itr_msix (struct ixgbevf_q_vector *q_vector);
@@ -3367,7 +3370,7 @@ static int __devinit ixgbevf_probe(struc adapter->pdev = pdev; hw = &adapter->hw; hw->back = adapter; - adapter->msg_enable = (1 <<DEFAULT_DEBUG_LEVEL_SHIFT ) -1 ; + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE );/* * call save state here in standalone driver because it relies on
drivers/net/ethernet/intel/ixgb/ixgb_main.c +3 -3
@@ -134,8 +134,8 @@ MODULE_DESCRIPTION("Intel(R) PRO/10GbE NMODULE_LICENSE ("GPL" );MODULE_VERSION (DRV_VERSION ); -#define DEFAULT_DEBUG_LEVEL_SHIFT 3 -static int debug =DEFAULT_DEBUG_LEVEL_SHIFT ; +#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV|NETIF_MSG_PROBE|NETIF_MSG_LINK) +static int debug =-1 ;module_param (debug, int,0 );MODULE_PARM_DESC (debug,"Debug level (0=none,...,16=all)" );
@@ -442,7 +442,7 @@ ixgb_probe(struct pci_dev *pdev, const s adapter->netdev = netdev; adapter->pdev = pdev; adapter->hw.back = adapter; - adapter->msg_enable =netif_msg_init (debug,DEFAULT_DEBUG_LEVEL_SHIFT ); + adapter->msg_enable =netif_msg_init (debug,DEFAULT_MSG_ENABLE ); adapter->hw.hw_addr =pci_ioremap_bar (pdev,BAR_0 );if (!adapter->hw.hw_addr) {