From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 43BFF1C819 for ; Fri, 11 May 2018 18:26:12 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (webmail.solarflare.com [12.187.104.26]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us4.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 00210280075; Fri, 11 May 2018 16:26:10 +0000 (UTC) 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; Fri, 11 May 2018 09:26:00 -0700 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; Fri, 11 May 2018 09:26:00 -0700 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 w4BGPx1Y027511; Fri, 11 May 2018 17:25:59 +0100 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 w4BGPxWM014063; Fri, 11 May 2018 17:25:59 +0100 From: Andrew Rybchenko To: CC: Ferruh Yigit , Thomas Monjalon , Shahaf Shuler , Wei Dai Date: Fri, 11 May 2018 17:25:53 +0100 Message-ID: <1526055955-14027-2-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1526055955-14027-1-git-send-email-arybchenko@solarflare.com> References: <1526055955-14027-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-MDID: 1526055971-tt2HJc36sdrQ Subject: [dpdk-dev] [PATCH 1/3] ethdev: fail configure if requested offload is not supported 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: , X-List-Received-Date: Fri, 11 May 2018 16:26:12 -0000 Do not allow allow unsupported offload to be passed to PMD since in can result in inconsistent NIC configuration and processing in the driver. All PMDs are converted to the new offload API and must report its capabilties correctly. Both device and queue offloads are listed in [rt]x_offload_capa so the check should pass despite of which level the offload is supported on. Fixes: d04dd6d4ed67 ("ethdev: new Rx/Tx offloads API") Signed-off-by: Andrew Rybchenko --- lib/librte_ethdev/rte_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 3ddf3accb..dd36e6270 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1171,6 +1171,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, local_conf.rxmode.offloads, dev_info.rx_offload_capa, __func__); + return -EINVAL; } if ((local_conf.txmode.offloads & dev_info.tx_offload_capa) != local_conf.txmode.offloads) { @@ -1181,6 +1182,7 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, local_conf.txmode.offloads, dev_info.tx_offload_capa, __func__); + return -EINVAL; } /* Check that device supports requested rss hash functions. */ -- 2.17.0