summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/mcdi.c
diff options
context:
space:
mode:
authorEdward Cree <ecree@solarflare.com>2015-05-27 14:14:01 +0200
committerDavid S. Miller <davem@davemloft.net>2015-05-27 19:54:51 +0200
commite7fef9b45ae188066bb6eb3dde8310d33c2f7d5e (patch)
treeda1beb9d41e358b394c2ebd6ae3a3f756b5ffeb4 /drivers/net/ethernet/sfc/mcdi.c
parentsfc: add tracing of MCDI commands (diff)
downloadlinux-e7fef9b45ae188066bb6eb3dde8310d33c2f7d5e.tar.xz
linux-e7fef9b45ae188066bb6eb3dde8310d33c2f7d5e.zip
sfc: add sysfs entry to control MCDI tracing
MCDI tracing is enabled per-function with a sysfs file /sys/class/net/<NET_DEV>/device/mcdi_logging Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/mcdi.c')
-rw-r--r--drivers/net/ethernet/sfc/mcdi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 31eda3255966..dde7f901e16c 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -188,7 +188,7 @@ static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd,
}
#ifdef CONFIG_SFC_MCDI_LOGGING
- if (!WARN_ON_ONCE(!buf)) {
+ if (mcdi->logging_enabled && !WARN_ON_ONCE(!buf)) {
int bytes = 0;
int i;
/* Lengths should always be a whole number of dwords, so scream
@@ -274,7 +274,7 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx)
}
#ifdef CONFIG_SFC_MCDI_LOGGING
- if (!WARN_ON_ONCE(!buf)) {
+ if (mcdi->logging_enabled && !WARN_ON_ONCE(!buf)) {
size_t hdr_len, data_len;
int bytes = 0;
int i;