From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id D71A41B8C9 for ; Wed, 27 Jun 2018 15:31:08 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id z137-v6so5550449wmc.0 for ; Wed, 27 Jun 2018 06:31:08 -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=SMAfy2D9SeKUiwQakUG7QA5CfeHYe7kmTHKLfOXrPtY=; b=OgRYiait4awj1+FLjDI/WYgzl73PDWJfXhiUYBEQex+Xspf+ph+RWaR45LHy4ayq5v h1sCq80EKix/ysV1Y0DIfxpirFMeu5rnhQnM3+bqUODIxiHznrBP+EwoNGJ/lGT+b9wz 2d0Lh2/OMsQFB4xfiKVTIy0Fvtr3ELIJZ9R8zQiHmDWx/RA21gD/xd6sVGuAwxjtqwBu 9COOFuPWOpQMRTIdBe8FH/rgtxma83ZwFeyhsFIAwirUWo0xl6q1ML4BvJgBhKtXpl8t x1inmWg000kM/azv4zOhTj1KqNTKieJmEuwdKGjtnmcDvsGMffiTMmK4Z+7lY7L9QRCy wSNw== 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=SMAfy2D9SeKUiwQakUG7QA5CfeHYe7kmTHKLfOXrPtY=; b=OH3mR6MLuu7hGU1rbGnRcZDcPMKlEvieo87L3TbqCc14Fv0J9S585A0URxQ0aOHaA2 aSqXOzAqgPcFpz+TT3r7I/wh34hUhum7/dzoC9rm/GSNNjiEYO+2jk2zAyniyXiK5D5D 4gNF+t+0MYhuMIlTAaoOnNNNxp5O5rYlcYLGg857ueDj386VPR+3teAYVn5NycFaiQqS FJG02HHn8BBwJe2vQPH0PL58ZPzfQZ0TT5a/e1r50Bz7Tkf/RskQe7+itWKSvaG7FjsF NCnagu4sfw61ErK8jFtpHErLYkqknqTctV97TJl15OdA5zWcTsOzBsCGZq0sR4PLf0v4 tJlg== X-Gm-Message-State: APt69E2ahzH4+X9vGWnFXMPb8HByrdMhYMQEMssYR7hUNe0/XdAfWzaL Nhxw9W7oAdC4wfoMBoplVmiG7A== X-Google-Smtp-Source: AAOMgpdHmdNzKI8TZzJYMMBNfGYsWRgQKMsHaqgw50CA1aVFK8133x7eb0qXJW+LdXXjNCPu1bDoGg== X-Received: by 2002:a1c:b94c:: with SMTP id j73-v6mr2247072wmf.104.1530106268612; Wed, 27 Jun 2018 06:31:08 -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 m3-v6sm3970396wro.27.2018.06.27.06.31.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 06:31:07 -0700 (PDT) Date: Wed, 27 Jun 2018 15:30:51 +0200 From: Adrien Mazarguil To: Shahaf Shuler Cc: "dev@dpdk.org" Message-ID: <20180627133051.GR4025@6wind.com> References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180614083047.10812-1-adrien.mazarguil@6wind.com> <20180614083047.10812-3-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 2/7] net/mlx5: remove redundant objects in probe code 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:31:09 -0000 Hey Shahaf, I couldn't reply earlier, sorry for that. See below. On Sun, Jun 17, 2018 at 10:14:01AM +0000, Shahaf Shuler wrote: > Hi Adrien, > > Small nit, > > Thursday, June 14, 2018 11:35 AM, Adrien Mazarguil: > > Subject: [PATCH v2 2/7] net/mlx5: remove redundant objects in probe code > > > > This patch gets rid of redundant calls to open the device and query its > > attributes in order to simplify the code. > > > > Signed-off-by: Adrien Mazarguil > > -- > > v2 changes: > > > > - Minor indent fix on existing code. > > --- > > drivers/net/mlx5/mlx5.c | 64 +++++++++++++++++++++----------------------- > > 1 file changed, 30 insertions(+), 34 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > > @@ -907,7 +904,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv > > __rte_unused, > > continue; > > } > > DRV_LOG(DEBUG, "using port %u", port); > > - ctx = mlx5_glue->open_device(ibv_dev); > > + if (!ctx) > > Is it really possible for ctx to be NULL on this stage? > Maybe assert is preferable? See below, ctx is only inherited (non-NULL) during the first iteration. It is reset and reopened for each instance since they need their own dedicated Verbs context. In any case, this patch focuses on removing redundant calls in preparation for subsequent patches in the series. This code disappears entirely later. > > + /* > > + * Each eth_dev instance is assigned its own Verbs context, > > + * since this one is consumed, let the next iteration open > > + * another. > > + */ > > + ctx = NULL; > > continue; No problem if I leave it that way? -- Adrien Mazarguil 6WIND