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 72CBCA84C for ; Wed, 24 Jan 2018 09:15:53 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id g1so6646860wmg.2 for ; Wed, 24 Jan 2018 00:15:53 -0800 (PST) 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:content-transfer-encoding:in-reply-to :user-agent; bh=cdzer3Inka7QED1vu7NkPBFiZICrZAOAGhpO8HnBOGQ=; b=vjpzU//LRYRikvI7ju+EDPbLDyyp36I2WNFRwjWNFYWVO2feM/MlpJxsmTdvLPDT9q GGT8AmMcd2lqkIccis/PaMwB+q+z4QMccbAY2wDuSIIsgOd09j4URIWWORup0s/AJRwe b+WCnKua/w1ldDazobUJRsLeAbDyGcwzOYtUqu+6N8xaf4IGr6v16JK0lv6S/iMKiqe/ I69n4VHE6Kv+S9qpMdE68DNRn4pjpi7DH/ZmohBfwoBeAlrqVu0F8jfQDwE7MwcLZec1 IzEFh/ckpN2n90/1dse+Kwxtd9ZyFShH8sOe6i81+QzH8PHZTFDB7jXjb34ZaWX25I3f jkug== 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:content-transfer-encoding :in-reply-to:user-agent; bh=cdzer3Inka7QED1vu7NkPBFiZICrZAOAGhpO8HnBOGQ=; b=lEg5awXj19Rm6YCAUVvRnD/3HcrABBTScGoXS0CAJBHa++yjDh+IGFbaeC7YcX4ggq HTYooqLOKSUqMQdpg7uMEJ3st3jW24QvSWasVi/ZQsEiKLOAzTff4EFCLG6Tq0YBUJmR JjgxlVJ+ybEIl/fP/+A9F3BH9MDOmv2Cn3Bu694VL5sKz4hu/eBYFiKQfTbxBgPiNu2X Yoj+eX+ROWi7qZ0Yq6FVl5fSe1QbRGOFbBp6l3WiBFGT4iIHYiAhK5aFySsqJVIi7yOQ IiR1N3suKECHtys85li7bXntAWZnyet+dr7zv11QoqhyY7oM3m4/Nq5Y32ZtueFejGld VGbg== X-Gm-Message-State: AKwxytfWdr1NBZCXmflqM40x8pp5ZAJEImXsLuRvKsA1quz+dmNU0HP9 7OYH0sYF3cqXe+oUSKsP02qD X-Google-Smtp-Source: AH8x2268iDtZiHnZs5/L2xcwh7XwjQ+hFVMuykKgGn25a1XP0dtiSEHl65zDRBkPnOmq7qh/Ihuo9A== X-Received: by 10.80.144.102 with SMTP id z35mr22503486edz.235.1516781752978; Wed, 24 Jan 2018 00:15:52 -0800 (PST) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id h1sm14433020edb.95.2018.01.24.00.15.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jan 2018 00:15:52 -0800 (PST) Date: Wed, 24 Jan 2018 09:15:52 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: yskoh@mellanox.com, adrien.mazarguil@6wind.com, dev@dpdk.org, Xueming Li Message-ID: <20180124081552.jlfgsqiwxvhfjlfn@laranjeiro-vm.dev.6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 3/5] net/mlx5: assert for un-successful memory registration 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, 24 Jan 2018 08:15:53 -0000 Hi Shahaf, On Tue, Jan 23, 2018 at 07:08:21PM +0200, Shahaf Shuler wrote: > Memory registration can fail, add the proper assert for such scenario > for it at least to be visible in debug mode. > > Signed-off-by: Shahaf Shuler > Signed-off-by: Xueming Li > --- > drivers/net/mlx5/mlx5_rxtx.h | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h > index 79cdfc793..2934f9fb3 100644 > --- a/drivers/net/mlx5/mlx5_rxtx.h > +++ b/drivers/net/mlx5/mlx5_rxtx.h > @@ -589,6 +589,10 @@ mlx5_tx_mb2mr(struct mlx5_txq_data *txq, struct rte_mbuf *mb) > if (mr) { > rte_atomic32_inc(&mr->refcnt); > return mr->lkey; > + } else { > + WARN("Failed to register mempool 0x%p(%s)", > + (void *)mp, mp->name); > + assert(mr != NULL); This assert seems wrong. Why this assert, you don't trust the CPU to verify the pointer is NULL? > } > return (uint32_t)-1; > } > -- > 2.12.0 Regards, -- Nélio Laranjeiro 6WIND