From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id EF3FD1BE3B for ; Wed, 27 Jun 2018 15:32:51 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id v16-v6so5871707wmv.5 for ; Wed, 27 Jun 2018 06:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qgojQm2+SKGDvEAaP5OO85F7RN9Q6lo32+AMvha+kQI=; b=Xeoj4MMy4YOZddkJT1zQ94VuuQuTcXb36Pl/oKWn3fXTmun2xrmsviyYlkDRnPCiJS iTUtjeoFuXUwgqBFPWiamZDhbbzTcClOgiAVlZYh1U7HFs0G3/9jl+uU6GoQSsMZDzNY FL8qhIppr01crZ3iarx9Yp1d3SHy7hidgIsD7ovdYsxUQ07fuuKLEHgqtd8YH+HktlOt iBn7/PHbgTq3z9fPd6MwU0EamTg953xYxpU2QmNEFnE52hOOvyNi4c80Ik9MW+mDgCaG +Ucluf4vEn81e/iLq0s3vRpdTRIh9r+9E7HW/iiUJspWnYY6akJMC+pcZnmKtqJAoQ2Z Ij+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qgojQm2+SKGDvEAaP5OO85F7RN9Q6lo32+AMvha+kQI=; b=RCFEIG4cW4fiNYzttGJneMyDgKA9q0r0dVKabEaMLNbgIga8EcRkgbBMIWhA+pYXw9 GHMpmwYORlVd1jnI0nz0YNbn0A//EjjadhR75xctI7mYpMZJDY/0+02b+DmwO+Fh4YhG fdW9TC8FDZe0pEluw2Z5PuYVvU5G7Oxg06SUTCSftVgvE/6FvmtOdI6aSAwmo9v3HEoF xg2/fjL1kV0CW5EDYkMonRf9MTxJR6YXEebOBPZGJyl2xGi1cSLzzaM/+ZhGM93tTphY cWz2IrxQ5ZYUQmHvNdnTA6x8gb9HgAwE3BNUSiydFvZ2a8Oub6E9sg5Nq7HGyuHsaApL 0BmA== X-Gm-Message-State: APt69E2LhUmiWh0fV3PODvxeZO0vNwlLVTYn3ZQOQWoOzDVZgaR9VYf6 J+g72N1Eail0kYdPpPyKIw6FYw== X-Google-Smtp-Source: AAOMgpcfE4AmWVbDjfv0QuO35CKa1E6xANz1bWpSgGN2QnPk7NToccqIXdzZpxBT3R1IV+UyaMWmrA== X-Received: by 2002:a1c:150d:: with SMTP id 13-v6mr5329873wmv.100.1530106371760; Wed, 27 Jun 2018 06:32:51 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id j131-v6sm6943728wmg.24.2018.06.27.06.32.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 06:32:51 -0700 (PDT) Date: Wed, 27 Jun 2018 15:32:35 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: "Xueming(Steven) Li" , "dev@dpdk.org" , Guillaume Gaudonville , Wisam Monther , Raslan Darawsheh , Olga Shern Message-ID: <20180627133235.GW4025@6wind.com> References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180614083047.10812-1-adrien.mazarguil@6wind.com> <20180614083047.10812-7-adrien.mazarguil@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH v2 6/7] net/mlx5: probe all port representors 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: Wed, 27 Jun 2018 13:32:52 -0000 On Sun, Jun 24, 2018 at 01:33:31PM +0000, Shahaf Shuler wrote: > One more input, > > Sunday, June 17, 2018 1:15 PM, Shahaf Shuler: > > Subject: RE: [dpdk-dev] [PATCH v2 6/7] net/mlx5: probe all port representors > > [...] > > > > > + eth_list = tmp; > > > > for (i = 0; i < attr.orig_attr.phys_port_cnt; ++i) { > > > > - eth_list[i] = mlx5_dev_spawn_one(dpdk_dev, ibv_dev, vf, > > > > - &attr, i + 1); > > > > - if (eth_list[i]) > > > > - continue; > > > > - /* Save rte_errno and roll back in case of failure. */ > > > > - ret = rte_errno; > > > > - while (i--) { > > > > - mlx5_dev_close(eth_list[i]); > > > > - if (rte_eal_process_type() == RTE_PROC_PRIMARY) > > > > - rte_free(eth_list[i]->data->dev_private); > > > > - claim_zero(rte_eth_dev_release_port(eth_list[i])); > > > > - } > > > > - free(eth_list); > > > > - rte_errno = ret; > > > > - return NULL; > > > > + eth_list[n] = mlx5_dev_spawn_one(dpdk_dev, ibv_dev[j], > > > vf, > > > > + &attr, i + 1, > > > > + j ? eth_list[0] : NULL, > > > > + j - 1); > > > > The representor id is according to the sort made by qsort (based on device > > names). > > A better way may be to set it according to the sysfs information, like you do > > in the mlx5_get_ifname function. > > What do you think? > > In fact relaying on linear increasing port numbers is dangerous. In may break on special scenarios like BlueField. > In BlueField there are representors between the x86 and the ARM cores. Those are not VF representors. The phys_port_name of those is -1 and each of them belongs to different phys_switch_id. > > We can argue whether it is correct/not to assign them w/ -1 value, but I think the suggested approach above can detect the right "vf_id" for those and not break the current behavior on x86. > Let me know if you have other suggestions. I didn't know that. Assuming that with these, there is exactly only one representor per device, I think we can manage, the main issue being that "-1" will be difficult to parse as a valid "representor" argument which uses "-" for ranges. Anyway, I suggest to deal with Bluefield specifics in a subsequent series. This one focuses on and is validated with VF representors only. -- Adrien Mazarguil 6WIND