From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3chas3@gmail.com> Received: from mail-it0-f65.google.com (mail-it0-f65.google.com [209.85.214.65]) by dpdk.org (Postfix) with ESMTP id 6992F4C93 for ; Fri, 1 Jun 2018 02:05:18 +0200 (CEST) Received: by mail-it0-f65.google.com with SMTP id c3-v6so30268705itj.4 for ; Thu, 31 May 2018 17:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=s7bPIoXbJH6+iKIMoxANuZFl3vwy48W6uud4NfAMhq0=; b=tbZjP07LxRUXGtdVjEotGlIw2T/JJw1VwiXUrsvZU4THsd208Ypws7hzoe4NOw8QPr /d9VwJkEp/urjP81rqZaxzvV4jNSUr6OUOhTjgABIX8rH0vhPf9Do2T9XQI6JHXGx1jO mOn/APjRrwkep+QCuiaA9mLruokQX6o1UkkeOBaqOdJcwgkkBjXILuojr6jlCq92BW/w OEJawqT8UlZsls5V1Gb0/WFTivUyaySVFRKnJvyAIm/QP6tdWkvKounsstXuRtRB/s1S eVJ7vTCo0BpiH542ynVCWdSolvwFBLx5yIMiYcom6uo9fHL1UIgREA0DJJeOoHGELYNb LQ/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=s7bPIoXbJH6+iKIMoxANuZFl3vwy48W6uud4NfAMhq0=; b=bnzAzQNTW14OSrQAWg4CwhXLgN3sL4ZXdg1qSmd8dda14xAo4NyQuTVMfSRHx2Ufp5 fdKJcr7v4iENrb+WnyD3wqRTfq4WKcZFxgLmL3Jt82gA/GtRrw1qK2N4qz2CBtlU3wsf O8H27cMlsRDhd9u8tK4JuMvV96TEocW94qmi1qnC8Xdr/q6BdEXQuEojRQVDYSooayli f1bfYqs/R3CjUD8ylWOu2cYGb2tblb/tsWSn9kUJz4PZUCzUescx5Npg+3q/HmNARYsi QMLsK8DJTZKcAtxCG7oAEtQxwcgeeQ6IQrxdbGEseMnOJaDywiyJ47JfuIYoGmsxoEW8 mqog== X-Gm-Message-State: APt69E2o6skqpfhTM+MiOjVIDGbUX8P3EIg+E7yFybSEQ1naIEZxRAZT PXPP2RTqTiOOQSThYMQJRdquur3ERXgXn9GPasA= X-Google-Smtp-Source: ADUXVKJJ6jazcoGqNxGPBpLJvn1NNgbWiAAm2gfN6YPR9lXW3x+OMKc9/z1WqOyGQsixt6TPRn6wU/9+Ca4EkFLuids= X-Received: by 2002:a24:978b:: with SMTP id k133-v6mr2295230ite.42.1527811517831; Thu, 31 May 2018 17:05:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:e90e:0:0:0:0:0 with HTTP; Thu, 31 May 2018 17:05:17 -0700 (PDT) In-Reply-To: <1527783047-18201-1-git-send-email-radu.nicolau@intel.com> References: <1525867586-23328-1-git-send-email-radu.nicolau@intel.com> <1527783047-18201-1-git-send-email-radu.nicolau@intel.com> From: Chas Williams <3chas3@gmail.com> Date: Thu, 31 May 2018 20:05:17 -0400 Message-ID: To: Radu Nicolau Cc: dev@dpdk.org, Declan Doherty , Ferruh Yigit Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v3] net/bonding: fix slave add for mode 4 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2018 00:05:18 -0000 It's not clear to me that the issue here is the bonding slave add. You can only add started PMDs. When a PMD dev start is complete, the PMD should have a valid link state and the link properties should be valid. A few of the PMDs are very good about this, particularly the ones with LSC interrupts. Those drivers often wait for the first link interrupt before setting their link status. So there is a race where the link state isn't well defined. And lastly, why do we care what the link state is when adding a slave? If the link state changes to down, do we remove the slave? If the link speed of the slave changes, do we remove the slave? So this test doesn't make much sense. For mode 4, you should be able to add a slave, but if the link state doesn't match what has been negotiated, then the slave should fail to activate. On Thu, May 31, 2018 at 12:10 PM, Radu Nicolau wrote: > > Add a call to rte_eth_link_get_nowait on every slave to update > the internal link status struct. Otherwise slave add will fail > for mode 4 if the ports are all stopped but only one of them checked. > > Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions") > Bugzilla ID: 52 > > Signed-off-by: Radu Nicolau > --- > v3: updated commit msg > v2: add fix and Bugzilla references > > drivers/net/bonding/rte_eth_bond_api.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c > index d558df8..cad08b9 100644 > --- a/drivers/net/bonding/rte_eth_bond_api.c > +++ b/drivers/net/bonding/rte_eth_bond_api.c > @@ -296,6 +296,8 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) > return -1; > } > > + rte_eth_link_get_nowait(slave_port_id, &link_props); > + > slave_add(internals, slave_eth_dev); > > /* We need to store slaves reta_size to be able to synchronize RETA for all > -- > 2.7.5 >