From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f48.google.com (mail-qg0-f48.google.com [209.85.192.48]) by dpdk.org (Postfix) with ESMTP id 5E14F2C5B for ; Mon, 13 Jun 2016 10:51:54 +0200 (CEST) Received: by mail-qg0-f48.google.com with SMTP id v48so46179554qgd.2 for ; Mon, 13 Jun 2016 01:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=reFjWD8/iJ0d1ri+hDm3/7pX1Oa6KQld3toidWuvf/o=; b=eQMNktK8a3ok8GP+Iz5gIZX+BLU034fdVbcP4p7hg+kArr+UYuN1I4hiZ4n1c1ICIr UBvhYkVsxM07V90FiegIJZFaeQnRwgAqlZabQW5dv/mFiLpHCS7v2Kzefvgb4sYiJuo3 wafld06cKTKLwh0+6SXYkNI2O83Zz1ivfB4iuz0GMhyKQo39emNpoYlsKQqqmM3kp+ho VaXC1O1iAuIJXB5kUiQG4zI8W3aFpTbRosO7/r4pipn8N0RRTCXkeIjS2hraSJVTklfc WebJKTFou36Y9WFH9LqN+iSKfoKmFmkrkabvj13AR3wvdXAMeBmeJGBuNb/Eegb85r+Z k99w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=reFjWD8/iJ0d1ri+hDm3/7pX1Oa6KQld3toidWuvf/o=; b=eLZB8W8yqSDJ0cXhH37fzdaX4yp+zTGPfIBXTzxslDUQc5OO3jJQB+ijTOzTFu7a3p FRx+sqOStB/hnxU7l+W+uwGOdNNqXmOy7TGGExeaeBjZng6AiIla22Zr3WeUiEkyMGo0 jc/RQcbuooQeyUsPhafFPGpcuueS9h48s/3RUkyoYSDPkt9TF4BfE4BbgsqqirC3LRD1 ueQzo98g0j82pM3OOh19al792WCLrCB/EUMl3bQzBkANofNMoExQop1QAqBAtLfwWsxD mwxL80/DoYcvgfj9Ozr1Aa5o5Oq1wiTmQvVR/R68+xCpFSP9YWAknvcvRCxu0BEGHDBC txRA== X-Gm-Message-State: ALyK8tImI2/J54WZEQG2RWQwQoVxnsEKfZJ4De5f2apXVXK3VJw3AKej2pOc/B1L04HBfcsC+0GSkbp70+wiOpU6 X-Received: by 10.140.41.164 with SMTP id z33mr2802910qgz.54.1465807913820; Mon, 13 Jun 2016 01:51:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.162.9 with HTTP; Mon, 13 Jun 2016 01:51:34 -0700 (PDT) In-Reply-To: <1465806137-32619-1-git-send-email-olivier.matz@6wind.com> References: <575E6B60.3030403@6wind.com> <1465806137-32619-1-git-send-email-olivier.matz@6wind.com> From: Christian Ehrhardt Date: Mon, 13 Jun 2016 10:51:34 +0200 Message-ID: To: Olivier Matz Cc: David Marchand , dev Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] xenvirt: fix compilation after mempool changes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jun 2016 08:51:54 -0000 Hi Oliver, thanks for the fast response! It fixes the compilation issue and I totally agree to your argument of the multi-chunk issues being out of scope for this as they never worked. Unfortunately I lack an environment to actually test this in real-life if we need any more follow up than this. Acked-by: Christian Ehrhardt Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd On Mon, Jun 13, 2016 at 10:22 AM, Olivier Matz wrote: > 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 > Signed-off-by: Olivier Matz > --- > 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 > >