From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH 2/2] net/mlx4: fix alignment of Memory Region Date: Wed, 18 Apr 2018 10:05:57 +0200 Message-ID: <20180418080557.GK4957@6wind.com> References: <20180417183914.10175-1-yskoh@mellanox.com> <20180417183914.10175-2-yskoh@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: nelio.laranjeiro@6wind.com, dev@dpdk.org, Anatoly Burakov To: Yongseok Koh Return-path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 1DEBF8D3A for ; Wed, 18 Apr 2018 10:06:12 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id d1-v6so2151838wrj.13 for ; Wed, 18 Apr 2018 01:06:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180417183914.10175-2-yskoh@mellanox.com> 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, Apr 17, 2018 at 11:39:14AM -0700, Yongseok Koh wrote: > The memory region is [start, end), so if the memseg of 'end' isn't > allocated yet, the returned memseg will have zero entries and this will > make 'end' zero (nil). > > Fixes: c2fe5823224a ("net/mlx4: use virt2memseg instead of iteration") > Cc: Anatoly Burakov > > Signed-off-by: Yongseok Koh Acked-by: Adrien Mazarguil One nit in case another version is sent, please remove the unnecessary empty line in both patches, thanks. > --- > drivers/net/mlx4/mlx4_mr.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/mlx4/mlx4_mr.c b/drivers/net/mlx4/mlx4_mr.c > index e69b43322..f2dcbcb76 100644 > --- a/drivers/net/mlx4/mlx4_mr.c > +++ b/drivers/net/mlx4/mlx4_mr.c > @@ -144,9 +144,7 @@ mlx4_mr_get(struct priv *priv, struct rte_mempool *mp) > ms = rte_mem_virt2memseg((void *)start, NULL); > if (ms != NULL) > start = RTE_ALIGN_FLOOR(start, ms->hugepage_sz); > - ms = rte_mem_virt2memseg((void *)end, NULL); > - if (ms != NULL) > - end = RTE_ALIGN_CEIL(end, ms->hugepage_sz); > + end = RTE_ALIGN_CEIL(end, ms->hugepage_sz); > > DEBUG("mempool %p using start=%p end=%p size=%zu for MR", > (void *)mp, (void *)start, (void *)end, > -- > 2.11.0 > -- Adrien Mazarguil 6WIND