From: Yongseok Koh <yskoh@mellanox.com>
To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com
Cc: dev@dpdk.org, Yongseok Koh <yskoh@mellanox.com>,
Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: fix alignment of Memory Region
Date: Tue, 17 Apr 2018 11:39:13 -0700 [thread overview]
Message-ID: <20180417183914.10175-1-yskoh@mellanox.com> (raw)
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>
---
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
next reply other threads:[~2018-04-17 18:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 18:39 Yongseok Koh [this message]
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 ` [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=20180417183914.10175-1-yskoh@mellanox.com \
--to=yskoh@mellanox.com \
--cc=adrien.mazarguil@6wind.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=nelio.laranjeiro@6wind.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).