From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chas Williams <3chas3@gmail.com> Subject: Re: [PATCH v2] net/bonding: fix segfault when creating bonded device Date: Wed, 31 Oct 2018 12:14:03 -0400 Message-ID: References: <1540994346-17532-1-git-send-email-radu.nicolau@intel.com> <1541001008-13498-1-git-send-email-radu.nicolau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: thomas@monjalon.net, declan.doherty@intel.com, chas3@att.com, ferruh.yigit@intel.com, arybchenko@solarflare.com To: Radu Nicolau , dev@dpdk.org Return-path: Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by dpdk.org (Postfix) with ESMTP id 21D5A91 for ; Wed, 31 Oct 2018 17:14:05 +0100 (CET) Received: by mail-qk1-f193.google.com with SMTP id p3-v6so10428252qkb.5 for ; Wed, 31 Oct 2018 09:14:05 -0700 (PDT) In-Reply-To: <1541001008-13498-1-git-send-email-radu.nicolau@intel.com> 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:50 AM, Radu Nicolau wrote: > 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. > Also, reverted 1620175b400e. > > Fixes: 391797f04208 ("drivers/bus: move driver assignment to end of probing") > Fixes: 1620175b400e ("net/bonding: fix invalid port id") > > Signed-off-by: Radu Nicolau Acked-by: Chas Williams > --- > v2: reverted earlier patch > > drivers/net/bonding/rte_eth_bond_pmd.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 156f31c..1a6d8e4 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -3216,8 +3216,6 @@ bond_probe(struct rte_vdev_device *dev) > internals = rte_eth_devices[port_id].data->dev_private; > internals->kvlist = kvlist; > > - rte_eth_dev_probing_finish(&rte_eth_devices[port_id]); > - > if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) { > if (rte_kvargs_process(kvlist, > PMD_BOND_AGG_MODE_KVARG, > @@ -3230,12 +3228,12 @@ bond_probe(struct rte_vdev_device *dev) > } > > if (internals->mode == BONDING_MODE_8023AD) > - rte_eth_bond_8023ad_agg_selection_set(port_id, > - agg_mode); > + internals->mode4.agg_selection = agg_mode; > } else { > - rte_eth_bond_8023ad_agg_selection_set(port_id, AGG_STABLE); > + internals->mode4.agg_selection = AGG_STABLE; > } > > + rte_eth_dev_probing_finish(&rte_eth_devices[port_id]); > RTE_BOND_LOG(INFO, "Create bonded device %s on port %d in mode %u on " > "socket %u.", name, port_id, bonding_mode, socket_id); > return 0; >