mp_ring: fix i386

Even though 64-bit atomics are supported on i386 there are panics
indicating that the code does not work correctly there. Switch
to mutex based variant (and fix that while we're here).

Reported by:	pho, kib
This commit is contained in:
Matt Macy 2018-05-19 16:44:12 +00:00
parent 86c61317fd
commit e335651e1e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=333879

View File

@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <machine/cpu.h>
#if defined(__powerpc__) || defined(__mips__)
#if defined(__powerpc__) || defined(__mips__) || defined(__i386__)
#define NO_64BIT_ATOMICS
#endif
@ -345,6 +345,7 @@ ifmp_ring_enqueue(struct ifmp_ring *r, void **items, int n, int budget)
if (n >= space_available(r, os)) {
counter_u64_add(r->drops, n);
MPASS(os.flags != IDLE);
mtx_unlock(&r->lock);
if (os.flags == STALLED)
ifmp_ring_check_drainage(r, 0);
return (ENOBUFS);