All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>, dev@dpdk.org
Cc: Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [PATCH] ivshmem: add all memzones of mempool to metada
Date: Fri, 3 Jun 2016 17:29:07 +0100	[thread overview]
Message-ID: <5751B053.3080902@intel.com> (raw)
In-Reply-To: <5751646D.2080009@intel.com>

On 6/3/2016 12:05 PM, Ferruh Yigit wrote:
> On 6/2/2016 8:04 AM, Olivier MATZ wrote:
>> Hi Ferruh,
>>
>> Thank you for fixing this issue.
>>
>> On 06/01/2016 03:18 PM, Ferruh Yigit wrote:
>>> [PATCH] ivshmem: add all memzones of mempool to metada
>>
>> Minor comment: it seems the title is truncated
>>
> 
> Right, I will fix in next version of patch.
> 
>>> +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);
>>>  }
>>>  
>>
>> In case you missed it: there is a function
>> rte_mempool_mem_iter() that can be used to browse the
>> memory chunks of a mempool. It's probably less convenient
>> to use compared to directly browsing the list, but it
>> may be more resistant to api changes.
> 
> I wasn't aware rte_mempool_mem_iter(), I will update the patch to use this.
> 

Although I prefer using the rte_mempool_mem_iter(); it is not
straightforward because of the const qualifier of mp, and
rte_mempool_mem_iter() doesn't accepts the const type, and casting const
to non-const causes a compile warning:
_"error: cast discards ‘const’ qualifier from pointer target type"_

An option is duplicating mp, (or part of it mp->mem_list) but that is
ugly and can cause potentials defects in the future, another option is
to use uint64_t to do pointer conversion, even uglier :), so I don't
want to use this API for this case.

So, I will only update the patch title and send a v2.

>>
>> Apart from that:
>> Acked-by: Olivier Matz <olivier.matz@6wind.com>
>>
>> Thanks
>>
> 
> Thanks,
> ferruh
> 

  reply	other threads:[~2016-06-03 16:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 13:18 [PATCH] ivshmem: add all memzones of mempool to metada Ferruh Yigit
2016-06-01 15:07 ` Burakov, Anatoly
2016-06-02  7:04 ` Olivier MATZ
2016-06-03 11:05   ` Ferruh Yigit
2016-06-03 16:29     ` Ferruh Yigit [this message]
2016-06-03 16:38       ` [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=5751B053.3080902@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.