From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nbfkord-smmo02.seg.att.com (nbfkord-smmo02.seg.att.com [209.65.160.78]) by dpdk.org (Postfix) with ESMTP id 71AE24A59 for ; Tue, 29 Nov 2016 17:20:57 +0100 (CET) Received: from unknown [12.187.104.26] (EHLO nbfkord-smmo02.seg.att.com) by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with ESMTP id 9eaad385.2b92b5e82940.1895566.00-2451.4144461.nbfkord-smmo02.seg.att.com (envelope-from ); Tue, 29 Nov 2016 16:20:57 +0000 (UTC) X-MXL-Hash: 583daae910ed6da1-4c642afa38d15ab20110ef21211d0c2a78bedb5e Received: from unknown [12.187.104.26] by nbfkord-smmo02.seg.att.com(mxl_mta-7.2.4-7) with SMTP id 0eaad385.0.1895549.00-2371.4144422.nbfkord-smmo02.seg.att.com (envelope-from ); Tue, 29 Nov 2016 16:20:49 +0000 (UTC) X-MXL-Hash: 583daae15a66bea3-32569c5472f945114c1c9f6060b6b1981bb87fed Received: from ocex03.SolarFlarecom.com (10.20.40.36) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 29 Nov 2016 08:20:26 -0800 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25 via Frontend Transport; Tue, 29 Nov 2016 08:20:25 -0800 Received: from uklogin.uk.solarflarecom.com (uklogin.uk.solarflarecom.com [10.17.10.10]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uATGKOIF030041; Tue, 29 Nov 2016 16:20:24 GMT Received: from uklogin.uk.solarflarecom.com (localhost.localdomain [127.0.0.1]) by uklogin.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id uATGKM1t021233; Tue, 29 Nov 2016 16:20:24 GMT From: Andrew Rybchenko To: CC: Date: Tue, 29 Nov 2016 16:19:19 +0000 Message-ID: <1480436367-20749-48-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1480436367-20749-1-git-send-email-arybchenko@solarflare.com> References: <1479740470-6723-1-git-send-email-arybchenko@solarflare.com> <1480436367-20749-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-AnalysisOut: [v=2.1 cv=UI/baXry c=1 sm=1 tr=0 a=8BlWFWvVlq5taO8ncb8nKg==] X-AnalysisOut: [:17 a=L24OOQBejmoA:10 a=zRKbQ67AAAAA:8 a=nwE4TXcvwxVgDGoh4] X-AnalysisOut: [mMA:9 a=PA03WX8tBzeizutn5_OT:22] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [12.187.104.26] Subject: [dpdk-dev] [PATCH v2 47/55] net/sfc: validate Rx queue buffers setup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 16:20:58 -0000 Check that Rx mbuf pool, MTU and Rx scatter config are in sync. Reviewed-by: Andy Moreton Signed-off-by: Andrew Rybchenko --- doc/guides/nics/sfc_efx.rst | 10 ++++++++++ drivers/net/sfc/sfc_rx.c | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index 87b217f8..8145a6b 100644 --- a/doc/guides/nics/sfc_efx.rst +++ b/doc/guides/nics/sfc_efx.rst @@ -73,6 +73,16 @@ The features not yet supported include: - LRO +Limitations +----------- + +Due to requirements on receive buffer alignment and usage of the receive +buffer for the auxiliary packet information provided by the NIC up to +extra 269 (14 bytes prefix plus up to 255 bytes for end padding) bytes may be +required in the receive buffer. +It should be taken into account when mbuf pool for receive is created. + + Supported NICs -------------- diff --git a/drivers/net/sfc/sfc_rx.c b/drivers/net/sfc/sfc_rx.c index 0a37776..a6b9aea 100644 --- a/drivers/net/sfc/sfc_rx.c +++ b/drivers/net/sfc/sfc_rx.c @@ -172,6 +172,7 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, const struct rte_eth_rxconf *rx_conf, struct rte_mempool *mb_pool) { + const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); int rc; uint16_t buf_size; struct sfc_rxq_info *rxq_info; @@ -187,6 +188,19 @@ sfc_rx_qinit(struct sfc_adapter *sa, unsigned int sw_index, if (buf_size == 0) { sfc_err(sa, "RxQ %u mbuf pool object size is too small", sw_index); + rc = EINVAL; + goto fail_bad_conf; + } + + if ((buf_size < sa->port.pdu + encp->enc_rx_prefix_size) && + !sa->eth_dev->data->dev_conf.rxmode.enable_scatter) { + sfc_err(sa, "Rx scatter is disabled and RxQ %u mbuf pool " + "object size is too small", sw_index); + sfc_err(sa, "RxQ %u calculated Rx buffer size is %u vs " + "PDU size %u plus Rx prefix %u bytes", + sw_index, buf_size, (unsigned int)sa->port.pdu, + encp->enc_rx_prefix_size); + rc = EINVAL; goto fail_bad_conf; } -- 2.5.5