Re: [dpdk-dev] [PATCH] net/bonding: fix double fetch for active_slave_count

2018-11-29 Thread Chas Williams
I guess this is slightly more correct. There is still a race here though. After you make your copy of active_slave_count, the number of active slaves could go to 0 and the memcpy() would copy an invalid element, acitve_slaves[0]. There is no simple fix to this problem. Your patch reduces the opp

[dpdk-dev] [PATCH] net/bonding: fix double fetch for active_slave_count

2018-11-28 Thread Haifeng Lin
1. when memcpy slaves the internals->active_slave_count 1 2. return internals->active_slave_count is 2 3. the slaves[1] would be a random invalid value Signed-off-by: Haifeng Lin --- drivers/net/bonding/rte_eth_bond_api.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git

[dpdk-dev] [PATCH] net/bonding: fix double fetch for active_slave_count

2018-11-28 Thread Haifeng Lin
1. when memcpy slaves the internals->active_slave_count 1 2. return internals->active_slave_count is 2 3. the slaves[1] would be a random invalid value --- drivers/net/bonding/rte_eth_bond_api.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth