]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i40e: Clean up handling of msglevel flags and debug parameter
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 30 Sep 2016 12:21:46 +0000 (08:21 -0400)
committerDhaval Giani <dhaval.giani@oracle.com>
Wed, 8 Mar 2017 00:40:29 +0000 (19:40 -0500)
commit3e44012c8137303153e7732e840214b41b0ebd05
tree1c7d8a6d06fc30e4a645a5756e2745f6cd9a3313
parentce805a646990896eed1607f9ac1e212641c9c79e
i40e: Clean up handling of msglevel flags and debug parameter

Orabug: 24568124

So the i40e driver had a really convoluted configuration for how to handle
the debug flags contained in msg_level.  Part of the issue is that the
driver has its own 32 bit mask that it was using to track a separate set of
debug features.  From what I can tell it was trying to use the upper 4 bits
to determine if the value was meant to represent a bit-mask or the numeric
value provided by debug level.

What this patch does is clean this up by compressing those 4 bits into bit
31, as a result we just have to perform a check against the value being
negative to determine if we are looking at a debug level (positive), or a
debug mask (negative).  The debug level will populate the msg_level, and
the debug mask will populate the debug_mask in the hardware struct.

I added similar logic for ethtool.  If the value being provided has bit 31
set we assume the value being provided is a debug mask, otherwise we assume
it is a msg_enable mask.  For displaying we only provide the msg_enable,
and if debug_mask is in use we will print it to the dmesg log.

Lastly I removed the debugfs interface.  It is redundant with what we
already have in ethtool and really doesn't belong anyway.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 5d4ca23e58f2db7c14b76070f31295244b6edb7b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c