From: Olivier Matz <olivier.matz@6wind.com>
To: christian.ehrhardt@canonical.com, david.marchand@6wind.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] xenvirt: fix compilation after mempool changes
Date: Mon, 13 Jun 2016 10:22:17 +0200 [thread overview]
Message-ID: <1465806137-32619-1-git-send-email-olivier.matz@6wind.com> (raw)
In-Reply-To: <575E6B60.3030403@6wind.com>
The field elt_va_start has been removed from the mempool structure,
and it was not replaced in xenvirt.
Fix this by getting the mempool objects address by using the address of
the first memory chunk list.
Note that it won't work with mempool composed of several chunks,
but it was already the case before.
Fixes: 84121f197187 ("mempool: store memory chunks in a list")
Reported-by: Christian Ehrhard <christian.ehrhardt@canonical.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
drivers/net/xenvirt/rte_xen_lib.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c
index de63cd3..997e56e 100644
--- a/drivers/net/xenvirt/rte_xen_lib.c
+++ b/drivers/net/xenvirt/rte_xen_lib.c
@@ -423,6 +423,7 @@ grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *g
{
char key_str[PATH_MAX] = {0};
char val_str[PATH_MAX] = {0};
+ void *mempool_obj_va;
if (grant_node_create(pg_num, gref_arr, pa_arr, val_str, sizeof(val_str))) {
return -1;
@@ -437,7 +438,14 @@ grant_gntalloc_mbuf_pool(struct rte_mempool *mpool, uint32_t pg_num, uint32_t *g
if (snprintf(key_str, sizeof(key_str),
DPDK_XENSTORE_PATH"%d"MEMPOOL_VA_XENSTORE_STR, mempool_idx) == -1)
return -1;
- if (snprintf(val_str, sizeof(val_str), "%"PRIxPTR, (uintptr_t)mpool->elt_va_start) == -1)
+ if (mp->nb_mem_chunks != 1) {
+ RTE_LOG(ERR, PMD,
+ "mempool with more than 1 chunk is not supported\n");
+ return -1;
+ }
+ mempool_obj_va = STAILQ_FIRST(&mp->mem_list)->addr;
+ if (snprintf(val_str, sizeof(val_str), "%"PRIxPTR,
+ (uintptr_t)mempool_obj_va) == -1)
return -1;
if (xenstore_write(key_str, val_str) == -1)
return -1;
--
2.8.0.rc3
next prev parent reply other threads:[~2016-06-13 8:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 7:34 [dpdk-dev] Question regarding mempool changes impact to XEN PMD Christian Ehrhardt
2016-06-13 8:14 ` Olivier Matz
2016-06-13 8:22 ` Olivier Matz [this message]
2016-06-13 8:51 ` [dpdk-dev] [PATCH] xenvirt: fix compilation after mempool changes Christian Ehrhardt
2016-06-13 9:10 ` Christian Ehrhardt
2016-06-13 9:13 ` Olivier Matz
2016-06-13 11:24 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2016-06-13 11:54 ` Christian Ehrhardt
2016-06-16 15:52 ` Bruce Richardson
2016-06-13 8:30 ` [dpdk-dev] Question regarding mempool changes impact to XEN PMD Christian Ehrhardt
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=1465806137-32619-1-git-send-email-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=christian.ehrhardt@canonical.com \
--cc=david.marchand@6wind.com \
--cc=dev@dpdk.org \
/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).