apply 82574 RFCTL workaround the same as FreeBSD and linux.

In fact, this workaround reduces interrupt count.
This commit is contained in:
knakahara 2017-02-24 10:09:21 +00:00
parent 693595d590
commit ede9d3bf43
1 changed files with 12 additions and 2 deletions

View File

@ -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++) {