Skip to contentSkip to conversation

rte_eal: clarify the argc and argv documentation

PATCH Applied Aaron Conole 2 participants 2 messages Dec 8, 2016 – Dec 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rte_eal: clarify the argc and argv documentation

It's been a source of confusion in the past, and even with this update may continue to be a source of confusion. However, the original language seems to imply that the DPDK EAL will take ownership of the array passed in. Loosening the language up a bit might give a better understanding for what is actually happening.

---
 lib/librte_eal/common/include/rte_eal.h | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
lib/librte_eal/common/include/rte_eal.h +9 -4
index d150b9d..03fee50 100644
@@ -146,14 +146,19 @@ int rte_eal_iopl_init(void);
  * This behavior may change in the future.
  *
  * @param argc
- *   The argc argument that was given to the main() function.
+ *   A non-negative value.  If it is greater than 0, the array members
+ *   for argv[0] through argv[argc] (non-inclusive) shall contain pointers
+ *   to strings.
  * @param argv
- *   The argv argument that was given to the main() function.
+ *   An array of strings.  The contents of the array, as well as the strings
+ *   which are pointed to by the array, may be modified by this function.
  * @return
  *   - On success, the number of parsed arguments, which is greater or
  *     equal to zero. After the call to rte_eal_init(),
- *     all arguments argv[x] with x < ret may be modified and should
- *     not be accessed by the application.
+ *     all arguments argv[x] with x < ret may have been modified by this
+ *     function call and should not be further interpreted by the
+ *     application.  The EAL does not take any ownership of the memory used
+ *     for either the argv array, or its members.
  *   - On failure, a negative error value.
  */
 int rte_eal_init(int argc, char **argv);
Signature · 1 line
2.7.4
#1 lore raw

2016-12-08 10:56, Aaron Conole:

Quoted 7 lines

It's been a source of confusion in the past, and even with this update may continue to be a source of confusion. However, the original language seems to imply that the DPDK EAL will take ownership of the array passed in. Loosening the language up a bit might give a better understanding for what is actually happening.

Applied, thanks