Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci apply 82574 RFCTL workaround the same as FreeBSD...



details:   https://anonhg.NetBSD.org/src/rev/d21ed40e85bc
branches:  trunk
changeset: 821990:d21ed40e85bc
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Feb 24 10:09:21 2017 +0000

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

In fact, this workaround reduces interrupt count.

diffstat:

 sys/dev/pci/if_wm.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r a421e0f38d9c -r d21ed40e85bc sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Feb 24 10:07:33 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Feb 24 10:09:21 2017 +0000
@@ -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 @@
                        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++) {



Home | Main Index | Thread Index | Old Index