DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
@ 2016-10-13  9:37 Wei Dai
  2016-10-13  9:46 ` Sergio Gonzalez Monroy
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Wei Dai @ 2016-10-13  9:37 UTC (permalink / raw)
  To: dev, sergio.gonzalez.monroy, jianfeng.tan, wei.dai

paddr[i] + pg_sz always points to the start physical address of the
2nd page after pddr[i], so only up to 2 pages can be combinded to
be used. With this revision, more than 2 pages can be used.

Fixes: 84121f197187 ("mempool: store memory chunks in a list")

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 lib/librte_mempool/rte_mempool.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index 71017e1..e3e254a 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
 
 	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
 
+		phys_addr_t paddr_next;
+		paddr_next = paddr[i] + pg_sz;
+
 		/* populate with the largest group of contiguous pages */
 		for (n = 1; (i + n) < pg_num &&
-			     paddr[i] + pg_sz == paddr[i+n]; n++)
+			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
 			;
 
 		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13  9:37 [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages Wei Dai
@ 2016-10-13  9:46 ` Sergio Gonzalez Monroy
  2016-10-13  9:53 ` Ananyev, Konstantin
  2016-10-25 15:01 ` [dpdk-dev] [PATCH v2] " Olivier Matz
  2 siblings, 0 replies; 11+ messages in thread
From: Sergio Gonzalez Monroy @ 2016-10-13  9:46 UTC (permalink / raw)
  To: Wei Dai, dev, jianfeng.tan, Olivier MATZ

+Olivier

On 13/10/2016 10:37, Wei Dai wrote:
> paddr[i] + pg_sz always points to the start physical address of the
> 2nd page after pddr[i], so only up to 2 pages can be combinded to
> be used. With this revision, more than 2 pages can be used.
>
> Fixes: 84121f197187 ("mempool: store memory chunks in a list")
>
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> ---
>   lib/librte_mempool/rte_mempool.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
> index 71017e1..e3e254a 100644
> --- a/lib/librte_mempool/rte_mempool.c
> +++ b/lib/librte_mempool/rte_mempool.c
> @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
>   
>   	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
>   
> +		phys_addr_t paddr_next;
> +		paddr_next = paddr[i] + pg_sz;
> +
>   		/* populate with the largest group of contiguous pages */
>   		for (n = 1; (i + n) < pg_num &&
> -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
>   			;
>   
>   		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13  9:37 [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages Wei Dai
  2016-10-13  9:46 ` Sergio Gonzalez Monroy
@ 2016-10-13  9:53 ` Ananyev, Konstantin
  2016-10-13  9:59   ` Ananyev, Konstantin
  2016-10-25 15:01 ` [dpdk-dev] [PATCH v2] " Olivier Matz
  2 siblings, 1 reply; 11+ messages in thread
From: Ananyev, Konstantin @ 2016-10-13  9:53 UTC (permalink / raw)
  To: Dai, Wei, dev, Gonzalez Monroy, Sergio, Tan, Jianfeng, Dai, Wei

Hi 

> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> ---
>  lib/librte_mempool/rte_mempool.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
> index 71017e1..e3e254a 100644
> --- a/lib/librte_mempool/rte_mempool.c
> +++ b/lib/librte_mempool/rte_mempool.c
> @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
> 
>  	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
> 
> +		phys_addr_t paddr_next;
> +		paddr_next = paddr[i] + pg_sz;
> +
>  		/* populate with the largest group of contiguous pages */
>  		for (n = 1; (i + n) < pg_num &&
> -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
>  			;

Good catch.
Why not just paddr[i + n - 1] != paddr[i + n]?
Then you don't need extra variable (paddr_next) here.
Konstantin

> 
>  		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
> --
> 2.7.4

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13  9:53 ` Ananyev, Konstantin
@ 2016-10-13  9:59   ` Ananyev, Konstantin
  2016-10-13 11:52     ` Dai, Wei
  0 siblings, 1 reply; 11+ messages in thread
From: Ananyev, Konstantin @ 2016-10-13  9:59 UTC (permalink / raw)
  To: Ananyev, Konstantin, Dai, Wei, dev, Gonzalez Monroy, Sergio, Tan,
	Jianfeng, Dai, Wei



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ananyev, Konstantin
> Sent: Thursday, October 13, 2016 10:54 AM
> To: Dai, Wei <wei.dai@intel.com>; dev@dpdk.org; Gonzalez Monroy, Sergio <sergio.gonzalez.monroy@intel.com>; Tan, Jianfeng
> <jianfeng.tan@intel.com>; Dai, Wei <wei.dai@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
> 
> Hi
> 
> >
> > Signed-off-by: Wei Dai <wei.dai@intel.com>
> > ---
> >  lib/librte_mempool/rte_mempool.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
> > index 71017e1..e3e254a 100644
> > --- a/lib/librte_mempool/rte_mempool.c
> > +++ b/lib/librte_mempool/rte_mempool.c
> > @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
> >
> >  	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
> >
> > +		phys_addr_t paddr_next;
> > +		paddr_next = paddr[i] + pg_sz;
> > +
> >  		/* populate with the largest group of contiguous pages */
> >  		for (n = 1; (i + n) < pg_num &&
> > -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> > +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
> >  			;
> 
> Good catch.
> Why not just paddr[i + n - 1] != paddr[i + n]?

Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.

> Then you don't need extra variable (paddr_next) here.
> Konstantin
> 
> >
> >  		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
> > --
> > 2.7.4

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13  9:59   ` Ananyev, Konstantin
@ 2016-10-13 11:52     ` Dai, Wei
  2016-10-13 12:31       ` Ananyev, Konstantin
  0 siblings, 1 reply; 11+ messages in thread
From: Dai, Wei @ 2016-10-13 11:52 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev, Gonzalez Monroy, Sergio, Tan, Jianfeng

> > > diff --git a/lib/librte_mempool/rte_mempool.c
> > > b/lib/librte_mempool/rte_mempool.c
> > > index 71017e1..e3e254a 100644
> > > --- a/lib/librte_mempool/rte_mempool.c
> > > +++ b/lib/librte_mempool/rte_mempool.c
> > > @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct
> > > rte_mempool *mp, char *vaddr,
> > >
> > >  	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
> > >
> > > +		phys_addr_t paddr_next;
> > > +		paddr_next = paddr[i] + pg_sz;
> > > +
> > >  		/* populate with the largest group of contiguous pages */
> > >  		for (n = 1; (i + n) < pg_num &&
> > > -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> > > +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
> > >  			;
> >
> > Good catch.
> > Why not just paddr[i + n - 1] != paddr[i + n]?
> 
> Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.
> 
> > Then you don't need extra variable (paddr_next) here.
> > Konstantin

Thank you, Konstantin
'paddr[i + n - 1] + pg_sz = paddr[i + n]' also can fix it and have straight meaning. 
But I assume that my revision with paddr_next += pg_sz may have a bit better performance.
By the way, paddr[i] + n * pg_sz = paddr[i + n] can also resolve it.

/Wei

> >
> > >
> > >  		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
> > > --
> > > 2.7.4

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13 11:52     ` Dai, Wei
@ 2016-10-13 12:31       ` Ananyev, Konstantin
  2016-10-13 15:05         ` Olivier MATZ
  0 siblings, 1 reply; 11+ messages in thread
From: Ananyev, Konstantin @ 2016-10-13 12:31 UTC (permalink / raw)
  To: Dai, Wei, dev, Gonzalez Monroy, Sergio, Tan, Jianfeng


> 
> > > > diff --git a/lib/librte_mempool/rte_mempool.c
> > > > b/lib/librte_mempool/rte_mempool.c
> > > > index 71017e1..e3e254a 100644
> > > > --- a/lib/librte_mempool/rte_mempool.c
> > > > +++ b/lib/librte_mempool/rte_mempool.c
> > > > @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct
> > > > rte_mempool *mp, char *vaddr,
> > > >
> > > >  	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
> > > >
> > > > +		phys_addr_t paddr_next;
> > > > +		paddr_next = paddr[i] + pg_sz;
> > > > +
> > > >  		/* populate with the largest group of contiguous pages */
> > > >  		for (n = 1; (i + n) < pg_num &&
> > > > -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> > > > +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
> > > >  			;
> > >
> > > Good catch.
> > > Why not just paddr[i + n - 1] != paddr[i + n]?
> >
> > Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.
> >
> > > Then you don't need extra variable (paddr_next) here.
> > > Konstantin
> 
> Thank you, Konstantin
> 'paddr[i + n - 1] + pg_sz = paddr[i + n]' also can fix it and have straight meaning.
> But I assume that my revision with paddr_next += pg_sz may have a bit better performance.

I don't think there would be any real difference, again it is not performance critical code-path.

> By the way, paddr[i] + n * pg_sz = paddr[i + n] can also resolve it.

Yes, that's one seems even better for me - make things more clear.
Konstantin

> 
> /Wei
> 
> > >
> > > >
> > > >  		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
> > > > --
> > > > 2.7.4

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13 12:31       ` Ananyev, Konstantin
@ 2016-10-13 15:05         ` Olivier MATZ
  2016-10-25 14:37           ` Thomas Monjalon
  0 siblings, 1 reply; 11+ messages in thread
From: Olivier MATZ @ 2016-10-13 15:05 UTC (permalink / raw)
  To: Ananyev, Konstantin, Dai, Wei, dev, Gonzalez Monroy, Sergio, Tan,
	Jianfeng

Hi Wei,

On 10/13/2016 02:31 PM, Ananyev, Konstantin wrote:
>
>>
>>>>> diff --git a/lib/librte_mempool/rte_mempool.c
>>>>> b/lib/librte_mempool/rte_mempool.c
>>>>> index 71017e1..e3e254a 100644
>>>>> --- a/lib/librte_mempool/rte_mempool.c
>>>>> +++ b/lib/librte_mempool/rte_mempool.c
>>>>> @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct
>>>>> rte_mempool *mp, char *vaddr,
>>>>>
>>>>>   	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
>>>>>
>>>>> +		phys_addr_t paddr_next;
>>>>> +		paddr_next = paddr[i] + pg_sz;
>>>>> +
>>>>>   		/* populate with the largest group of contiguous pages */
>>>>>   		for (n = 1; (i + n) < pg_num &&
>>>>> -			     paddr[i] + pg_sz == paddr[i+n]; n++)
>>>>> +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
>>>>>   			;
>>>>
>>>> Good catch.
>>>> Why not just paddr[i + n - 1] != paddr[i + n]?
>>>
>>> Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.
>>>
>>>> Then you don't need extra variable (paddr_next) here.
>>>> Konstantin
>>
>> Thank you, Konstantin
>> 'paddr[i + n - 1] + pg_sz = paddr[i + n]' also can fix it and have straight meaning.
>> But I assume that my revision with paddr_next += pg_sz may have a bit better performance.
>
> I don't think there would be any real difference, again it is not performance critical code-path.
>
>> By the way, paddr[i] + n * pg_sz = paddr[i + n] can also resolve it.
>
> Yes, that's one seems even better for me - make things more clear.

Thank you for fixing this.

My vote would go for "addr[i + n - 1] + pg_sz == paddr[i + n]"

If you feel "paddr[i] + n * pg_sz = paddr[i + n]" is clearer, I have no 
problem with it either.

Regards,
Olivier

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-13 15:05         ` Olivier MATZ
@ 2016-10-25 14:37           ` Thomas Monjalon
  2016-10-25 14:56             ` Olivier Matz
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Monjalon @ 2016-10-25 14:37 UTC (permalink / raw)
  To: Olivier MATZ
  Cc: dev, Ananyev, Konstantin, Dai, Wei, Gonzalez Monroy, Sergio, Tan,
	Jianfeng

2016-10-13 17:05, Olivier MATZ:
> Hi Wei,
> 
> On 10/13/2016 02:31 PM, Ananyev, Konstantin wrote:
> >
> >>
> >>>>> diff --git a/lib/librte_mempool/rte_mempool.c
> >>>>> b/lib/librte_mempool/rte_mempool.c
> >>>>> index 71017e1..e3e254a 100644
> >>>>> --- a/lib/librte_mempool/rte_mempool.c
> >>>>> +++ b/lib/librte_mempool/rte_mempool.c
> >>>>> @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct
> >>>>> rte_mempool *mp, char *vaddr,
> >>>>>
> >>>>>   	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
> >>>>>
> >>>>> +		phys_addr_t paddr_next;
> >>>>> +		paddr_next = paddr[i] + pg_sz;
> >>>>> +
> >>>>>   		/* populate with the largest group of contiguous pages */
> >>>>>   		for (n = 1; (i + n) < pg_num &&
> >>>>> -			     paddr[i] + pg_sz == paddr[i+n]; n++)
> >>>>> +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
> >>>>>   			;
> >>>>
> >>>> Good catch.
> >>>> Why not just paddr[i + n - 1] != paddr[i + n]?
> >>>
> >>> Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.
> >>>
> >>>> Then you don't need extra variable (paddr_next) here.
> >>>> Konstantin
> >>
> >> Thank you, Konstantin
> >> 'paddr[i + n - 1] + pg_sz = paddr[i + n]' also can fix it and have straight meaning.
> >> But I assume that my revision with paddr_next += pg_sz may have a bit better performance.
> >
> > I don't think there would be any real difference, again it is not performance critical code-path.
> >
> >> By the way, paddr[i] + n * pg_sz = paddr[i + n] can also resolve it.
> >
> > Yes, that's one seems even better for me - make things more clear.
> 
> Thank you for fixing this.
> 
> My vote would go for "addr[i + n - 1] + pg_sz == paddr[i + n]"
> 
> If you feel "paddr[i] + n * pg_sz = paddr[i + n]" is clearer, I have no 
> problem with it either.

No answer from Wei Dai.
Please Olivier advise what to do with this patch.
Thanks

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

* Re: [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages
  2016-10-25 14:37           ` Thomas Monjalon
@ 2016-10-25 14:56             ` Olivier Matz
  0 siblings, 0 replies; 11+ messages in thread
From: Olivier Matz @ 2016-10-25 14:56 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, Ananyev, Konstantin, Dai, Wei, Gonzalez Monroy, Sergio, Tan,
	Jianfeng

Hi Thomas,

On 10/25/2016 04:37 PM, Thomas Monjalon wrote:
> 2016-10-13 17:05, Olivier MATZ:
>> Hi Wei,
>>
>> On 10/13/2016 02:31 PM, Ananyev, Konstantin wrote:
>>>
>>>>
>>>>>>> diff --git a/lib/librte_mempool/rte_mempool.c
>>>>>>> b/lib/librte_mempool/rte_mempool.c
>>>>>>> index 71017e1..e3e254a 100644
>>>>>>> --- a/lib/librte_mempool/rte_mempool.c
>>>>>>> +++ b/lib/librte_mempool/rte_mempool.c
>>>>>>> @@ -426,9 +426,12 @@ rte_mempool_populate_phys_tab(struct
>>>>>>> rte_mempool *mp, char *vaddr,
>>>>>>>
>>>>>>>   	for (i = 0; i < pg_num && mp->populated_size < mp->size; i += n) {
>>>>>>>
>>>>>>> +		phys_addr_t paddr_next;
>>>>>>> +		paddr_next = paddr[i] + pg_sz;
>>>>>>> +
>>>>>>>   		/* populate with the largest group of contiguous pages */
>>>>>>>   		for (n = 1; (i + n) < pg_num &&
>>>>>>> -			     paddr[i] + pg_sz == paddr[i+n]; n++)
>>>>>>> +			     paddr_next == paddr[i+n]; n++, paddr_next += pg_sz)
>>>>>>>   			;
>>>>>>
>>>>>> Good catch.
>>>>>> Why not just paddr[i + n - 1] != paddr[i + n]?
>>>>>
>>>>> Sorry, I meant 'paddr[i + n - 1] + pg_sz == paddr[i+n]' off course.
>>>>>
>>>>>> Then you don't need extra variable (paddr_next) here.
>>>>>> Konstantin
>>>>
>>>> Thank you, Konstantin
>>>> 'paddr[i + n - 1] + pg_sz = paddr[i + n]' also can fix it and have straight meaning.
>>>> But I assume that my revision with paddr_next += pg_sz may have a bit better performance.
>>>
>>> I don't think there would be any real difference, again it is not performance critical code-path.
>>>
>>>> By the way, paddr[i] + n * pg_sz = paddr[i + n] can also resolve it.
>>>
>>> Yes, that's one seems even better for me - make things more clear.
>>
>> Thank you for fixing this.
>>
>> My vote would go for "addr[i + n - 1] + pg_sz == paddr[i + n]"
>>
>> If you feel "paddr[i] + n * pg_sz = paddr[i + n]" is clearer, I have no 
>> problem with it either.
> 
> No answer from Wei Dai.
> Please Olivier advise what to do with this patch.
> Thanks
> 

I think it's good to have this fix in 16.11.
I'm sending a v2 based on Wei's patch.

Olivier

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

* [dpdk-dev] [PATCH v2] mempool: fix search of maximum contiguous pages
  2016-10-13  9:37 [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages Wei Dai
  2016-10-13  9:46 ` Sergio Gonzalez Monroy
  2016-10-13  9:53 ` Ananyev, Konstantin
@ 2016-10-25 15:01 ` Olivier Matz
  2016-10-25 21:23   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
  2 siblings, 1 reply; 11+ messages in thread
From: Olivier Matz @ 2016-10-25 15:01 UTC (permalink / raw)
  To: dev, wei.dai
  Cc: sergio.gonzalez.monroy, jianfeng.tan, thomas.monjalon, stable

From: Wei Dai <wei.dai@intel.com>

paddr[i] + pg_sz always points to the start physical address of the
2nd page after pddr[i], so only up to 2 pages can be combinded to
be used. With this revision, more than 2 pages can be used.

Fixes: 84121f197187 ("mempool: store memory chunks in a list")

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.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 71017e1..e94e56f 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -428,7 +428,7 @@ rte_mempool_populate_phys_tab(struct rte_mempool *mp, char *vaddr,
 
 		/* populate with the largest group of contiguous pages */
 		for (n = 1; (i + n) < pg_num &&
-			     paddr[i] + pg_sz == paddr[i+n]; n++)
+			     paddr[i + n - 1] + pg_sz == paddr[i + n]; n++)
 			;
 
 		ret = rte_mempool_populate_phys(mp, vaddr + i * pg_sz,
-- 
2.8.1

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH v2] mempool: fix search of maximum contiguous pages
  2016-10-25 15:01 ` [dpdk-dev] [PATCH v2] " Olivier Matz
@ 2016-10-25 21:23   ` Thomas Monjalon
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Monjalon @ 2016-10-25 21:23 UTC (permalink / raw)
  To: Olivier Matz, wei.dai; +Cc: dev, stable

2016-10-25 17:01, Olivier Matz:
> From: Wei Dai <wei.dai@intel.com>
> 
> paddr[i] + pg_sz always points to the start physical address of the
> 2nd page after pddr[i], so only up to 2 pages can be combinded to
> be used. With this revision, more than 2 pages can be used.
> 
> Fixes: 84121f197187 ("mempool: store memory chunks in a list")
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

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

end of thread, other threads:[~2016-10-25 21:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-13  9:37 [dpdk-dev] [PATCH] mempool: fix search of maximum contiguous pages Wei Dai
2016-10-13  9:46 ` Sergio Gonzalez Monroy
2016-10-13  9:53 ` Ananyev, Konstantin
2016-10-13  9:59   ` Ananyev, Konstantin
2016-10-13 11:52     ` Dai, Wei
2016-10-13 12:31       ` Ananyev, Konstantin
2016-10-13 15:05         ` Olivier MATZ
2016-10-25 14:37           ` Thomas Monjalon
2016-10-25 14:56             ` Olivier Matz
2016-10-25 15:01 ` [dpdk-dev] [PATCH v2] " Olivier Matz
2016-10-25 21:23   ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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