From patchwork Mon Jun 1 13:00:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shradha Shah X-Patchwork-Id: 478999 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 18E68140E5E for ; Mon, 1 Jun 2015 23:00:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752987AbbFANAp (ORCPT ); Mon, 1 Jun 2015 09:00:45 -0400 Received: from nbfkord-smmo04.seg.att.com ([209.65.160.86]:2130 "EHLO nbfkord-smmo04.seg.att.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752825AbbFANAT (ORCPT ); Mon, 1 Jun 2015 09:00:19 -0400 Received: from unknown [12.187.104.25] (EHLO nbfkord-smmo04.seg.att.com) by nbfkord-smmo04.seg.att.com(mxl_mta-7.2.4-5) with ESMTP id 3675c655.2ad10623c940.4009925.00-2450.22764652.nbfkord-smmo04.seg.att.com (envelope-from ); Mon, 01 Jun 2015 13:00:19 +0000 (UTC) X-MXL-Hash: 556c57636290f90f-4a580fd479613b268177fae614693bffe51c252b Received: from unknown [12.187.104.25] by nbfkord-smmo04.seg.att.com(mxl_mta-7.2.4-5) with SMTP id 0675c655.0.4009914.00-1978.22764613.nbfkord-smmo04.seg.att.com (envelope-from ); Mon, 01 Jun 2015 13:00:17 +0000 (UTC) X-MXL-Hash: 556c576120ece365-babe57553495e3fbe591ff9732ae8c8554dc67a6 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; Mon, 1 Jun 2015 06:00:14 -0700 Message-ID: <556C575C.2040403@solarflare.com> Date: Mon, 1 Jun 2015 14:00:12 +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 v2 01/14] sfc: Add code to export port_num in netdev->dev_port References: <556C5704.4060901@solarflare.com> In-Reply-To: <556C5704.4060901@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--5.732600-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-AnalysisOut: [v=2.0 cv=I4vSsqcg 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=3iKkr_M_] X-AnalysisOut: [8-RKGw6SSVwA:9 a=pILNOxqGKmIA:10 a=FCwjqEuyInazssVn:21 a=I] X-AnalysisOut: [UKH_2kur1p1Hf-E:21] 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 In the case where we have multiple functions (PFs and VFs), this sysfs entry is useful to identify the physical port corresponding to the function we are interested in. Signed-off-by: Shradha Shah --- drivers/net/ethernet/sfc/ef10.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 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 a547ceb..dacf9f8 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -249,6 +249,7 @@ static int efx_ef10_get_mac_address_vf(struct efx_nic *efx, u8 *mac_address) static int efx_ef10_probe(struct efx_nic *efx) { struct efx_ef10_nic_data *nic_data; + struct net_device *net_dev = efx->net_dev; int i, rc; /* We can have one VI for each 8K region. However, until we @@ -326,6 +327,7 @@ static int efx_ef10_probe(struct efx_nic *efx) if (rc < 0) goto fail3; efx->port_num = rc; + net_dev->dev_port = rc; rc = efx->type->get_mac_address(efx, efx->net_dev->perm_addr); if (rc) @@ -334,6 +336,7 @@ static int efx_ef10_probe(struct efx_nic *efx) rc = efx_ef10_get_sysclk_freq(efx); if (rc < 0) goto fail3; + efx->timer_quantum_ns = 1536000 / rc; /* 1536 cycles */ /* Check whether firmware supports bug 35388 workaround. @@ -341,9 +344,9 @@ static int efx_ef10_probe(struct efx_nic *efx) * ask if it's already enabled */ rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG35388, true); - if (rc == 0) + if (rc == 0) { nic_data->workaround_35388 = true; - else if (rc == -EPERM) { + } else if (rc == -EPERM) { unsigned int enabled; rc = efx_mcdi_get_workarounds(efx, NULL, &enabled); @@ -351,9 +354,10 @@ static int efx_ef10_probe(struct efx_nic *efx) goto fail3; nic_data->workaround_35388 = enabled & MC_CMD_GET_WORKAROUNDS_OUT_BUG35388; - } - else if (rc != -ENOSYS && rc != -ENOENT) + } else if (rc != -ENOSYS && rc != -ENOENT) { goto fail3; + } + netif_dbg(efx, probe, efx->net_dev, "workaround for bug 35388 is %sabled\n", nic_data->workaround_35388 ? "en" : "dis");