All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
@ 2010-11-18 21:50 Sonny Rao
  2010-11-18 22:17 ` Ron Mercer
  0 siblings, 1 reply; 8+ messages in thread
From: Sonny Rao @ 2010-11-18 21:50 UTC (permalink / raw)
  To: netdev; +Cc: Milton Miller, Linux Driver, linux-kernel, Ron Mercer, sonnyrao

Driver appears to be mistaking the permission field with default value
in the case of debug and qlge_irq_type.

Driver is also passing debug as a bitmask into netif_msg_init()
which wants a number of bits.  Ron Mercer suggests we should
change this to pass in -1 so the defaults get used instead,
which makes the default much less verbose.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
---

v2: Changed debug to be -1 and updated changelog

 drivers/net/qlge/qlge_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index d9a7626..66878bb 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -62,15 +62,15 @@ static const u32 default_msg =
 /* NETIF_MSG_PKTDATA | */
     NETIF_MSG_HW | NETIF_MSG_WOL | 0;
 
-static int debug = 0x00007fff;	/* defaults above */
-module_param(debug, int, 0);
+static int debug = -1;	/* defaults above */
+module_param(debug, int, 0664);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
 
 #define MSIX_IRQ 0
 #define MSI_IRQ 1
 #define LEG_IRQ 2
 static int qlge_irq_type = MSIX_IRQ;
-module_param(qlge_irq_type, int, MSIX_IRQ);
+module_param(qlge_irq_type, int, 0664);
 MODULE_PARM_DESC(qlge_irq_type, "0 = MSI-X, 1 = MSI, 2 = Legacy.");
 
 static int qlge_mpi_coredump;

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
  2010-11-18 21:50 [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level Sonny Rao
@ 2010-11-18 22:17 ` Ron Mercer
  2010-11-18 23:12     ` Sonny Rao
  0 siblings, 1 reply; 8+ messages in thread
From: Ron Mercer @ 2010-11-18 22:17 UTC (permalink / raw)
  To: Sonny Rao; +Cc: netdev, Milton Miller, Linux Driver, linux-kernel, sonnyrao

On Thu, Nov 18, 2010 at 01:50:02PM -0800, Sonny Rao wrote:
> Driver appears to be mistaking the permission field with default value
> in the case of debug and qlge_irq_type.
> 
> Driver is also passing debug as a bitmask into netif_msg_init()
> which wants a number of bits.  Ron Mercer suggests we should
> change this to pass in -1 so the defaults get used instead,
> which makes the default much less verbose.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>
> Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>

Milton/Sonny,
Did you happen to test this to see if the log output was the same? 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
  2010-11-18 22:17 ` Ron Mercer
@ 2010-11-18 23:12     ` Sonny Rao
  0 siblings, 0 replies; 8+ messages in thread
From: Sonny Rao @ 2010-11-18 23:12 UTC (permalink / raw)
  To: ron.mercer, netdev, Milton Miller, Linux Driver, linux-kernel, sonnyrao

On Thu, Nov 18, 2010 at 02:17:14PM -0800, Ron Mercer wrote:
> On Thu, Nov 18, 2010 at 01:50:02PM -0800, Sonny Rao wrote:
> > Driver appears to be mistaking the permission field with default value
> > in the case of debug and qlge_irq_type.
> > 
> > Driver is also passing debug as a bitmask into netif_msg_init()
> > which wants a number of bits.  Ron Mercer suggests we should
> > change this to pass in -1 so the defaults get used instead,
> > which makes the default much less verbose.
> > 
> > Signed-off-by: Milton Miller <miltonm@bga.com>
> > Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
> 
> Milton/Sonny,
> Did you happen to test this to see if the log output was the same? 

Well, I haven't tried the -1 but I suspect it is much more sane than
the 15 I had before because that was excessively verbose and I always
ended up turning it down.  I'll try it out and see.

-- 
Sonny Rao, LTC OzLabs, BML team

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
@ 2010-11-18 23:12     ` Sonny Rao
  0 siblings, 0 replies; 8+ messages in thread
From: Sonny Rao @ 2010-11-18 23:12 UTC (permalink / raw)
  To: ron.mercer, netdev, Milton Miller, Linux Driver,
	linux-kernel@vger.kernel.org

On Thu, Nov 18, 2010 at 02:17:14PM -0800, Ron Mercer wrote:
> On Thu, Nov 18, 2010 at 01:50:02PM -0800, Sonny Rao wrote:
> > Driver appears to be mistaking the permission field with default value
> > in the case of debug and qlge_irq_type.
> > 
> > Driver is also passing debug as a bitmask into netif_msg_init()
> > which wants a number of bits.  Ron Mercer suggests we should
> > change this to pass in -1 so the defaults get used instead,
> > which makes the default much less verbose.
> > 
> > Signed-off-by: Milton Miller <miltonm@bga.com>
> > Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
> 
> Milton/Sonny,
> Did you happen to test this to see if the log output was the same? 

Well, I haven't tried the -1 but I suspect it is much more sane than
the 15 I had before because that was excessively verbose and I always
ended up turning it down.  I'll try it out and see.

-- 
Sonny Rao, LTC OzLabs, BML team

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
  2010-11-18 10:25 Sonny Rao
  2010-11-18 17:22 ` Ron Mercer
  2010-11-18 19:30 ` David Miller
@ 2010-11-22 16:29 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-11-22 16:29 UTC (permalink / raw)
  To: sonnyrao; +Cc: netdev, miltonm, ron.mercer, linux-driver, linux-kernel

From: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
Date: Thu, 18 Nov 2010 04:25:03 -0600

> Driver appears to be mistaking the permission field with default value
> in the case of debug and qlge_irq_type.
> 
> Driver is also passing debug as a bitmask into netif_msg_init()
> which really wants a number of bits, so fix that.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>
> Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>

Applied, thanks Sonny.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
  2010-11-18 10:25 Sonny Rao
  2010-11-18 17:22 ` Ron Mercer
@ 2010-11-18 19:30 ` David Miller
  2010-11-22 16:29 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-11-18 19:30 UTC (permalink / raw)
  To: sonnyrao; +Cc: netdev, miltonm, ron.mercer, linux-driver, linux-kernel


Sonny, something is serious wrong with your email setup.

The number of Received headers in your outgoing emails is
enormous and as a result a large percentage of the lists
subscribers bounced your posting because it looks like it
is looping.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
  2010-11-18 10:25 Sonny Rao
@ 2010-11-18 17:22 ` Ron Mercer
  2010-11-18 19:30 ` David Miller
  2010-11-22 16:29 ` David Miller
  2 siblings, 0 replies; 8+ messages in thread
From: Ron Mercer @ 2010-11-18 17:22 UTC (permalink / raw)
  To: Sonny Rao; +Cc: netdev, Milton Miller, Linux Driver, linux-kernel

On Thu, Nov 18, 2010 at 02:25:03AM -0800, Sonny Rao wrote:
> Driver appears to be mistaking the permission field with default value
> in the case of debug and qlge_irq_type.
> 
> Driver is also passing debug as a bitmask into netif_msg_init()
> which really wants a number of bits, so fix that.
> 
> Signed-off-by: Milton Miller <miltonm@bga.com>
> Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
> ---
>  drivers/net/qlge/qlge_main.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
> index d9a7626..66878bb 100644
> --- a/drivers/net/qlge/qlge_main.c
> +++ b/drivers/net/qlge/qlge_main.c
> @@ -62,15 +62,15 @@ static const u32 default_msg =
>  /* NETIF_MSG_PKTDATA | */
>      NETIF_MSG_HW | NETIF_MSG_WOL | 0;
>  
> -static int debug = 0x00007fff;	/* defaults above */
> -module_param(debug, int, 0);
> +static int debug = 15;	/* defaults above */


I think what we want here is:

> +static int debug = -1;	/* defaults above */

This will correct it and maintain the current behavior.
By passing in the 0x00007ffff we were getting the passed in default
paramter from the 2nd compare in the first if statement below. If we set
debug to 15 then it looks like we would turn on all bits rather than
qlge default.

static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
{
        /* use default */
        if (debug_value < 0 || debug_value >= (sizeof(u32) * 8))
                return default_msg_enable_bits;
        if (debug_value == 0)   /* no output */
                return 0;
        /* set low N bits */
        return (1 << debug_value) - 1;
}


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level
@ 2010-11-18 10:25 Sonny Rao
  2010-11-18 17:22 ` Ron Mercer
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sonny Rao @ 2010-11-18 10:25 UTC (permalink / raw)
  To: netdev; +Cc: Sonny Rao, Milton Miller, Ron Mercer, linux-driver, linux-kernel

Driver appears to be mistaking the permission field with default value
in the case of debug and qlge_irq_type.

Driver is also passing debug as a bitmask into netif_msg_init()
which really wants a number of bits, so fix that.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
---
 drivers/net/qlge/qlge_main.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index d9a7626..66878bb 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -62,15 +62,15 @@ static const u32 default_msg =
 /* NETIF_MSG_PKTDATA | */
     NETIF_MSG_HW | NETIF_MSG_WOL | 0;

-static int debug = 0x00007fff;	/* defaults above */
-module_param(debug, int, 0);
+static int debug = 15;	/* defaults above */
+module_param(debug, int, 0664);
 MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");

 #define MSIX_IRQ 0
 #define MSI_IRQ 1
 #define LEG_IRQ 2
 static int qlge_irq_type = MSIX_IRQ;
-module_param(qlge_irq_type, int, MSIX_IRQ);
+module_param(qlge_irq_type, int, 0664);
 MODULE_PARM_DESC(qlge_irq_type, "0 = MSI-X, 1 = MSI, 2 = Legacy.");

 static int qlge_mpi_coredump;
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-22 16:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 21:50 [PATCH] qlge: Fix incorrect usage of module parameters and netdev msg level Sonny Rao
2010-11-18 22:17 ` Ron Mercer
2010-11-18 23:12   ` Sonny Rao
2010-11-18 23:12     ` Sonny Rao
  -- strict thread matches above, loose matches on Subject: below --
2010-11-18 10:25 Sonny Rao
2010-11-18 17:22 ` Ron Mercer
2010-11-18 19:30 ` David Miller
2010-11-22 16:29 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.