Module Name:    src
Committed By:   knakahara
Date:           Fri Feb 24 10:09:21 UTC 2017

Modified Files:
        src/sys/dev/pci: if_wm.c

Log Message:
apply 82574 RFCTL workaround the same as FreeBSD and linux.

In fact, this workaround reduces interrupt count.


To generate a diff of this commit:
cvs rdiff -u -r1.486 -r1.487 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.486 src/sys/dev/pci/if_wm.c:1.487
--- src/sys/dev/pci/if_wm.c:1.486	Fri Feb 24 10:07:33 2017
+++ src/sys/dev/pci/if_wm.c	Fri Feb 24 10:09:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.487 2017/02/24 10:09:21 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.486 2017/02/24 10:07:33 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.487 2017/02/24 10:09:21 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -5032,6 +5032,16 @@ wm_init_locked(struct ifnet *ifp)
 			reg |= CTRL_EXT_PBA | CTRL_EXT_EIAME;
 			CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
 
+			/*
+			 * workaround issue with spurious interrupts
+			 * in MSI-X mode.
+			 * At wm_initialize_hardware_bits(), sc_nintrs has not
+			 * initialized yet. So re-initialize WMREG_RFCTL here.
+			 */
+			reg = CSR_READ(sc, WMREG_RFCTL);
+			reg |= WMREG_RFCTL_ACKDIS;
+			CSR_WRITE(sc, WMREG_RFCTL, reg);
+
 			ivar = 0;
 			/* TX and RX */
 			for (i = 0; i < sc->sc_nqueues; i++) {

Reply via email to