From patchwork Tue Jun 2 10:39:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shradha Shah X-Patchwork-Id: 479386 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 69469140E1A for ; Tue, 2 Jun 2015 20:40:12 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758806AbbFBKkH (ORCPT ); Tue, 2 Jun 2015 06:40:07 -0400 Received: from nbfkord-smmo02.seg.att.com ([209.65.160.78]:47527 "EHLO nbfkord-smmo02.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755651AbbFBKkD (ORCPT ); Tue, 2 Jun 2015 06:40:03 -0400 Received: from unknown [12.187.104.25] (EHLO webmail.solarflare.com) by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-5) with ESMTP id 2088d655.2b29caa50940.734205.00-2482.4759734.nbfkord-smmo02.seg.att.com (envelope-from ); Tue, 02 Jun 2015 10:40:02 +0000 (UTC) X-MXL-Hash: 556d880246af9450-892d2aac1b8141cc6b9b999035898cad397930e2 Received: from unknown [12.187.104.25] (EHLO webmail.solarflare.com) by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-5) over TLS secured channel with ESMTP id 9f78d655.0.734196.00-2380.4759668.nbfkord-smmo02.seg.att.com (envelope-from ); Tue, 02 Jun 2015 10:39:55 +0000 (UTC) X-MXL-Hash: 556d87fb4480de25-372001763032fbc2fb746bda5da02a6021f6d83e Received: from sshah-desktop.uk.level5networks.com (10.17.20.135) by webmail.SolarFlare.com (10.20.40.31) with Microsoft SMTP Server (TLS) id 14.3.158.1; Tue, 2 Jun 2015 03:39:52 -0700 Message-ID: <556D87F5.3010406@solarflare.com> Date: Tue, 2 Jun 2015 11:39:49 +0100 From: Shradha Shah User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: David Miller CC: , Subject: [PATCH net-next v3 10/15] sfc: suppress ENOENT error messages from MC_CMD_MAC_STATS References: <556D8710.6060706@solarflare.com> In-Reply-To: <556D8710.6060706@solarflare.com> X-Originating-IP: [10.17.20.135] X-TM-AS-Product-Ver: SMEX-10.0.0.1412-7.000.1014-21582.004 X-TM-AS-Result: No--10.616100-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-AnalysisOut: [v=2.0 cv=DtHhDhD+ c=1 sm=1 a=MkjXnYnS3dyNWGSWLXxFFQ==:17 a] X-AnalysisOut: [=5ZTteq0x3j8A:10 a=3VnyBeAh6Z0A:10 a=BLceEmwcHowA:10 a=N65] X-AnalysisOut: [9UExz7-8A:10 a=zRKbQ67AAAAA:8 a=XAFQembCKUMA:10 a=drpRHqGL] X-AnalysisOut: [EccfaTmG6K4A:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2014051901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.25] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Daniel Pieczko MC_CMD_MAC_STATS can be called on a function before a vadaptor has been created, as the kernel can call into this through ndo_get_stats/ndo_get_stats64. If MC_CMD_MAC_STATS is called before the DMA queues have been setup, so that a vadaptor has not been created yet, firmware will return ENOENT. This is expected, so suppress the MCDI error message in this case. Signed-off-by: Shradha Shah --- drivers/net/ethernet/sfc/ef10.c | 11 ++++++++--- drivers/net/ethernet/sfc/mcdi_port.c | 8 ++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index b880d98..a79a24f 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -1316,11 +1316,16 @@ static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx) MCDI_SET_DWORD(inbuf, MAC_STATS_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); spin_unlock_bh(&efx->stats_lock); - rc = efx_mcdi_rpc(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), NULL, - 0, NULL); + rc = efx_mcdi_rpc_quiet(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), + NULL, 0, NULL); spin_lock_bh(&efx->stats_lock); - if (rc) + if (rc) { + /* Expect ENOENT if DMA queues have not been set up */ + if (rc != -ENOENT || atomic_read(&efx->active_queues)) + efx_mcdi_display_error(efx, MC_CMD_MAC_STATS, + sizeof(inbuf), NULL, 0, rc); goto out; + } generation_end = dma_stats[MC_CMD_MAC_GENERATION_END]; if (generation_end == EFX_MC_STATS_GENERATION_INVALID) { diff --git a/drivers/net/ethernet/sfc/mcdi_port.c b/drivers/net/ethernet/sfc/mcdi_port.c index fffc348..7f295c4 100644 --- a/drivers/net/ethernet/sfc/mcdi_port.c +++ b/drivers/net/ethernet/sfc/mcdi_port.c @@ -948,8 +948,12 @@ static int efx_mcdi_mac_stats(struct efx_nic *efx, MCDI_SET_DWORD(inbuf, MAC_STATS_IN_DMA_LEN, dma_len); MCDI_SET_DWORD(inbuf, MAC_STATS_IN_PORT_ID, nic_data->vport_id); - rc = efx_mcdi_rpc(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), - NULL, 0, NULL); + rc = efx_mcdi_rpc_quiet(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), + NULL, 0, NULL); + /* Expect ENOENT if DMA queues have not been set up */ + if (rc && (rc != -ENOENT || atomic_read(&efx->active_queues))) + efx_mcdi_display_error(efx, MC_CMD_MAC_STATS, sizeof(inbuf), + NULL, 0, rc); return rc; }