aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/xenvirt/rte_xen_lib.c
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-07-06 09:22:35 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2016-07-06 16:09:40 +0200
commit8b25d1ad5d2264bdfc2818c7bda74ee2697df6db (patch)
tree8c3c769777f7e66a2d1ba7dd7651b563cfde370b /drivers/net/xenvirt/rte_xen_lib.c
parent97f17497d162afdb82c8704bf097f0fee3724b2e (diff)
Imported Upstream version 16.07-rc1
Change-Id: I40a523e52f12e8496fdd69e902824b0226c303de Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'drivers/net/xenvirt/rte_xen_lib.c')
-rw-r--r--drivers/net/xenvirt/rte_xen_lib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/xenvirt/rte_xen_lib.c b/drivers/net/xenvirt/rte_xen_lib.c
index de63cd30..6c9a1d49 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 (mpool->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(&mpool->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;