From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 9E1C34C97 for ; Fri, 1 Jun 2018 12:18:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jun 2018 03:18:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,465,1520924400"; d="scan'208";a="233772336" Received: from rnicolau-mobl.ger.corp.intel.com (HELO [10.237.221.67]) ([10.237.221.67]) by fmsmga006.fm.intel.com with ESMTP; 01 Jun 2018 03:18:06 -0700 To: Ferruh Yigit , dev@dpdk.org Cc: declan.doherty@intel.com References: <1527777275-9974-1-git-send-email-radu.nicolau@intel.com> <2d1f24aa-b752-5031-f063-1394c47d64ff@intel.com> <2c61f454-9c44-39d3-3258-3f894175186d@intel.com> <0cbf7312-4d54-3240-82a8-239c34fc8005@intel.com> <8b1e1186-4a84-c10d-2056-7b8ed1310106@intel.com> From: Radu Nicolau Message-ID: Date: Fri, 1 Jun 2018 11:18:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <8b1e1186-4a84-c10d-2056-7b8ed1310106@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [dpdk-dev] [PATCH v2] net/bonding: fix update link status on slave add 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 10:18:09 -0000 On 5/31/2018 5:32 PM, Ferruh Yigit wrote: > On 5/31/2018 5:13 PM, Radu Nicolau wrote: >> >> On 5/31/2018 4:36 PM, Ferruh Yigit wrote: >>> On 5/31/2018 4:34 PM, Ferruh Yigit wrote: >>>> On 5/31/2018 3:34 PM, Radu Nicolau wrote: >>>> >>>> I can see you just prefix "fix" to the title without updating it :) >>>> >>>> What about following one: >>>> "net/bonding: fix slave add for mode 4" ? >> Great, I'll use it for v3 :) >> >>>>> 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. >>>> What is the link related expectation from slaves in mode 4? >> To be identical across all ports >>>> What does "if the ports are all stopped but only one of them checked" mean, why >>>> checking only one of them? >> This is the behavior of testpmd, stop getting the link status after the >> first down port; but this should not affect bonding, so there is no need >> to update testpmd. > I see, when this link updating happens in this bonding issue context? When > bonding device created? > > Should we update testpmd behavior too? Yes, I think that stop_port(portid_t pid) may need some rework. I'm not sure I understand the reason it calls check_all_ports_link_status(), for example. Also, check_all_ports_link_status should do what it implies it does, check all ports, not stop at the first down port. > >>>>> Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions") >>>>> Bugzilla entry: https://dpdk.org/tracker/show_bug.cgi?id=52 >>> Bugzilla ID: 52 >>> >>> btw, can you please send new version as reply to previous version? >> Sure. >> >>>>> Signed-off-by: Radu Nicolau >>>>> --- >>>>> 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); >>>>> + >>>> The error seems in link_properties_valid(), does it make sense to get link info >>>> inside that function before link checks? >> Not really, as one might expect that link_properties_valid will only >> test the struct rte_eth_link *slave_link argument, not update it. > Fair enough, I just thought to be sure the tested link is up to date, but that > function seems only called by __eth_bond_slave_add_lock_free() which you are > updating, so this is ok. > >>>>> slave_add(internals, slave_eth_dev); >>>>> >>>>> /* We need to store slaves reta_size to be able to synchronize RETA for all >>>>>