From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <christian.ehrhardt@canonical.com>
Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com
 [209.85.220.178]) by dpdk.org (Postfix) with ESMTP id 67CE5475E
 for <dev@dpdk.org>; Mon, 13 Jun 2016 13:54:49 +0200 (CEST)
Received: by mail-qk0-f178.google.com with SMTP id c73so43142663qkg.2
 for <dev@dpdk.org>; Mon, 13 Jun 2016 04:54:49 -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=IekPHL+BDm2NOzJpb1eku1RSicRL2EjHQm8kfkehEv8=;
 b=XABiaN0oqRoGXGSfEoqNTAUAIYh8kPdD0oTjCngw3KRxa6F0p64wnKNdhH/DwSVb2U
 3Av+ZTyiO3Lq8QcqlG3xlu9NecqAAxWbzKJFuSYNSdVMpEpw83rlPlja7NXctKYEaJb5
 NCNfXj2iEoI8K6SeqeRa+FqVeOFgayArpHN2NPZu0L93iEvWfPLn4najUz1t4ZVp8gcP
 o/M7dRbPyFwr7ctJTnob8HHPOuFVBqKFuHPR3sTMd+U3W7y9azF85ZbGNe8i6ZWEWueM
 mRttFuap4kg9r611I8+XA0d5gE6XuuRW0gnsfzL2pzUZyvNjbsH6aKasax1MACVUYjfj
 yLbw==
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=IekPHL+BDm2NOzJpb1eku1RSicRL2EjHQm8kfkehEv8=;
 b=QZuYECbBP1nFZkpRNEtSlUludJgLrdg3PAI5tPANpaO3XKlUhqpwy2gTLfVzyW6KeH
 ccgsfSnETglP0Ng7ttOU7YUsllLGol/jmwFwhpq0fAQgDj1RMZkb9IaRUxR3T89DU94h
 KN3UqI2f4xLWIC1Jdm0AwI2FBHYl/t332VvYNmDv1dnn+qzBHSGiRFYAWPoY7J6FUKk2
 Y8wTfRIvxdP8i0YofcQOZR3u6qgnQxEIahuyarcoOS/atguUgG6W0ucJmZDwVuSSqTRj
 6g+IrRl5kUdTBbcpEVDhMS2hDlhUCq48HGVoUPQge56UlOXptUisGkiEUBqL9zHeT5L+
 y9Aw==
X-Gm-Message-State: ALyK8tLEFpiameY7COSotOiBA1Auj8b/kuHfQvzghijsTsq8wwkZbnYn/g0oax4hFZhR8xlX3ChFc1I8DmQWJ6oA
X-Received: by 10.55.161.204 with SMTP id k195mr14301655qke.193.1465818888853; 
 Mon, 13 Jun 2016 04:54:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.55.162.9 with HTTP; Mon, 13 Jun 2016 04:54:29 -0700 (PDT)
In-Reply-To: <1465817069-16587-1-git-send-email-olivier.matz@6wind.com>
References: <1465806137-32619-1-git-send-email-olivier.matz@6wind.com>
 <1465817069-16587-1-git-send-email-olivier.matz@6wind.com>
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Date: Mon, 13 Jun 2016 13:54:29 +0200
Message-ID: <CAATJJ0+OvGwco-v7rzhm3HeJfwvsKFv5SZVjGAsnZEb2LoOgjg@mail.gmail.com>
To: Olivier Matz <olivier.matz@6wind.com>
Cc: David Marchand <david.marchand@6wind.com>, dev <dev@dpdk.org>
Content-Type: text/plain; charset=UTF-8
X-Content-Filtered-By: Mailman/MimeDel 2.1.15
Subject: Re: [dpdk-dev] [PATCH v2] 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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Jun 2016 11:54:49 -0000

Yeah, working now - thanks for the fast update!

Kind Regards,
Christian

Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd

On Mon, Jun 13, 2016 at 1:24 PM, Olivier Matz <olivier.matz@6wind.com>
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 Ehrhardt <christian.ehrhardt@canonical.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> Acked-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
> ---
>
> v1->v2:
> - fix mempool variable name
> - fix typo in Reported-by
>
>  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..6c9a1d4 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;
> --
> 2.8.0.rc3
>
>