> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf Of Paul 
> M Stillwell Jr
> Sent: Wednesday, December 13, 2023 10:37 AM
> To: [email protected]
> Cc: Stillwell Jr, Paul M <[email protected]>
> Subject: [Intel-wired-lan] [PATCH net-next v21 2/5] ice: configure FW logging
>
> Users want the ability to debug FW issues by retrieving the
> FW logs from the E8xx devices. Use debugfs to allow the user to
> configure the log level and number of messages for FW logging.
>
> If FW logging is supported on the E8xx then the file 'fwlog' will be
> created under the PCI device ID for the ice driver. If the file does not
> exist then either the E8xx doesn't support FW logging or debugfs is not
> enabled on the system.
>
> One thing users want to do is control which events are reported. The
> user can read and write the 'fwlog/modules/<module name>' to get/set
> the log levels. Each module in the FW that supports logging ht as a file
> under 'fwlog/modules' that supports reading (to see what the current log
> level is) and writing (to change the log level).
>
> The format to set the log levels for a module are:
>
>   # echo <log level> > 
> /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/<module>
>
> The supported log levels are:
>
>       *       none
>       *       error
>       *       warning
>       *       normal
>       *       verbose
>
> Each level includes the messages from the previous/lower level
>
> The modules that are supported are:
>
>       *       general
>       *       ctrl
>       *       link
>       *       link_topo
>       *       dnl
>       *       i2c
>       *       sdp
>       *       mdio
>       *       adminq
>       *       hdma
>       *       lldp
>       *       dcbx
>       *       dcb
>       *       xlr
>       *       nvm
>       *       auth
>       *       vpd
>       *       iosf
>       *       parser
>       *       sw
>       *       scheduler
>       *       txq
>       *       rsvd
>       *       post
>       *       watchdog
>       *       task_dispatch
>       *       mng
>       *       synce
>       *       health
>       *       tsdrv
>       *       pfreg
>       *       mdlver
>       *       all
>
> The module 'all' is a special module which allows the user to read or
> write to all of the modules.
> 
> The following example command would set the DCB module to the 'normal'
> log level:
>
>   # echo normal > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
>
> If the user wants to set the DCB, Link, and the AdminQ modules to
> 'verbose' then the commands are:
>
>   # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
>   # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
>   # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/adminq
>
> If the user wants to set all modules to the 'warning' level then the
> command is:
>
>   # echo warning > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
>
> If the user wants to disable logging for a module then they can set the
> level to 'none'. An example setting the 'watchdog' module is:
>
>   # echo none > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/watchdog
>
> If the user wants to see what the log level is for a specific module
> then the command is:
>
>   # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
>
> This will return the log level for the DCB module. If the user wants to
> see the log level for all the modules then the command is:
>
>   # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
>
> Writing to the module file will update the configuration, but NOT enable the
> configuration (that is a separate command).
>
> In addition to configuring the modules, the user can also configure the
> number of log messages (nr_messages) to include in a single Admin Receive
> Queue (ARQ) event.The range is 1-128 (1 means push every log message, 128
> means push only when the max AQ command buffer is full). The suggested
> value is 10.
>
> To see/change the resolution the user can read/write the
> 'fwlog/nr_messages' file. An example changing the value to 50 is
>
>   # echo 50 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
>
> To see the current value of 'nr_messages' then the command is:
>
>   # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
>
> Signed-off-by: Paul M Stillwell Jr <[email protected]>
> ---
>  drivers/net/ethernet/intel/ice/Makefile       |   4 +-
>  drivers/net/ethernet/intel/ice/ice.h          |   9 +
>  .../net/ethernet/intel/ice/ice_adminq_cmd.h   |  80 ++++
>  drivers/net/ethernet/intel/ice/ice_common.c   |   6 +
>  drivers/net/ethernet/intel/ice/ice_debugfs.c  | 359 ++++++++++++++++++
>  drivers/net/ethernet/intel/ice/ice_fwlog.c    | 261 +++++++++++++
>  drivers/net/ethernet/intel/ice/ice_fwlog.h    |  56 +++
>  drivers/net/ethernet/intel/ice/ice_main.c     |  18 +
>  drivers/net/ethernet/intel/ice/ice_type.h     |   4 +
>  9 files changed, 796 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/net/ethernet/intel/ice/ice_debugfs.c
>  create mode 100644 drivers/net/ethernet/intel/ice/ice_fwlog.c
>  create mode 100644 drivers/net/ethernet/intel/ice/ice_fwlog.h
>

Tested-by: Pucha Himasekhar Reddy <[email protected]> (A 
Contingent worker at Intel)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Reply via email to