From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <radu.nicolau@intel.com>
Received: from mga12.intel.com (mga12.intel.com [192.55.52.136])
 by dpdk.org (Postfix) with ESMTP id 8864CDED
 for <dev@dpdk.org>; Wed, 31 Oct 2018 16:34:51 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 31 Oct 2018 08:34:50 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.54,447,1534834800"; d="scan'208";a="96600079"
Received: from rnicolau-mobl.ger.corp.intel.com (HELO [10.237.221.57])
 ([10.237.221.57])
 by orsmga003.jf.intel.com with ESMTP; 31 Oct 2018 08:34:47 -0700
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, declan.doherty@intel.com, chas3@att.com,
 ferruh.yigit@intel.com, arybchenko@solarflare.com
References: <1540994346-17532-1-git-send-email-radu.nicolau@intel.com>
 <2490703.Y8HZJr6zFH@xps>
From: Radu Nicolau <radu.nicolau@intel.com>
Message-ID: <e7caabc8-4165-f2d0-266a-5331ac22009f@intel.com>
Date: Wed, 31 Oct 2018 15:34:45 +0000
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: <2490703.Y8HZJr6zFH@xps>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Subject: Re: [dpdk-dev] [PATCH] net/bonding: fix segfault when creating
	bonded device
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 31 Oct 2018 15:34:52 -0000



On 10/31/2018 3:06 PM, 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().
But we need to set the mode, the call to 
rte_eth_bond_8023ad_agg_selection_set() assumed before that it will 
actually succeed, which is not the case anymore.
I will look at reverting that patch/fix, it is likely not needed anymore 
anyway if this patch is applied.
> 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
>
> Then the issue is to allow configuring a port before the end of probing.
> This patch is workarounding the public API which checks port validity.
> I think it is a good approach.
>
In probe() we need to set the mode, and we know that the port is a valid 
bonding port, so there is no need to check. Any other call bar the ones 
in probe remain the same.