patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] mempool: fix internal function documentation
@ 2023-10-20 14:46 Ferruh Yigit
  2023-10-20 16:08 ` Morten Brørup
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-10-20 14:46 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko; +Cc: dev, stable, Mahesh Adulla

static function `rte_mempool_do_generic_get()` returns zero on success,
not >=0 as its function comment documents.

Since this function called by public API, the comment causes confusion
on the public API return value.

Fixing the internal function documentation for return value.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 .mailmap                  | 1 +
 lib/mempool/rte_mempool.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 3f5bab26a81f..bfe451980f1c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -836,6 +836,7 @@ Maciej Rabeda <maciej.rabeda@intel.com>
 Maciej Szwed <maciej.szwed@intel.com>
 Madhu Chittim <madhu.chittim@intel.com>
 Madhuker Mythri <madhuker.mythri@oracle.com>
+Mahesh Adulla <mahesh.adulla@amd.com>
 Mahipal Challa <mchalla@marvell.com>
 Mah Yock Gen <yock.gen.mah@intel.com>
 Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index f70bf36080fb..86598bc639e6 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -1484,7 +1484,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
  * @param cache
  *   A pointer to a mempool cache structure. May be NULL if not needed.
  * @return
- *   - >=0: Success; number of objects supplied.
+ *   - 0: Success; number of objects supplied.
  *   - <0: Error; code of driver dequeue function.
  */
 static __rte_always_inline int
-- 
2.34.1


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

* RE: [PATCH] mempool: fix internal function documentation
  2023-10-20 14:46 [PATCH] mempool: fix internal function documentation Ferruh Yigit
@ 2023-10-20 16:08 ` Morten Brørup
  2023-10-23  9:07   ` Ferruh Yigit
  2023-10-21  3:09 ` lihuisong (C)
  2023-10-23  9:38 ` [PATCH v2 1/2] " Ferruh Yigit
  2 siblings, 1 reply; 10+ messages in thread
From: Morten Brørup @ 2023-10-20 16:08 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, stable, Mahesh Adulla

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Friday, 20 October 2023 16.47
> 
> static function `rte_mempool_do_generic_get()` returns zero on success,
> not >=0 as its function comment documents.
> 
> Since this function called by public API, the comment causes confusion
> on the public API return value.
> 
> Fixing the internal function documentation for return value.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

I agree that this is the current situation, and is relied upon elsewhere in DPDK.

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>

However, the documentation for the mempool driver dequeue function type, rte_mempool_dequeue_t [1], does not specify allowed return values, so some future mempool driver might return a positive value. Please consider updating this too. (Also, the mempool driver enqueue/dequeue functions work on a bulk of objects, not "an object", as their documentation says.)

[1]: https://elixir.bootlin.com/dpdk/latest/source/lib/mempool/rte_mempool.h#L476


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

* Re: [PATCH] mempool: fix internal function documentation
  2023-10-20 14:46 [PATCH] mempool: fix internal function documentation Ferruh Yigit
  2023-10-20 16:08 ` Morten Brørup
@ 2023-10-21  3:09 ` lihuisong (C)
  2023-10-23  9:38 ` [PATCH v2 1/2] " Ferruh Yigit
  2 siblings, 0 replies; 10+ messages in thread
From: lihuisong (C) @ 2023-10-21  3:09 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, stable, Mahesh Adulla

Acked-by: Huisong Li <lihuisong@huawei.com>

在 2023/10/20 22:46, Ferruh Yigit 写道:
> static function `rte_mempool_do_generic_get()` returns zero on success,
> not >=0 as its function comment documents.
>
> Since this function called by public API, the comment causes confusion
> on the public API return value.
>
> Fixing the internal function documentation for return value.
>
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---
>   .mailmap                  | 1 +
>   lib/mempool/rte_mempool.h | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/.mailmap b/.mailmap
> index 3f5bab26a81f..bfe451980f1c 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -836,6 +836,7 @@ Maciej Rabeda <maciej.rabeda@intel.com>
>   Maciej Szwed <maciej.szwed@intel.com>
>   Madhu Chittim <madhu.chittim@intel.com>
>   Madhuker Mythri <madhuker.mythri@oracle.com>
> +Mahesh Adulla <mahesh.adulla@amd.com>
>   Mahipal Challa <mchalla@marvell.com>
>   Mah Yock Gen <yock.gen.mah@intel.com>
>   Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
> diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> index f70bf36080fb..86598bc639e6 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -1484,7 +1484,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
>    * @param cache
>    *   A pointer to a mempool cache structure. May be NULL if not needed.
>    * @return
> - *   - >=0: Success; number of objects supplied.
> + *   - 0: Success; number of objects supplied.
>    *   - <0: Error; code of driver dequeue function.
>    */
>   static __rte_always_inline int

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

* Re: [PATCH] mempool: fix internal function documentation
  2023-10-20 16:08 ` Morten Brørup
@ 2023-10-23  9:07   ` Ferruh Yigit
  0 siblings, 0 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-10-23  9:07 UTC (permalink / raw)
  To: Morten Brørup, Thomas Monjalon, Andrew Rybchenko
  Cc: dev, stable, Mahesh Adulla

On 10/20/2023 5:08 PM, Morten Brørup wrote:
>> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
>> Sent: Friday, 20 October 2023 16.47
>>
>> static function `rte_mempool_do_generic_get()` returns zero on success,
>> not >=0 as its function comment documents.
>>
>> Since this function called by public API, the comment causes confusion
>> on the public API return value.
>>
>> Fixing the internal function documentation for return value.
>>
>> Fixes: af75078fece3 ("first public release")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
>> ---
> 
> I agree that this is the current situation, and is relied upon elsewhere in DPDK.
> 
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> 
> However, the documentation for the mempool driver dequeue function type, rte_mempool_dequeue_t [1], does not specify allowed return values, so some future mempool driver might return a positive value. Please consider updating this too. (Also, the mempool driver enqueue/dequeue functions work on a bulk of objects, not "an object", as their documentation says.)
> 

Hi Morten,

Yes, mempool_ops are missing API parameter documentation, although this
is not directly related with this patch, I can update
'rte_mempool_dequeue_t' while I am around.


> [1]: https://elixir.bootlin.com/dpdk/latest/source/lib/mempool/rte_mempool.h#L476
> 


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

* [PATCH v2 1/2] mempool: fix internal function documentation
  2023-10-20 14:46 [PATCH] mempool: fix internal function documentation Ferruh Yigit
  2023-10-20 16:08 ` Morten Brørup
  2023-10-21  3:09 ` lihuisong (C)
@ 2023-10-23  9:38 ` Ferruh Yigit
  2023-10-23  9:38   ` [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type Ferruh Yigit
  2023-11-06 12:24   ` [PATCH v2 1/2] mempool: fix internal function documentation Andrew Rybchenko
  2 siblings, 2 replies; 10+ messages in thread
From: Ferruh Yigit @ 2023-10-23  9:38 UTC (permalink / raw)
  To: Thomas Monjalon, Andrew Rybchenko
  Cc: dev, stable, Mahesh Adulla, Morten Brørup, Huisong Li

static function `rte_mempool_do_generic_get()` returns zero on success,
not >=0 as its function comment documents.

Since this function called by public API, the comment causes confusion
on the public API return value.

Fixing the internal function documentation for return value.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Huisong Li <lihuisong@huawei.com>
---
 .mailmap                  | 1 +
 lib/mempool/rte_mempool.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index 3f5bab26a81f..bfe451980f1c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -836,6 +836,7 @@ Maciej Rabeda <maciej.rabeda@intel.com>
 Maciej Szwed <maciej.szwed@intel.com>
 Madhu Chittim <madhu.chittim@intel.com>
 Madhuker Mythri <madhuker.mythri@oracle.com>
+Mahesh Adulla <mahesh.adulla@amd.com>
 Mahipal Challa <mchalla@marvell.com>
 Mah Yock Gen <yock.gen.mah@intel.com>
 Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index f70bf36080fb..86598bc639e6 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -1484,7 +1484,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
  * @param cache
  *   A pointer to a mempool cache structure. May be NULL if not needed.
  * @return
- *   - >=0: Success; number of objects supplied.
+ *   - 0: Success; number of objects supplied.
  *   - <0: Error; code of driver dequeue function.
  */
 static __rte_always_inline int
-- 
2.34.1


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

* [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type
  2023-10-23  9:38 ` [PATCH v2 1/2] " Ferruh Yigit
@ 2023-10-23  9:38   ` Ferruh Yigit
  2023-10-23  9:43     ` Morten Brørup
  2023-11-06 12:24   ` [PATCH v2 1/2] mempool: fix internal function documentation Andrew Rybchenko
  1 sibling, 1 reply; 10+ messages in thread
From: Ferruh Yigit @ 2023-10-23  9:38 UTC (permalink / raw)
  To: Andrew Rybchenko, Olivier Matz, David Hunt, Shreyansh Jain
  Cc: dev, stable, Morten Brørup

API documentations doesn't clarify expected return types for enqueue and
dequeue mempool_ops, clarifying it.

Fixes: 449c49b93a6b ("mempool: support handler operations")
Cc: stable@dpdk.org

Reported-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
---
 lib/mempool/rte_mempool.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 86598bc639e6..8ed0386ba3f1 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -465,13 +465,19 @@ typedef int (*rte_mempool_alloc_t)(struct rte_mempool *mp);
 typedef void (*rte_mempool_free_t)(struct rte_mempool *mp);
 
 /**
- * Enqueue an object into the external pool.
+ * Enqueue 'n' objects into the external pool.
+ * @return
+ *   - 0: Success
+ *   - <0: Error
  */
 typedef int (*rte_mempool_enqueue_t)(struct rte_mempool *mp,
 		void * const *obj_table, unsigned int n);
 
 /**
- * Dequeue an object from the external pool.
+ * Dequeue 'n' objects from the external pool.
+ * @return
+ *   - 0: Success
+ *   - <0: Error
  */
 typedef int (*rte_mempool_dequeue_t)(struct rte_mempool *mp,
 		void **obj_table, unsigned int n);
-- 
2.34.1


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

* RE: [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type
  2023-10-23  9:38   ` [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type Ferruh Yigit
@ 2023-10-23  9:43     ` Morten Brørup
  2023-11-27 15:27       ` Thomas Monjalon
  0 siblings, 1 reply; 10+ messages in thread
From: Morten Brørup @ 2023-10-23  9:43 UTC (permalink / raw)
  To: Ferruh Yigit, Andrew Rybchenko, Olivier Matz, David Hunt, Shreyansh Jain
  Cc: dev, stable

> From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> Sent: Monday, 23 October 2023 11.39
and dequeue ops return type
> 
> API documentations doesn't clarify expected return types for enqueue and
> dequeue mempool_ops, clarifying it.
> 
> Fixes: 449c49b93a6b ("mempool: support handler operations")
> Cc: stable@dpdk.org
> 
> Reported-by: Morten Brørup <mb@smartsharesystems.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> ---

Thank you, Ferruh.

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>


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

* Re: [PATCH v2 1/2] mempool: fix internal function documentation
  2023-10-23  9:38 ` [PATCH v2 1/2] " Ferruh Yigit
  2023-10-23  9:38   ` [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type Ferruh Yigit
@ 2023-11-06 12:24   ` Andrew Rybchenko
  2023-11-27 14:41     ` Thomas Monjalon
  1 sibling, 1 reply; 10+ messages in thread
From: Andrew Rybchenko @ 2023-11-06 12:24 UTC (permalink / raw)
  To: Ferruh Yigit, Thomas Monjalon
  Cc: dev, stable, Mahesh Adulla, Morten Brørup, Huisong Li

On 10/23/23 12:38, Ferruh Yigit wrote:
> static function `rte_mempool_do_generic_get()` returns zero on success,
> not >=0 as its function comment documents.
> 
> Since this function called by public API, the comment causes confusion
> on the public API return value.
> 
> Fixing the internal function documentation for return value.
> 
> Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Reported-by: Mahesh Adulla <mahesh.adulla@amd.com>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Huisong Li <lihuisong@huawei.com>
> ---
>   .mailmap                  | 1 +
>   lib/mempool/rte_mempool.h | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/.mailmap b/.mailmap
> index 3f5bab26a81f..bfe451980f1c 100644
> --- a/.mailmap
> +++ b/.mailmap
> @@ -836,6 +836,7 @@ Maciej Rabeda <maciej.rabeda@intel.com>
>   Maciej Szwed <maciej.szwed@intel.com>
>   Madhu Chittim <madhu.chittim@intel.com>
>   Madhuker Mythri <madhuker.mythri@oracle.com>
> +Mahesh Adulla <mahesh.adulla@amd.com>
>   Mahipal Challa <mchalla@marvell.com>
>   Mah Yock Gen <yock.gen.mah@intel.com>
>   Mairtin o Loingsigh <mairtin.oloingsigh@intel.com>
> diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
> index f70bf36080fb..86598bc639e6 100644
> --- a/lib/mempool/rte_mempool.h
> +++ b/lib/mempool/rte_mempool.h
> @@ -1484,7 +1484,7 @@ rte_mempool_put(struct rte_mempool *mp, void *obj)
>    * @param cache
>    *   A pointer to a mempool cache structure. May be NULL if not needed.
>    * @return
> - *   - >=0: Success; number of objects supplied.
> + *   - 0: Success; number of objects supplied.

I think "number of objects supplied" does not make sense here any more.

>    *   - <0: Error; code of driver dequeue function.
>    */
>   static __rte_always_inline int


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

* Re: [PATCH v2 1/2] mempool: fix internal function documentation
  2023-11-06 12:24   ` [PATCH v2 1/2] mempool: fix internal function documentation Andrew Rybchenko
@ 2023-11-27 14:41     ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2023-11-27 14:41 UTC (permalink / raw)
  To: Ferruh Yigit, Andrew Rybchenko
  Cc: dev, stable, Mahesh Adulla, Morten Brørup, Huisong Li

06/11/2023 13:24, Andrew Rybchenko:
> On 10/23/23 12:38, Ferruh Yigit wrote:
> > - *   - >=0: Success; number of objects supplied.
> > + *   - 0: Success; number of objects supplied.
> 
> I think "number of objects supplied" does not make sense here any more.

Yes, will remove on apply.




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

* Re: [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type
  2023-10-23  9:43     ` Morten Brørup
@ 2023-11-27 15:27       ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2023-11-27 15:27 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: Andrew Rybchenko, Olivier Matz, David Hunt, Shreyansh Jain, dev,
	stable, Morten Brørup

23/10/2023 11:43, Morten Brørup:
> > From: Ferruh Yigit [mailto:ferruh.yigit@amd.com]
> > Sent: Monday, 23 October 2023 11.39
> and dequeue ops return type
> > 
> > API documentations doesn't clarify expected return types for enqueue and
> > dequeue mempool_ops, clarifying it.
> > 
> > Fixes: 449c49b93a6b ("mempool: support handler operations")
> > Cc: stable@dpdk.org
> > 
> > Reported-by: Morten Brørup <mb@smartsharesystems.com>
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@amd.com>
> > ---
> 
> Thank you, Ferruh.
> 
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>

Series applied, thanks.



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

end of thread, other threads:[~2023-11-27 15:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 14:46 [PATCH] mempool: fix internal function documentation Ferruh Yigit
2023-10-20 16:08 ` Morten Brørup
2023-10-23  9:07   ` Ferruh Yigit
2023-10-21  3:09 ` lihuisong (C)
2023-10-23  9:38 ` [PATCH v2 1/2] " Ferruh Yigit
2023-10-23  9:38   ` [PATCH v2 2/2] mempool: clarify enqueue and dequeue ops return type Ferruh Yigit
2023-10-23  9:43     ` Morten Brørup
2023-11-27 15:27       ` Thomas Monjalon
2023-11-06 12:24   ` [PATCH v2 1/2] mempool: fix internal function documentation Andrew Rybchenko
2023-11-27 14:41     ` 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).