From: Chas Williams <3chas3@gmail.com>
To: Radu Nicolau <radu.nicolau@intel.com>, dev@dpdk.org
Cc: declan.doherty@intel.com, chas3@att.com
Subject: Re: [dpdk-dev] [PATCH] examples/bond: wait for slaves to become active
Date: Tue, 27 Nov 2018 14:01:12 -0500 [thread overview]
Message-ID: <d4ac394f-9f9f-f590-09ea-35eeb6343f85@gmail.com> (raw)
In-Reply-To: <1542197949-15992-1-git-send-email-radu.nicolau@intel.com>
On 11/14/2018 07:19 AM, Radu Nicolau wrote:
> Do not start the packet processing threads until all configured
> slaves become active.
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
> ---
> examples/bond/main.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index b282e68..6623cae 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -220,6 +220,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
> struct rte_eth_rxconf rxq_conf;
> struct rte_eth_txconf txq_conf;
> struct rte_eth_conf local_port_conf = port_conf;
> + uint16_t wait_counter = 20;
>
> retval = rte_eth_bond_create("net_bonding0", BONDING_MODE_ALB,
> 0 /*SOCKET_ID_ANY*/);
> @@ -274,6 +275,20 @@ bond_port_init(struct rte_mempool *mbuf_pool)
> if (retval < 0)
> rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval);
>
> + printf("Waiting for slaves to become active...");
> + while (wait_counter) {
> + uint16_t act_slaves[16] = {0};
> + if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) ==
> + slaves_count) {
> + printf("\n");
> + break;
> + }
> + sleep(1);
> + printf("...");
> + if (--wait_counter == 0)
> + rte_exit(-1, "\nFailed to activate slaves\n");
> + }
> +
> rte_eth_promiscuous_enable(BOND_PORT);
>
> struct ether_addr addr;
>
next prev parent reply other threads:[~2018-11-27 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 12:19 Radu Nicolau
2018-11-27 19:01 ` Chas Williams [this message]
2018-11-29 17:14 ` Ferruh Yigit
2018-11-28 11:08 ` Ferruh Yigit
2018-11-28 13:48 ` Radu Nicolau
2018-11-28 14:28 ` Chas Williams
2018-11-28 16:04 ` Radu Nicolau
2018-11-28 16:14 ` Chas Williams
2018-11-29 8:57 ` Ferruh Yigit
2018-11-29 12:11 ` Nicolau, Radu
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=d4ac394f-9f9f-f590-09ea-35eeb6343f85@gmail.com \
--to=3chas3@gmail.com \
--cc=chas3@att.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=radu.nicolau@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).