From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH 7/7] net/mlx5: add parameter for port representors Date: Wed, 13 Jun 2018 15:11:27 +0200 Message-ID: <20180613131126.GE4025@6wind.com> References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180525161814.13873-8-adrien.mazarguil@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Shahaf Shuler , "dev@dpdk.org" To: "Xueming(Steven) Li" Return-path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 6DE5F1EDE6 for ; Wed, 13 Jun 2018 15:11:43 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id v131-v6so5331361wma.1 for ; Wed, 13 Jun 2018 06:11:43 -0700 (PDT) Content-Disposition: inline In-Reply-To: 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 Tue, Jun 12, 2018 at 02:44:12PM +0000, Xueming(Steven) Li wrote: > > + if (dpdk_dev->devargs) { > > + ret = rte_eth_devargs_parse(dpdk_dev->devargs->args, ð_da); > > + if (ret) > > + goto error; > > + } else { > > + memset(ð_da, 0, sizeof(eth_da)); > > + } > > next: > > + if (j) { > > + unsigned int k; > > + > > + for (k = 0; k < eth_da.nb_representor_ports; ++k) > > + if (eth_da.representor_ports[k] == j - 1) > > + break; > > + if (k == eth_da.nb_representor_ports) > > + goto skip; > > + } > > errno = 0; > > ctx = mlx5_glue->open_device(ibv_dev[j]); > > if (!ctx) { > > @@ -1187,6 +1211,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, > > goto error; > > ++n; > > } > > +skip: > > if (ibv_dev[++j]) > > goto next; > > int rte_eth_dev_attach(const char *devargs, uint16_t *port_id); > The rte_eth_dev_attach api attach one device a time as only one *port_id parameter. > Dev argument "82:0.0,representer[a-b] will register multiple devices in one call, > is this correct behavior? Yes, this is how the representor argument is documented and supposed to be used. This probing approach is obviously not compatible with representors hot-plugging, for which something will have to be devised if needed. > I ask this because this caused testpmd CLI "port attach" > crash due to only the last registered port id returned. I reproduced this crash and determined it is caused by a bug in testpmd. I'll submit a separate fix for it. -- Adrien Mazarguil 6WIND