From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radu Nicolau Subject: Re: [PATCH] net/bonding: stop and deactivate slaves when bonding port is stopped Date: Wed, 1 Aug 2018 15:02:34 +0100 Message-ID: References: <1533129523-1407-1-git-send-email-radu.nicolau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: dev@dpdk.org, Declan Doherty , Chas Williams , stable@dpdk.org To: Chas Williams <3chas3@gmail.com> Return-path: In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 8/1/2018 2:44 PM, Chas Williams wrote: > > > On Wed, Aug 1, 2018 at 9:25 AM Radu Nicolau > wrote: > > When a bonding port is stopped also stop and deactivate all slaves. > Otherwise slaves will be still listed as active. > > > I have to think about this for a bit.  The last time I tried this I > had a problem > because nothing activated the slaves again in 802.3ad mode because we > use an external state machine. I did test it for mode 4, stop and start seems to be working as expected. From what is see, activate_slave will be either called directly or indirectly through the LSC when port is restarted. > > Fixes: 69bce062132b ("net/bonding: do not clear active slave count") > Cc: stable@dpdk.org > > Signed-off-by: Radu Nicolau > > --- >  drivers/net/bonding/rte_eth_bond_pmd.c | 11 +++++++---- >  1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c > b/drivers/net/bonding/rte_eth_bond_pmd.c > index 16105cb..960140c 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2229,12 +2229,15 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) > tlb_last_obytets[internals->active_slaves[i]] = 0; >         } > > -       internals->link_status_polling_enabled = 0; > -       for (i = 0; i < internals->slave_count; i++) > -               internals->slaves[i].last_link_status = 0; > - >         eth_dev->data->dev_link.link_status = ETH_LINK_DOWN; >         eth_dev->data->dev_started = 0; > + > +       internals->link_status_polling_enabled = 0; > +       for (i = 0; i < internals->slave_count; i++) { > +               internals->slaves[i].last_link_status = 0; > +  rte_eth_dev_stop(internals->slaves[i].port_id); > +               deactivate_slave(eth_dev, > internals->slaves[i].port_id); > +       } >  } > >  void > -- > 2.7.5 >