Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/pci Pull up following revision(s) (requested by j...



details:   https://anonhg.NetBSD.org/src/rev/d9c25753eb7a
branches:  netbsd-9
changeset: 936827:d9c25753eb7a
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Aug 05 14:59:41 2020 +0000

description:
Pull up following revision(s) (requested by jmcneill in ticket #1038):

        sys/dev/pci/if_ena.c: revision 1.25

PR port-arm/55532: kernel panic with ena on AWS a1.2xlarge

Do not mark callout and workqueues as mpsafe unless the NET_MPSAFE option
is present.

diffstat:

 sys/dev/pci/if_ena.c |  23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diffs (68 lines):

diff -r 6c152ad0c450 -r d9c25753eb7a sys/dev/pci/if_ena.c
--- a/sys/dev/pci/if_ena.c      Wed Aug 05 14:47:04 2020 +0000
+++ b/sys/dev/pci/if_ena.c      Wed Aug 05 14:59:41 2020 +0000
@@ -27,11 +27,16 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
+
+#ifdef _KERNEL_OPT
+#include "opt_net_mpsafe.h"
+#endif
+
 #include <sys/cdefs.h>
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.15.2.2 2020/03/08 14:44:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.15.2.3 2020/08/05 14:59:41 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,6 +61,14 @@
 
 #include <dev/pci/if_enavar.h>
 
+#ifdef NET_MPSAFE
+#define        WQ_FLAGS        WQ_MPSAFE
+#define        CALLOUT_FLAGS   CALLOUT_MPSAFE
+#else
+#define        WQ_FLAGS        0
+#define        CALLOUT_FLAGS   0
+#endif
+
 /*********************************************************
  *  Function prototypes
  *********************************************************/
@@ -682,7 +695,7 @@
 
        /* Allocate workqueues */
        int rc = workqueue_create(&tx_ring->enqueue_tq, "ena_tx_enq",
-           ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
+           ena_deferred_mq_start, tx_ring, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
        if (unlikely(rc != 0)) {
                ena_trace(ENA_ALERT,
                    "Unable to create workqueue for enqueue task\n");
@@ -889,7 +902,7 @@
 
        /* Allocate workqueues */
        int rc = workqueue_create(&rx_ring->cmpl_tq, "ena_rx_comp",
-           ena_deferred_rx_cleanup, rx_ring, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
+           ena_deferred_rx_cleanup, rx_ring, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
        if (unlikely(rc != 0)) {
                ena_trace(ENA_ALERT,
                    "Unable to create workqueue for RX completion task\n");
@@ -3807,11 +3820,11 @@
                goto err_ifp_free;
        }
 
-       callout_init(&adapter->timer_service, CALLOUT_MPSAFE);
+       callout_init(&adapter->timer_service, CALLOUT_FLAGS);
 
        /* Initialize reset task queue */
        rc = workqueue_create(&adapter->reset_tq, "ena_reset_enq",
-           ena_reset_task, adapter, 0, IPL_NET, WQ_PERCPU | WQ_MPSAFE);
+           ena_reset_task, adapter, 0, IPL_NET, WQ_PERCPU | WQ_FLAGS);
        if (unlikely(rc != 0)) {
                ena_trace(ENA_ALERT,
                    "Unable to create workqueue for reset task\n");



Home | Main Index | Thread Index | Old Index