On Fri, Apr 05, 2019 at 03:51:39PM +0200, Mattias Rönnblom wrote: > On 2019-04-05 15:45, Mattias Rönnblom wrote: > > The rte_rand() documentation left it unspecified if the rte_rand() was > > multi-thread safe or not, and the implementation (based on lrand48()) > > was not. > > > > This commit makes rte_rand() safe to use from any lcore thread by > > using lrand48_r() and per-lcore random state structs. Besides the > > obvious improvement in terms of correctness (for concurrent users), > > this also much improves rte_rand() performance, since the threads no > > longer shares state. For the single-threaded case, this patch causes > > ~10% rte_rand() performance degradation. > > > > It's a little unclear to me, if lrand48_r() exists in FreeBSD or not. Could > someone confirm? > Nothing shows up for me in the man pages for such a function on FreeBSD 12, so I suspect they aren't available. > Another question I have is in which section of the version.map file the new > symbols should go. Experimental, or 19.05? > I think it should be 19.05. Since the APIs have been around as inline functions for some time now, I don't see the point of having them be experimental for a time. > The source interface is backward compatible, but the functions are no longer > inline functions in the header file, and thus needs to go somewhere to be > properly exported. Regards, /Bruce