From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 99967A04E1; Tue, 22 Sep 2020 10:51:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 980B61D91B; Tue, 22 Sep 2020 10:50:34 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 86F621D6E9 for ; Tue, 22 Sep 2020 10:50:15 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.150]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2A83120063 for ; Tue, 22 Sep 2020 08:50:15 +0000 (UTC) Received: from us4-mdac16-69.at1.mdlocal (unknown [10.110.50.186]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 27F71800A3 for ; Tue, 22 Sep 2020 08:50:15 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.8]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id BF86A10004F for ; Tue, 22 Sep 2020 08:50:14 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 827794C0059 for ; Tue, 22 Sep 2020 08:50:14 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 22 Sep 2020 09:50:09 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 22 Sep 2020 09:50:09 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 08M8o9ED004613 for ; Tue, 22 Sep 2020 09:50:09 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 6B5601613A9 for ; Tue, 22 Sep 2020 09:50:09 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 22 Sep 2020 09:49:04 +0100 Message-ID: <1600764594-14752-11-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> References: <1600764594-14752-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25674.003 X-TM-AS-Result: No-7.293400-8.000000-10 X-TMASE-MatchedRID: fASjJbTnm+HhqMon2KWg9MYv//yaWh0DzDHtVtmAaYrwJYZa/L83HeXf obWTj2nCpu8oJ7W6Qzc73+B0i2dxjdpsFVyqUNwXbBMSu4v05tNLXPA26IG0hA9BGny4aW9IJ7o vlkPXpS0CJK826czEZBDon3fee1LyE2Fn9cnI7pdH+PTjR9EWkjKx0awWOyc1GlfXMQvierc1pG BDbSwzIuW8u2FgK0WKt6dCQtb8q1FkJsQ3rBV4iIdlc1JaOB1TBGvINcfHqhc7OtcKFS0EBKEGK hm9baaNtLYTKXvwdBD6eNYcDxJcEID5PWrQnVeEmXzg0bB6zmD1mLEwgfqpIJsoi2XrUn/J6M+9 pHJMV8guGQkQ2SYJmSdET58jp62SVk57R0JkCPFooMBe7CNSdAdmgucK+tYct1JTiwc7lUZQ5p5 qfwp+zwbNd2jN64Xqaq1yCICbxa/jEqiYEqhz6S6NNT2NZLVnqha7fcVIKfrqvk9CHHb0NQbT7e VkE2ZC2rhEGiFuOiuny9fy0ieryw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.293400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600764615-yJcRDhZPoIBW Subject: [dpdk-dev] [PATCH 10/60] common/sfc_efx/base: remove PF count get from caps get X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" ef10_get_datapath_caps() should simply fill in NIC configuration based MC_CMD_GET_CAPABILITIES output. Number of PFs is a part of board configuration should be obtained in corresponding function. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_nic.c | 37 +++++++++++++------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c index bb5fd50eab..f7c4601819 100644 --- a/drivers/common/sfc_efx/base/ef10_nic.c +++ b/drivers/common/sfc_efx/base/ef10_nic.c @@ -1031,10 +1031,6 @@ ef10_get_datapath_caps( MC_CMD_GET_CAPABILITIES_V5_OUT_LEN); efx_rc_t rc; - if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) - goto fail1; - - req.emr_cmd = MC_CMD_GET_CAPABILITIES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; @@ -1045,12 +1041,12 @@ ef10_get_datapath_caps( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail1; } if (req.emr_out_length_used < MC_CMD_GET_CAPABILITIES_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail2; } #define CAP_FLAGS1(_req, _flag) \ @@ -1344,7 +1340,7 @@ ef10_get_datapath_caps( default: rc = EINVAL; - goto fail4; + goto fail3; } /* Port numbers cannot contribute to the hash value */ @@ -1393,11 +1389,9 @@ ef10_get_datapath_caps( return (0); #if EFSYS_OPT_RX_SCALE -fail4: - EFSYS_PROBE(fail4); -#endif /* EFSYS_OPT_RX_SCALE */ fail3: EFSYS_PROBE(fail3); +#endif /* EFSYS_OPT_RX_SCALE */ fail2: EFSYS_PROBE(fail2); fail1: @@ -1856,6 +1850,9 @@ ef10_nic_board_cfg( encp->enc_pf = pf; encp->enc_vf = vf; + if ((rc = ef10_mcdi_get_pf_count(enp, &encp->enc_hw_pf_count)) != 0) + goto fail4; + /* MAC address for this function */ if (EFX_PCI_FUNCTION_IS_PF(encp)) { rc = efx_mcdi_get_mac_address_pf(enp, mac_addr); @@ -1880,7 +1877,7 @@ ef10_nic_board_cfg( rc = efx_mcdi_get_mac_address_vf(enp, mac_addr); } if (rc != 0) - goto fail4; + goto fail5; EFX_MAC_ADDR_COPY(encp->enc_mac_addr, mac_addr); @@ -1891,7 +1888,7 @@ ef10_nic_board_cfg( if (rc == EACCES) board_type = 0; else - goto fail5; + goto fail6; } encp->enc_board_type = board_type; @@ -1899,7 +1896,7 @@ ef10_nic_board_cfg( /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ if ((rc = efx_mcdi_get_phy_cfg(enp)) != 0) - goto fail6; + goto fail7; /* * Firmware with support for *_FEC capability bits does not @@ -1918,13 +1915,13 @@ ef10_nic_board_cfg( /* Obtain the default PHY advertised capabilities */ if ((rc = ef10_phy_get_link(enp, &els)) != 0) - goto fail7; + goto fail8; epp->ep_default_adv_cap_mask = els.epls.epls_adv_cap_mask; epp->ep_adv_cap_mask = els.epls.epls_adv_cap_mask; /* Check capabilities of running datapath firmware */ if ((rc = ef10_get_datapath_caps(enp)) != 0) - goto fail8; + goto fail9; /* * Huntington RXDP firmware inserts a 0 or 14 byte prefix. @@ -1932,7 +1929,7 @@ ef10_nic_board_cfg( */ if (encp->enc_rx_prefix_size != 14) { rc = ENOTSUP; - goto fail9; + goto fail10; } /* Alignment for WPTR updates */ @@ -1963,7 +1960,7 @@ ef10_nic_board_cfg( /* Get interrupt vector limits */ if ((rc = efx_mcdi_get_vector_cfg(enp, &base, &nvec, NULL)) != 0) { if (EFX_PCI_FUNCTION_IS_PF(encp)) - goto fail10; + goto fail11; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -1979,7 +1976,7 @@ ef10_nic_board_cfg( * can result in time-of-check/time-of-use bugs. */ if ((rc = ef10_get_privilege_mask(enp, &mask)) != 0) - goto fail11; + goto fail12; encp->enc_privilege_mask = mask; if ((rc = ef10_set_workaround_bug26807(enp)) != 0) @@ -1988,10 +1985,12 @@ ef10_nic_board_cfg( /* Get remaining controller-specific board config */ if ((rc = enop->eno_board_cfg(enp)) != 0) if (rc != EACCES) - goto fail12; + goto fail13; return (0); +fail13: + EFSYS_PROBE(fail13); fail12: EFSYS_PROBE(fail12); fail11: -- 2.17.1