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 E2172A04E1; Tue, 22 Sep 2020 10:51:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4FF821DAAB; Tue, 22 Sep 2020 10:50:39 +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 5987E1D6D4 for ; Tue, 22 Sep 2020 10:50:16 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.144]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 07F4520055 for ; Tue, 22 Sep 2020 08:50:16 +0000 (UTC) Received: from us4-mdac16-22.at1.mdlocal (unknown [10.110.49.204]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 07C66800A4 for ; Tue, 22 Sep 2020 08:50:16 +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 91D0A4004D for ; Tue, 22 Sep 2020 08:50:15 +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 5B79D4C0059 for ; Tue, 22 Sep 2020 08:50:15 +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 08M8o9BA004609 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 5EB931613BE for ; Tue, 22 Sep 2020 09:50:09 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 22 Sep 2020 09:49:03 +0100 Message-ID: <1600764594-14752-10-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-0.847100-8.000000-10 X-TMASE-MatchedRID: 1e4GURu5ZSkjdXbalIVNEnYZxYoZm58FmU/t0AE6+TLmWHHSYEnI8WpA q14Ss3bZ06c72oPCTYcWsp6eJb7A2xt/FEV6QNBCPwKTD1v8YV5MkOX0UoduuV9QIc+ez/4+VQU 8VbWsRfgy4FX81Fzie3DWq7ntlL+KOzpEi4NJ5xPJ1E/nrJFEDwRryDXHx6oX90btya4ycShxxy XDegSmwtBworJRpz+6EOifd957UvIZxRzC/w7oVMjz0VPUnBA1uqgVqRoQsiC8NrbzjPvzJxUCx /X5xkUniG1Tff1Qo1d0swqakwEXcATsy5Ctk/ajngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIcSqb xBgG0w5If/WxTqUl5WmZDG9VWb+AJmon39AneiVyn9i2B2Y2Mll6m5+gocjOZAPK6hI2Yoy6Kng aiopJexq3XxA0vCLSxeC+Jpt/jpsckqAQnqJUA6vLjyQveEhYEdOpeiiHeDfqJnMJKyS+5w== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.847100-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25674.003 X-MDID: 1600764616-4DuxN611kMXT Subject: [dpdk-dev] [PATCH 09/60] common/sfc_efx/base: move 14b prefix check out of 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" The function which gets capabilties from MC should simply fill in NIC configuration. Caller should decide if the configuration is supported or not. The change is required to prepare the function to be reused on Riverhead. Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/ef10_nic.c | 33 ++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/common/sfc_efx/base/ef10_nic.c b/drivers/common/sfc_efx/base/ef10_nic.c index 34fa45e8c1..bb5fd50eab 100644 --- a/drivers/common/sfc_efx/base/ef10_nic.c +++ b/drivers/common/sfc_efx/base/ef10_nic.c @@ -1062,15 +1062,11 @@ ef10_get_datapath_caps( (MCDI_OUT_DWORD((_req), GET_CAPABILITIES_V2_OUT_FLAGS2) & \ (1u << (MC_CMD_GET_CAPABILITIES_V2_OUT_ ## _flag ## _LBN)))) - /* - * Huntington RXDP firmware inserts a 0 or 14 byte prefix. - * We only support the 14 byte prefix here. - */ - if (CAP_FLAGS1(req, RX_PREFIX_LEN_14) == 0) { - rc = ENOTSUP; - goto fail4; - } - encp->enc_rx_prefix_size = 14; + /* Check if RXDP firmware inserts 14 byte prefix */ + if (CAP_FLAGS1(req, RX_PREFIX_LEN_14)) + encp->enc_rx_prefix_size = 14; + else + encp->enc_rx_prefix_size = 0; #if EFSYS_OPT_RX_SCALE /* Check if the firmware supports additional RSS modes */ @@ -1348,7 +1344,7 @@ ef10_get_datapath_caps( default: rc = EINVAL; - goto fail5; + goto fail4; } /* Port numbers cannot contribute to the hash value */ @@ -1397,11 +1393,9 @@ ef10_get_datapath_caps( return (0); #if EFSYS_OPT_RX_SCALE -fail5: - EFSYS_PROBE(fail5); -#endif /* EFSYS_OPT_RX_SCALE */ fail4: EFSYS_PROBE(fail4); +#endif /* EFSYS_OPT_RX_SCALE */ fail3: EFSYS_PROBE(fail3); fail2: @@ -1932,6 +1926,15 @@ ef10_nic_board_cfg( if ((rc = ef10_get_datapath_caps(enp)) != 0) goto fail8; + /* + * Huntington RXDP firmware inserts a 0 or 14 byte prefix. + * We only support the 14 byte prefix here. + */ + if (encp->enc_rx_prefix_size != 14) { + rc = ENOTSUP; + goto fail9; + } + /* Alignment for WPTR updates */ encp->enc_rx_push_align = EF10_RX_WPTR_ALIGN; @@ -1960,7 +1963,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 fail9; + goto fail10; /* Ignore error (cannot query vector limits from a VF). */ base = 0; @@ -1976,7 +1979,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 fail10; + goto fail11; encp->enc_privilege_mask = mask; if ((rc = ef10_set_workaround_bug26807(enp)) != 0) -- 2.17.1