From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chas Williams <3chas3@gmail.com> Subject: Re: [PATCH] net/bonding: fix segfault when creating bonded device Date: Wed, 31 Oct 2018 11:37:21 -0400 Message-ID: <2adb03da-ff43-3ab4-5e5a-0a44622d5f8d@gmail.com> References: <1540994346-17532-1-git-send-email-radu.nicolau@intel.com> <2490703.Y8HZJr6zFH@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, declan.doherty@intel.com, chas3@att.com, ferruh.yigit@intel.com, arybchenko@solarflare.com To: Thomas Monjalon , Radu Nicolau Return-path: Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by dpdk.org (Postfix) with ESMTP id 5FADF239 for ; Wed, 31 Oct 2018 16:37:23 +0100 (CET) Received: by mail-qk1-f195.google.com with SMTP id 189so8777319qkj.8 for ; Wed, 31 Oct 2018 08:37:23 -0700 (PDT) In-Reply-To: <2490703.Y8HZJr6zFH@xps> 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 10/31/2018 11:06 AM, Thomas Monjalon wrote: > 31/10/2018 14:59, Radu Nicolau: >> After the patch below the call to rte_eth_bond_8023ad_agg_selection_set >> from probe() segfaults; there is no need to call the function, just set >> the mode directly. >> >> Fixes: 391797f04208 ("drivers/bus: move driver assignment to end of probing") > > It would not segfault if you call rte_eth_dev_probing_finish() at the > real end of the probing function. Then the port will be considered not > valid in rte_eth_bond_8023ad_agg_selection_set(). > It does not solve your problem but it is more correct. > So I suggest to revert this patch (which was a wrong fix): > http://git.dpdk.org/dpdk/commit/?id=1620175 Or just make the change proposed in this commit and also move this section before the probing finish. This is performing initial setup of the interface and it doesn't need to use the public API to do this. And this should be done before the public API can access the device. > Then the issue is to allow configuring a port before the end of probing. That shouldn't be allowed of course. > This patch is workarounding the public API which checks port validity. > I think it is a good approach.