DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: nelio.laranjeiro@6wind.com, dev@dpdk.org,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [dpdk-dev] [PATCH 2/2] net/mlx4: fix alignment of Memory Region
Date: Wed, 18 Apr 2018 10:05:57 +0200	[thread overview]
Message-ID: <20180418080557.GK4957@6wind.com> (raw)
In-Reply-To: <20180417183914.10175-2-yskoh@mellanox.com>

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 <anatoly.burakov@intel.com>
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

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

  reply	other threads:[~2018-04-18  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 18:39 [dpdk-dev] [PATCH 1/2] net/mlx5: " Yongseok Koh
2018-04-17 18:39 ` [dpdk-dev] [PATCH 2/2] net/mlx4: " Yongseok Koh
2018-04-18  8:05   ` Adrien Mazarguil [this message]
2018-04-18  6:43 ` [dpdk-dev] [PATCH 1/2] net/mlx5: " Nélio Laranjeiro
2018-04-22  9:09   ` Shahaf Shuler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180418080557.GK4957@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).