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 732A6271 for ; Sun, 9 Jul 2017 11:40:53 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id D34EB80053; Sun, 9 Jul 2017 09:40:52 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 3271480049; Sun, 9 Jul 2017 09:40:52 +0000 (UTC) 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-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id F3DE02006C; Sun, 9 Jul 2017 09:40:51 +0000 (UTC) Received: from [192.168.239.128] (85.187.13.33) by ocex03.SolarFlarecom.com (10.20.40.36) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Sun, 9 Jul 2017 02:40:42 -0700 To: Stephen Hemminger , Declan Doherty CC: , Sergio Gonzalez Monroy , Remy Horton , Jianfeng Tan , Ferruh Yigit , Yuanhan Liu , Maxime Coquelin , Konstantin Ananyev , Bruce Richardson , Reshma Pattan , Cristian Dumitrescu , Byron Marohn , Pablo de Lara Guarch , Pawel Wodkowski , Tomasz Kantecki , John McNamara , Daniel Mrzyglod , Roman Zhukov References: <1488459935-13273-2-git-send-email-arybchenko@solarflare.com> <1495727874-10892-1-git-send-email-arybchenko@solarflare.com> <1495727874-10892-2-git-send-email-arybchenko@solarflare.com> <20170708100537.7a52d067@xeon-e3> From: Andrew Rybchenko Message-ID: <591819ba-f8aa-8afd-9f69-f40befb93016@solarflare.com> Date: Sun, 9 Jul 2017 12:40:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170708100537.7a52d067@xeon-e3> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [85.187.13.33] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ocex03.SolarFlarecom.com (10.20.40.36) X-MDID: 1499593252-nfBVryymEPPZ Subject: Re: [dpdk-dev] [PATCH 2/2] examples: adjust Rx and Tx descriptors to device limits 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: Sun, 09 Jul 2017 09:40:53 -0000 On 07/08/2017 08:05 PM, Stephen Hemminger wrote: > On Thu, 25 May 2017 16:57:54 +0100 > Andrew Rybchenko wrote: > >> + retval = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); >> + if (retval != 0) >> + rte_exit(EXIT_FAILURE, "port %u: rte_eth_dev_adjust_nb_rx_tx_desc " >> + "failed (res=%d)\n", portid, retval); >> + > rte_exit is equivalent to panic in kernel. > No API call should call rte_exit. Instead the error must be propogated > back to caller and/or leave the slave in a dead state. Unfortunately the remaining context lines are not provided in the above quote. As I understand it is: diff --git a/examples/bond/main.c b/examples/bond/main.c index 9a4ec80..6859e13 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -177,6 +177,8 @@ slave_port_init(uint8_t portid, struct rte_mempool *mbuf_pool) { int retval; + uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; + uint16_t nb_txd = RTE_TX_DESC_DEFAULT; if (portid >= rte_eth_dev_count()) rte_exit(EXIT_FAILURE, "Invalid port\n"); @@ -186,8 +188,13 @@ rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n", portid, retval); + retval = rte_eth_dev_adjust_nb_rx_tx_desc(portid, &nb_rxd, &nb_txd); + if (retval != 0) + rte_exit(EXIT_FAILURE, "port %u: rte_eth_dev_adjust_nb_rx_tx_desc " + "failed (res=%d)\n", portid, retval); + /* RX setup */ - retval = rte_eth_rx_queue_setup(portid, 0, RTE_RX_DESC_DEFAULT, + retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), NULL, mbuf_pool); if (retval < 0) So, it is an example application (not a library API), we do not invent rte_exit() and just follow practice which exists in the file.