DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mempool: fix check flags
@ 2016-09-08 14:28 Hiroyuki Mikita
  2016-09-08 14:44 ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Hiroyuki Mikita @ 2016-09-08 14:28 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev

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))
 		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);
-- 
2.7.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] mempool: fix check flags
  2016-09-08 14:28 [dpdk-dev] [PATCH] mempool: fix check flags Hiroyuki Mikita
@ 2016-09-08 14:44 ` Ferruh Yigit
  2016-09-08 14:46   ` Olivier Matz
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2016-09-08 14:44 UTC (permalink / raw)
  To: Hiroyuki Mikita, olivier.matz; +Cc: dev

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);
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] mempool: fix check flags
  2016-09-08 14:44 ` Ferruh Yigit
@ 2016-09-08 14:46   ` Olivier Matz
  2016-09-08 15:29     ` Hiroyuki Mikita
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Matz @ 2016-09-08 14:46 UTC (permalink / raw)
  To: Ferruh Yigit, Hiroyuki Mikita; +Cc: dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] mempool: fix check flags
  2016-09-08 14:46   ` Olivier Matz
@ 2016-09-08 15:29     ` Hiroyuki Mikita
  0 siblings, 0 replies; 4+ messages in thread
From: Hiroyuki Mikita @ 2016-09-08 15:29 UTC (permalink / raw)
  To: Olivier Matz; +Cc: Ferruh Yigit, dev

Sorry,
I did not notice the same kind of patch.
I close this patch.

Hiroyuki

2016-09-08 23:46 GMT+09:00 Olivier Matz <olivier.matz@6wind.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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-08 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-08 14:28 [dpdk-dev] [PATCH] mempool: fix check flags Hiroyuki Mikita
2016-09-08 14:44 ` Ferruh Yigit
2016-09-08 14:46   ` Olivier Matz
2016-09-08 15:29     ` Hiroyuki Mikita

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).