<div dir="ltr"><div>Hi all,</div><div><br></div><div>I'm using DPDK-21.11 in ovs-dpdk.</div><div><br></div><div>I found a "bonding member delete bug" .</div><div><br></div><div>1. How to reproduce</div><div><br></div><div>```</div><div>NOTICE: bondctl is a tool I develop, it's to control DPDK.</div><div><br></div><div>### step 1, Add bonding device bond0.</div><div>bondctl add bond0 mode active-backup</div><div><br></div><div>### step 2, Add member m1 into bond0.</div><div>bondctl set 0000:00:0a.0 master bond0 </div><div><br></div><div>### step 3, Add bond0 into ovs bridge.</div><div>ovs-vsctl add-port brp0 bond0 -- set interface bond0 type=dpdk options:dpdk-devargs=net_bonding-bond0</div><div>(this command call @bond_ethdev_start at last.)<br></div><div><br></div><div>### step 4, Delete bond0 from ovs bridge.</div><div><div>ovs-vsctl del-port br-phy bond0</div><div>(this command call @bond_ethdev_stop at last.)</div></div><div><br></div><div>### step 5, Delete m1 from bond0.</div><div>bondctl set 0000:00:0a.0 nomaster<br></div><div><br></div><div>### step 6, Delete bond0.</div><div>bondctl del bond0<br></div><div><br></div><div>### step 7, Add bond0.</div><div>bondctl add bond0 mode active-backup<br></div><div><br></div><div>### step 8, Add member m1 into bond0.</div><div>bondctl set 0000:00:0a.0 master bond0<br></div><div>(this command call @bond_ethdev_start at last.)<br></div><div><br></div><div>### Then got error message.</div><div>2023-12-15T08:24:04.153Z|00017|dpdk|ERR|Port 0 must be stopped to allow configurr<br>ation<br>2023-12-15T08:24:04.153Z|00018|dpdk|ERR|bond_cmd_set_master(581) - can not confii<br>g slave 0000:00:0a.0!<br></div><div>```</div><div><br></div><div>2. Debug</div><div><br></div><div>I found the reason is, when member port is DOWN, then add operation will call "eth_dev->data->dev_started = 1;", but no one add active member port, so when delete bond0, will NOT call @rte_eth_dev_stop, then add bond0 again, got error. Detail is:</div><div>```</div><div>### After step 1-3, add bond0 into ovs-dpdk</div><div>bond_ethdev_start<br>    eth_dev->data->dev_started = 1;<br>    for (i = 0; i < internals->slave_count; i++) {<br>        if (slave_configure(eth_dev, slave_ethdev) != 0) {<br>        if (slave_start(eth_dev, slave_ethdev) != 0) {<br>            rte_eth_dev_start<br><br>### NOTICE, as member port is DOWN, so will NOT call <a class="gmail_plusreply" id="plusReplyChip-1">@</a>activate_slave, so @active_slave_count is 0.</div><div>bond_ethdev_lsc_event_callback<br>    activate_slave(bonded_eth_dev, port_id);<br><br>### After step 4, delete bond0 from ovs-dpdk, NOTICE, as @active_slave_count is 0, so will NOT call <a class="gmail_plusreply" id="plusReplyChip-4">@rte_eth_dev_stop</a></div><div>bond_ethdev_stop<br>    for (i = 0; i < internals->slave_count; i++) {<br>        if (find_slave_by_id(internals->active_slaves,<br>                internals->active_slave_count, slave_id) !=<br>                        internals->active_slave_count) {<br>            ret = rte_eth_dev_stop(slave_id);<a class="gmail_plusreply"><br></a></div><div><br></div><div>### After step 5-7, delete bond0 and then add bond0</div><div><br></div><div>### After step 8, add bond0, as it's NOT call <a class="gmail_plusreply" id="gmail-plusReplyChip-4">@rte_eth_dev_stop, so call </a><a class="gmail_plusreply" id="gmail-plusReplyChip-4">@rte_eth_dev_start again will got error.</a></div><div>2023-12-15T08:24:04.153Z|00017|dpdk|ERR|Port 0 must be stopped to allow configurr<br>ation<a class="gmail_plusreply"><br></a></div><div><br></div><div>```</div><div><br></div><div>3. My question</div><div><br></div><div>Is this bug fixed ? Which commit ?<br><br></div><div>If NOT, how to fix this bug? I think it's better to call <a class="gmail_plusreply" id="gmail-plusReplyChip-4">@rte_eth_dev_stop for every member, even it's DOWN. How about this?<br><br>Thanks~</a></div><div><br></div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>----</div>Simon Jones</div></div></div></div></div></div>