From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 6396891; Tue, 13 Nov 2018 17:52:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 08:52:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,228,1539673200"; d="scan'208";a="273679077" Received: from silpixa00383879.ir.intel.com (HELO silpixa00383879.ger.corp.intel.com) ([10.237.223.127]) by orsmga005.jf.intel.com with ESMTP; 13 Nov 2018 08:52:18 -0800 From: Radu Nicolau To: dev@dpdk.org Cc: declan.doherty@intel.com, chas3@att.com, Radu Nicolau , stable@dpdk.org Date: Tue, 13 Nov 2018 16:46:04 +0000 Message-Id: <1542127564-25901-1-git-send-email-radu.nicolau@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH] examples/bond: fix initialization error 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: Tue, 13 Nov 2018 16:52:22 -0000 Queue setup will fail if called before adding slaves. Fixes: 7a0665940fa8 ("net/bonding: inherit descriptor limits from slaves") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau --- examples/bond/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bond/main.c b/examples/bond/main.c index b282e68..65f3c39 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -243,6 +243,13 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "port %u: rte_eth_dev_adjust_nb_rx_tx_desc " "failed (res=%d)\n", BOND_PORT, retval); + for (i = 0; i < slaves_count; i++) { + if (rte_eth_bond_slave_add(BOND_PORT, slaves[i]) == -1) + rte_exit(-1, "Oooops! adding slave (%u) to bond (%u) failed!\n", + slaves[i], BOND_PORT); + + } + /* RX setup */ rxq_conf = dev_info.default_rxconf; rxq_conf.offloads = local_port_conf.rxmode.offloads; @@ -263,13 +270,6 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(retval, "port %u: TX queue 0 setup failed (res=%d)", BOND_PORT, retval); - for (i = 0; i < slaves_count; i++) { - if (rte_eth_bond_slave_add(BOND_PORT, slaves[i]) == -1) - rte_exit(-1, "Oooops! adding slave (%u) to bond (%u) failed!\n", - slaves[i], BOND_PORT); - - } - retval = rte_eth_dev_start(BOND_PORT); if (retval < 0) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); -- 2.7.5