examples/bond: fix crash when there is no active slave
authorRadu Nicolau <radu.nicolau@intel.com>
Wed, 14 Nov 2018 12:19:09 +0000 (12:19 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Dec 2018 16:32:10 +0000 (16:32 +0000)
commit292fdb76024fce3263e3c33009d37f46c10eddc5
treeda01a52169cab2cf1406cc0ba4eb3ba386a7f3ed
parent2eee509c7c7a3e4b564161b163ea0003f029dd57
examples/bond: fix crash when there is no active slave

If bond_ethdev_rx_burst() called more times with no active slaves
the active slave index will point out of bounds, resulting in a
segfault.
The configured slaves needs to be checked, and if none became active
there is no point going further.

Do not start the packet processing threads until all configured
slaves become active.

Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6")
Cc: stable@dpdk.org
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Acked-by: Chas Williams <chas3@att.com>
examples/bond/main.c