DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Declan Doherty <declan.doherty@intel.com>
Cc: <dev@dpdk.org>,
	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
	 Remy Horton <remy.horton@intel.com>,
	Jianfeng Tan <jianfeng.tan@intel.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Yuanhan Liu <yuanhan.liu@linux.intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Reshma Pattan <reshma.pattan@intel.com>,
	Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
	Byron Marohn <byron.marohn@intel.com>,
	Pablo de Lara Guarch <pablo.de.lara.guarch@intel.com>,
	Pawel Wodkowski <pawelx.wodkowski@intel.com>,
	Tomasz Kantecki <tomasz.kantecki@intel.com>,
	John McNamara <john.mcnamara@intel.com>,
	Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>,
	Roman Zhukov <Roman.Zhukov@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH 2/2] examples: adjust Rx and Tx descriptors to device limits
Date: Sun, 9 Jul 2017 12:40:23 +0300	[thread overview]
Message-ID: <591819ba-f8aa-8afd-9f69-f40befb93016@solarflare.com> (raw)
In-Reply-To: <20170708100537.7a52d067@xeon-e3>

On 07/08/2017 08:05 PM, Stephen Hemminger wrote:
> On Thu, 25 May 2017 16:57:54 +0100
> Andrew Rybchenko <arybchenko@solarflare.com> 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.

  reply	other threads:[~2017-07-09  9:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 13:05 [dpdk-dev] [RFC PATCH 0/2] Helper function to ajdust Rx/Tx descriptor numbers Andrew Rybchenko
2017-03-02 13:05 ` [dpdk-dev] [RFC PATCH 1/2] ethdev: add function to adjust number of descriptors Andrew Rybchenko
2017-04-24 15:13   ` Thomas Monjalon
2017-04-25  7:39     ` Andrew Rybchenko
2017-05-25 15:57   ` [dpdk-dev] [PATCH " Andrew Rybchenko
2017-05-25 15:57     ` [dpdk-dev] [PATCH 2/2] examples: adjust Rx and Tx descriptors to device limits Andrew Rybchenko
2017-07-08 17:05       ` Stephen Hemminger
2017-07-09  9:40         ` Andrew Rybchenko [this message]
2017-05-25 17:40     ` [dpdk-dev] [PATCH 1/2] ethdev: add function to adjust number of descriptors Stephen Hemminger
2017-06-14 10:37       ` Andrew Rybchenko
2017-07-05 23:00         ` Thomas Monjalon
2017-07-08 16:45           ` Thomas Monjalon
2017-03-02 13:05 ` [dpdk-dev] [RFC PATCH 2/2] examples/l3fwd: add check of Rx and Tx descriptors number Andrew Rybchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=591819ba-f8aa-8afd-9f69-f40befb93016@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=Roman.Zhukov@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=byron.marohn@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=danielx.t.mrzyglod@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=john.mcnamara@intel.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=pawelx.wodkowski@intel.com \
    --cc=remy.horton@intel.com \
    --cc=reshma.pattan@intel.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=tomasz.kantecki@intel.com \
    --cc=yuanhan.liu@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).