@@ -895,6 +895,147 @@ driver writes raw bytes by the GNSS object to the receiver through i2c. Please
895
895
refer to the hardware GNSS module documentation for configuration details.
896
896
897
897
898
+ Firmware (FW) logging
899
+ ---------------------
900
+ The driver supports FW logging via the debugfs interface on PF 0 only. The FW
901
+ running on the NIC must support FW logging; if the FW doesn't support FW logging
902
+ the 'fwlog' file will not get created in the ice debugfs directory.
903
+
904
+ Module configuration
905
+ ~~~~~~~~~~~~~~~~~~~~
906
+ Firmware logging is configured on a per module basis. Each module can be set to
907
+ a value independent of the other modules (unless the module 'all' is specified).
908
+ The modules will be instantiated under the 'fwlog/modules' directory.
909
+
910
+ The user can set the log level for a module by writing to the module file like
911
+ this::
912
+
913
+ # echo <log_level> > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/<module>
914
+
915
+ where
916
+
917
+ * log_level is a name as described below. Each level includes the
918
+ messages from the previous/lower level
919
+
920
+ * none
921
+ * error
922
+ * warning
923
+ * normal
924
+ * verbose
925
+
926
+ * module is a name that represents the module to receive events for. The
927
+ module names are
928
+
929
+ * general
930
+ * ctrl
931
+ * link
932
+ * link_topo
933
+ * dnl
934
+ * i2c
935
+ * sdp
936
+ * mdio
937
+ * adminq
938
+ * hdma
939
+ * lldp
940
+ * dcbx
941
+ * dcb
942
+ * xlr
943
+ * nvm
944
+ * auth
945
+ * vpd
946
+ * iosf
947
+ * parser
948
+ * sw
949
+ * scheduler
950
+ * txq
951
+ * rsvd
952
+ * post
953
+ * watchdog
954
+ * task_dispatch
955
+ * mng
956
+ * synce
957
+ * health
958
+ * tsdrv
959
+ * pfreg
960
+ * mdlver
961
+ * all
962
+
963
+ The name 'all' is special and allows the user to set all of the modules to the
964
+ specified log_level or to read the log_level of all of the modules.
965
+
966
+ Example usage to configure the modules
967
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
968
+
969
+ To set a single module to 'verbose'::
970
+
971
+ # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
972
+
973
+ To set multiple modules then issue the command multiple times::
974
+
975
+ # echo verbose > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/link
976
+ # echo warning > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/ctrl
977
+ # echo none > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/dcb
978
+
979
+ To set all the modules to the same value::
980
+
981
+ # echo normal > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
982
+
983
+ To read the log_level of a specific module (e.g. module 'general')::
984
+
985
+ # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/general
986
+
987
+ To read the log_level of all the modules::
988
+
989
+ # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/modules/all
990
+
991
+ Enabling FW log
992
+ ~~~~~~~~~~~~~~~
993
+ Configuring the modules indicates to the FW that the configured modules should
994
+ generate events that the driver is interested in, but it **does not ** send the
995
+ events to the driver until the enable message is sent to the FW. To do this
996
+ the user can write a 1 (enable) or 0 (disable) to 'fwlog/enable'. An example
997
+ is::
998
+
999
+ # echo 1 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/enable
1000
+
1001
+ Retrieving FW log data
1002
+ ~~~~~~~~~~~~~~~~~~~~~~
1003
+ The FW log data can be retrieved by reading from 'fwlog/data'. The user can
1004
+ write any value to 'fwlog/data' to clear the data. The data can only be cleared
1005
+ when FW logging is disabled. The FW log data is a binary file that is sent to
1006
+ Intel and used to help debug user issues.
1007
+
1008
+ An example to read the data is::
1009
+
1010
+ # cat /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/data > fwlog.bin
1011
+
1012
+ An example to clear the data is::
1013
+
1014
+ # echo 0 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/data
1015
+
1016
+ Changing how often the log events are sent to the driver
1017
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1018
+ The driver receives FW log data from the Admin Receive Queue (ARQ). The
1019
+ frequency that the FW sends the ARQ events can be configured by writing to
1020
+ 'fwlog/nr_messages'. The range is 1-128 (1 means push every log message, 128
1021
+ means push only when the max AQ command buffer is full). The suggested value is
1022
+ 10. The user can see what the value is configured to by reading
1023
+ 'fwlog/nr_messages'. An example to set the value is::
1024
+
1025
+ # echo 50 > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/nr_messages
1026
+
1027
+ Configuring the amount of memory used to store FW log data
1028
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1029
+ The driver stores FW log data within the driver. The default size of the memory
1030
+ used to store the data is 1MB. Some use cases may require more or less data so
1031
+ the user can change the amount of memory that is allocated for FW log data.
1032
+ To change the amount of memory then write to 'fwlog/log_size'. The value must be
1033
+ one of: 128K, 256K, 512K, 1M, or 2M. FW logging must be disabled to change the
1034
+ value. An example of changing the value is::
1035
+
1036
+ # echo 128K > /sys/kernel/debug/ice/0000\:18\:00.0/fwlog/log_size
1037
+
1038
+
898
1039
Performance Optimization
899
1040
========================
900
1041
Driver defaults are meant to fit a wide variety of workloads, but if further
0 commit comments