DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Nélio Laranjeiro" <nelio.laranjeiro@6wind.com>
To: Yongseok Koh <yskoh@mellanox.com>
Cc: adrien.mazarguil@6wind.com, dev@dpdk.org,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] net/mlx5: fix alignment of Memory Region
Date: Wed, 18 Apr 2018 08:43:20 +0200	[thread overview]
Message-ID: <20180418064320.sbxv4gmuu6gwextp@laranjeiro-vm.dev.6wind.com> (raw)
In-Reply-To: <20180417183914.10175-1-yskoh@mellanox.com>

On Tue, Apr 17, 2018 at 11:39:13AM -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: 718e35999c96 ("net/mlx5: use virt2memseg instead of iteration")
> Cc: Anatoly Burakov <anatoly.burakov@intel.com>
> 
> Signed-off-by: Yongseok Koh <yskoh@mellanox.com>

Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

> ---
>  drivers/net/mlx5/mlx5_mr.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c
> index fdf7b3e88..39bbe2481 100644
> --- a/drivers/net/mlx5/mlx5_mr.c
> +++ b/drivers/net/mlx5/mlx5_mr.c
> @@ -265,9 +265,7 @@ mlx5_mr_new(struct rte_eth_dev *dev, 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);
>  
>  	DRV_LOG(DEBUG,
>  		"port %u mempool %p using start=%p end=%p size=%zu for memory"
> -- 
> 2.11.0
> 

-- 
Nélio Laranjeiro
6WIND

  parent reply	other threads:[~2018-04-18  6:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17 18:39 Yongseok Koh
2018-04-17 18:39 ` [dpdk-dev] [PATCH 2/2] net/mlx4: " Yongseok Koh
2018-04-18  8:05   ` Adrien Mazarguil
2018-04-18  6:43 ` Nélio Laranjeiro [this message]
2018-04-22  9:09   ` [dpdk-dev] [PATCH 1/2] net/mlx5: " 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=20180418064320.sbxv4gmuu6gwextp@laranjeiro-vm.dev.6wind.com \
    --to=nelio.laranjeiro@6wind.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --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).