Thread (290 messages) flat view 290 messages, 13 authors, 2022-04-12

Re: [dpdk-dev] [PATCH v2 01/10] eal: add thread id and simple thread functions

From: Tyler Retzlaff <hidden>
Date: 2021-03-23 15:53:43

On Mon, Mar 22, 2021 at 07:54:19PM -0700, Stephen Hemminger wrote:
On Mon, 22 Mar 2021 17:20:26 -0700
Narcisa Ana Maria Vasile [off-list ref] wrote:
quoted
@@ -59,7 +92,7 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp);
  *
  * @return
  *   On success, zero.
- *   On failure, a negative number.
+ *   On failure, return a positive errno-style error number.
  */
The common pattern in DPDK is to return a negative value for errors.
There is a tradeoff here, should the wrapper functions just mimic what
Posix API's do or not.

I prefer what this patch does; so users can just assume the rte_thread functions
all work exactly like the pthread versions.
yes, there was concern here that suddenly applying sign to errno
returned by an rte function that almost looks like a pthread function
will lead to a lot of misuse / confusion.

if this were to be changed at all i would suggest adopting more
consistently the use of rv = -1 and rte_errno set to indicate the error.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help