DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] ivshmem: add all memzones of mempool to metada
Date: Wed, 1 Jun 2016 15:07:55 +0000	[thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E4512369782129EA3@IRSMSX109.ger.corp.intel.com> (raw)
In-Reply-To: <1464787086-29555-1-git-send-email-ferruh.yigit@intel.com>

> From: Yigit, Ferruh
> Sent: Wednesday, June 1, 2016 2:18 PM
> To: dev@dpdk.org
> Cc: Burakov, Anatoly <anatoly.burakov@intel.com>; Olivier Matz
> <olivier.matz@6wind.com>; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: [PATCH] ivshmem: add all memzones of mempool to metada
> 
> Mempool consist of multiple memzones, at least from two of them.
> ivshmem assumes mempool and elements are all in same memzone.
> 
> Updating code to add all memzones when a mempool added.
> 
> Fixes: d1d914ebbc25 ("mempool: allocate in several memory chunks by
> default")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>  lib/librte_ivshmem/rte_ivshmem.c | 30 ++++++++++++++++++++++--------
>  1 file changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/librte_ivshmem/rte_ivshmem.c
> b/lib/librte_ivshmem/rte_ivshmem.c
> index c8b332c..5c83920 100644
> --- a/lib/librte_ivshmem/rte_ivshmem.c
> +++ b/lib/librte_ivshmem/rte_ivshmem.c
> @@ -548,25 +548,39 @@ add_ring_to_metadata(const struct rte_ring * r,
>  }
> 
>  static int
> -add_mempool_to_metadata(const struct rte_mempool * mp,
> -		struct ivshmem_config * config)
> +add_mempool_memzone_to_metadata(const void *addr,
> +		struct ivshmem_config *config)
>  {
> -	struct rte_memzone * mz;
> -	int ret;
> +	struct rte_memzone *mz;
> 
> -	mz = get_memzone_by_addr(mp);
> -	ret = 0;
> +	mz = get_memzone_by_addr(addr);
> 
>  	if (!mz) {
>  		RTE_LOG(ERR, EAL, "Cannot find memzone for
> mempool!\n");
>  		return -1;
>  	}
> 
> -	/* mempool consists of memzone and ring */
> -	ret = add_memzone_to_metadata(mz, config);
> +	return add_memzone_to_metadata(mz, config);
> +}
> +
> +static int
> +add_mempool_to_metadata(const struct rte_mempool *mp,
> +		struct ivshmem_config *config)
> +{
> +	struct rte_mempool_memhdr *memhdr;
> +	int ret;
> +
> +	ret = add_mempool_memzone_to_metadata(mp, config);
>  	if (ret < 0)
>  		return -1;
> 
> +	STAILQ_FOREACH(memhdr, &mp->mem_list, next) {
> +		ret = add_mempool_memzone_to_metadata(memhdr-
> >addr, config);
> +		if (ret < 0)
> +			return -1;
> +	}
> +
> +	/* mempool consists of memzone and ring */
>  	return add_ring_to_metadata(mp->ring, config);
>  }
> 
> --
> 2.5.5

Acked-by: Anatoly  Burakov <anatoly.burakov@intel.com>

  reply	other threads:[~2016-06-01 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 13:18 Ferruh Yigit
2016-06-01 15:07 ` Burakov, Anatoly [this message]
2016-06-02  7:04 ` Olivier MATZ
2016-06-03 11:05   ` Ferruh Yigit
2016-06-03 16:29     ` Ferruh Yigit
2016-06-03 16:38       ` [dpdk-dev] [PATCH v2] ivshmem: add all memzones of mempool to metadata Ferruh Yigit
2016-06-07 10:08         ` Thomas Monjalon

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=C6ECDF3AB251BE4894318F4E4512369782129EA3@IRSMSX109.ger.corp.intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=olivier.matz@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).