DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Hiroyuki Mikita <h.mikita89@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] mempool: fix check flags
Date: Thu, 8 Sep 2016 16:46:52 +0200	[thread overview]
Message-ID: <1dbf4474-40de-428f-1d17-e73709e642b2@6wind.com> (raw)
In-Reply-To: <39302a3a-9662-7f75-db3b-e7dd4244c32f@intel.com>

Hi Hiroki, Ferruh,

On 09/08/2016 04:44 PM, Ferruh Yigit wrote:
> On 9/8/2016 3:28 PM, Hiroyuki Mikita wrote:
>> fix check flags in case of single producer and single consumer
>>
>> Fixes: 449c49b9 ("mempool: support handler operations")
>>
>> Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
>> ---
>>  lib/librte_mempool/rte_mempool.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
>> index 2e28e2e..61bd63c 100644
>> --- a/lib/librte_mempool/rte_mempool.c
>> +++ b/lib/librte_mempool/rte_mempool.c
>> @@ -879,7 +879,7 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,
>>  	 * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to
>>  	 * set the correct index into the table of ops structs.
>>  	 */
>> -	if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET))
>> +	if ((flags & MEMPOOL_F_SP_PUT) & (flags & MEMPOOL_F_SC_GET))
> 
> Isn't this always false?
> 
> What about:
> if ((flags & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET))
> 
>>  		rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL);
>>  	else if (flags & MEMPOOL_F_SP_PUT)
>>  		rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL);
>>
> 

Looks the same kind of patch was posted few hours before:
http://dpdk.org/dev/patchwork/patch/15686/

Regards,
Olivier

  reply	other threads:[~2016-09-08 14:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 14:28 Hiroyuki Mikita
2016-09-08 14:44 ` Ferruh Yigit
2016-09-08 14:46   ` Olivier Matz [this message]
2016-09-08 15:29     ` Hiroyuki Mikita

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=1dbf4474-40de-428f-1d17-e73709e642b2@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=h.mikita89@gmail.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).