Skip to contentSkip to conversation

mem: fix API doc about allocation on secondary processes

PATCH Applied Olivier Matz 3 participants 3 messages Sep 29, 2022 – Oct 4, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mem: fix API doc about allocation on secondary processes

Since 10 years, memzone allocation is allowed on secondary processes. Now it's time to update the documentation accordingly.

At the same time, fix mempool, mbuf and ring documentation which rely on memzones internally.

Bugzilla ID: 1074

Fixes 916e4f4f4e45 ("memory: fix for multi process support")
---
 lib/eal/include/rte_memzone.h | 3 ---
 lib/mbuf/rte_mbuf.h           | 3 ---
 lib/mempool/rte_mempool.h     | 1 -
 lib/ring/rte_ring.h           | 1 -
 lib/ring/rte_ring_elem.h      | 1 -
 5 files changed, 9 deletions(-)
lib/eal/include/rte_memzone.h +0 -3
index 5db1210831..bb4223a056 100644
@@ -118,7 +118,6 @@ struct rte_memzone {
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
  *    - ENOMEM - no appropriate memory area found in which to create memzone
@@ -184,7 +183,6 @@ const struct rte_memzone *rte_memzone_reserve(const char *name,
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
  *    - ENOMEM - no appropriate memory area found in which to create memzone
@@ -256,7 +254,6 @@ const struct rte_memzone *rte_memzone_reserve_aligned(const char *name,
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
  *    - ENOMEM - no appropriate memory area found in which to create memzone
lib/mbuf/rte_mbuf.h +0 -3
index 9811e8c760..b6e23d98ce 100644
@@ -664,7 +664,6 @@ void rte_pktmbuf_pool_init(struct rte_mempool *mp, void *opaque_arg);
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - cache size provided is too large, or priv_size is not aligned.
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
@@ -706,7 +705,6 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - cache size provided is too large, or priv_size is not aligned.
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
@@ -760,7 +758,6 @@ struct rte_pktmbuf_extmem {
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - cache size provided is too large, or priv_size is not aligned.
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
lib/mempool/rte_mempool.h +0 -1
index a3c4ee351d..4c4af2a8ed 100644
@@ -1023,7 +1023,6 @@ typedef void (rte_mempool_ctor_t)(struct rte_mempool *, void *);
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - cache size provided is too large or an unknown flag was passed
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
lib/ring/rte_ring.h +0 -1
index 980e92e594..7c48e35d27 100644
@@ -180,7 +180,6 @@ int rte_ring_init(struct rte_ring *r, const char *name, unsigned int count,
  *   On success, the pointer to the new allocated ring. NULL on error with
  *    rte_errno set appropriately. Possible errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - count provided is not a power of 2
  *    - ENOSPC - the maximum number of memzones has already been allocated
  *    - EEXIST - a memzone with the same name already exists
lib/ring/rte_ring_elem.h +0 -1
index fb1edc9aad..7f7d4951d3 100644
@@ -96,7 +96,6 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize, unsigned int count);
  *   On success, the pointer to the new allocated ring. NULL on error with
  *    rte_errno set appropriately. Possible errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config structure
- *    - E_RTE_SECONDARY - function was called from a secondary process instance
  *    - EINVAL - esize is not a multiple of 4 or count provided is not a
  *		 power of 2.
  *    - ENOSPC - the maximum number of memzones has already been allocated
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw

<snip>

Quoted 5 lines

Subject: [PATCH] mem: fix API doc about allocation on secondary processes

Since 10 years, memzone allocation is allowed on secondary processes. Now it's time to update the documentation accordingly.

Quoted 7 lines

At the same time, fix mempool, mbuf and ring documentation which rely on memzones internally.

Bugzilla ID: 1074

Fixes 916e4f4f4e45 ("memory: fix for multi process support")

LGTM

Quoted 140 lines
---
 lib/eal/include/rte_memzone.h | 3 ---
 lib/mbuf/rte_mbuf.h           | 3 ---
 lib/mempool/rte_mempool.h     | 1 -
 lib/ring/rte_ring.h           | 1 -
 lib/ring/rte_ring_elem.h      | 1 -
 5 files changed, 9 deletions(-)
lib/eal/include/rte_memzone.h +0 -0
index 5db1210831..bb4223a056 100644
@@ -118,7 +118,6 @@ struct rte_memzone {
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create
memzone

lib/eal/include/rte_memzone.h +0 -0
@@ -184,7 +183,6 @@ const struct rte_memzone
 *rte_memzone_reserve(const char *name,
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create
memzone

lib/eal/include/rte_memzone.h +0 -0
@@ -256,7 +254,6 @@ const struct rte_memzone
 *rte_memzone_reserve_aligned(const char *name,
  *   on error.
  *   On error case, rte_errno will be set appropriately:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create
memzone

lib/mbuf/rte_mbuf.h index renamed from lib/mbuf/rte_mbuf.h +0 -0

9811e8c760..b6e23d98ce 100644

lib/mbuf/rte_mbuf.h +0 -0
@@ -664,7 +664,6 @@ void rte_pktmbuf_pool_init(struct rte_mempool
 *mp, void *opaque_arg);
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - cache size provided is too large, or priv_size is not aligned.
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists

lib/mbuf/rte_mbuf.h +0 -0
@@ -706,7 +705,6 @@ rte_pktmbuf_pool_create(const char *name,
 unsigned n,
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - cache size provided is too large, or priv_size is not aligned.
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists

lib/mbuf/rte_mbuf.h +0 -0
@@ -760,7 +758,6 @@ struct rte_pktmbuf_extmem {
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - cache size provided is too large, or priv_size is not aligned.
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists

lib/mempool/rte_mempool.h +0 -0
index a3c4ee351d..4c4af2a8ed 100644
@@ -1023,7 +1023,6 @@ typedef void (rte_mempool_ctor_t)(struct
 rte_mempool *, void *);
  *   The pointer to the new allocated mempool, on success. NULL on error
  *   with rte_errno set appropriately. Possible rte_errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - cache size provided is too large or an unknown flag was
passed
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists

lib/ring/rte_ring.h index renamed from lib/ring/rte_ring.h +0 -0

980e92e594..7c48e35d27 100644

lib/ring/rte_ring.h +0 -0
@@ -180,7 +180,6 @@ int rte_ring_init(struct rte_ring *r, const char *name,
 unsigned int count,
  *   On success, the pointer to the new allocated ring. NULL on error with
  *    rte_errno set appropriately. Possible errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - count provided is not a power of 2
* - ENOSPC - the maximum number of memzones has already been
allocated
* - EEXIST - a memzone with the same name already exists

lib/ring/rte_ring_elem.h index renamed from lib/ring/rte_ring_elem.h +0 -0

fb1edc9aad..7f7d4951d3 100644

lib/ring/rte_ring_elem.h +0 -0
@@ -96,7 +96,6 @@ ssize_t rte_ring_get_memsize_elem(unsigned int esize,
 unsigned int count);
  *   On success, the pointer to the new allocated ring. NULL on error with
  *    rte_errno set appropriately. Possible errno values include:
  *    - E_RTE_NO_CONFIG - function could not get pointer to rte_config

structure
- * - E_RTE_SECONDARY - function was called from a secondary process
instance
* - EINVAL - esize is not a multiple of 4 or count provided is not a
* power of 2.
* - ENOSPC - the maximum number of memzones has already been
allocated
--
2.30.2

#2 lore raw
Quoted 8 lines · Honnappa Nagarahalli
Quoted 8 lines

Since 10 years, memzone allocation is allowed on secondary processes. Now it's time to update the documentation accordingly.

At the same time, fix mempool, mbuf and ring documentation which rely on memzones internally.

Bugzilla ID: 1074

Fixes 916e4f4f4e45 ("memory: fix for multi process support")
Quoted 3 lines
Quoted 2 lines

Applied, thanks.

Signature · 1 line
David Marchand