svn commit: r333879 - head/sys/net

Matt Macy mmacy at FreeBSD.org
Sat May 19 16:44:13 UTC 2018


Author: mmacy
Date: Sat May 19 16:44:12 2018
New Revision: 333879
URL: https://svnweb.freebsd.org/changeset/base/333879

Log:
  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

Modified:
  head/sys/net/mp_ring.c

Modified: head/sys/net/mp_ring.c
==============================================================================
--- head/sys/net/mp_ring.c	Sat May 19 15:18:15 2018	(r333878)
+++ head/sys/net/mp_ring.c	Sat May 19 16:44:12 2018	(r333879)
@@ -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, i
 	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);


More information about the svn-src-all mailing list