From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=b/WFSDFD/MaX2iinLICGc8MkMJSS8lVZ/2FOiHp2nxU=; b=HG5Mz/K0SP7EFrgKlHrP3DwzYYVXx8dBhDYr3agQeheVPAq5Y1Sb8AlaApldu7PHp7 Rf8jPeOCH9de9dzM1XTvXLiLYJqnLsaXcdzCNXuVCD4aS0nqPvfaFBao1W0gvTXeOYlh o0ZNAw+xfb7/9Wb/HM689kP6ny81AsvNPeWRxJnGSfbotNiyoonQE1fVKUIcVVhXASnU 3osqKW4eQuPFURPm8htWdczVy6TwJidnB9DMYYnYuqHksXtNKdDbq8mzhCmtCn6ckWur +2DMJgs/W3kDM+PnbtKD8qPaCvntw4/OslQZHcARuhcEfJbiodimaHwyBK7Gv6eLvjTZ BztQ== 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=b/WFSDFD/MaX2iinLICGc8MkMJSS8lVZ/2FOiHp2nxU=; b=QGzm82cmjMN+LwJQ0lRTCE367jxYsTfl28DNA1vwGOwnEyVaklOPlJjQi3QrIKv22g Gk+r/4S+2R6sSAwMBGfvlMSlD/wu7dpLa51r3Bcspt8Am8fZQiV5ZMvfVISPJPnl1Cnd 1M1lOvEsq1M9E1++EumdrvY61gHIgKsERjlg48wr8VGhRRKFi/A/1y1K6RD7rlzK80oE sHDlFwm776OAAG68eU0csIOfzR7CGZ4qdkS0BhZY3NORpgLmjw/B1qe7sPZaGO0B/qvP bj6stpVbzV/lbJjxgwWAhnIK2kYdicsFm/uPkR+Fg3tY3sPWw96w6IwDB+9RR97IV8tQ 0Z7A== X-Gm-Message-State: APt69E2ThyqZcUu3oHFq5pcXkQsdjobcrMmWGTCD+ArhCUKJxSzKAgFA gUesUuAPk4glVozq4Aw6mP3DbQ== X-Google-Smtp-Source: ADUXVKJ4IZZKaY9oXpKHSyT5pRgH74uQTImtB7+OfBWP8XlmpZHly3Rck8EUydShpYmq+Oa5R9Iv0w== X-Received: by 2002:a1c:7212:: with SMTP id n18-v6mr3614741wmc.5.1528895503398; Wed, 13 Jun 2018 06:11:43 -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 c11-v6sm2855681wrm.65.2018.06.13.06.11.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Jun 2018 06:11:42 -0700 (PDT) Date: Wed, 13 Jun 2018 15:11:27 +0200 From: Adrien Mazarguil To: "Xueming(Steven) Li" Cc: Shahaf Shuler , "dev@dpdk.org" 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 Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] [PATCH 7/7] net/mlx5: add parameter for 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, 13 Jun 2018 13:11:45 -0000 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