Add hooks to dynamically change the bge Rx interrupt thresholds. I
found empiricaly that (at least on bcm5700s) the Rx coalesce and bd counts cannot be updated on-the-fly; attempting to do so (even at splhigh()) causes weird behaviour. Instead, add a softc flag to record that the desired softc values for Rx-interrupt thresholds have changed; check that boolean in the interrupt routine. If set, apply the new values there and clear the flag.
This commit is contained in:
parent
487ab6705e
commit
ca71058195
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_bge.c,v 1.57 2003/12/14 03:08:12 jonathan Exp $ */
|
||||
/* $NetBSD: if_bge.c,v 1.58 2004/01/22 02:29:46 jonathan Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Wind River Systems
|
||||
|
@ -79,7 +79,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.57 2003/12/14 03:08:12 jonathan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.58 2004/01/22 02:29:46 jonathan Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
#include "vlan.h"
|
||||
|
@ -2760,6 +2760,21 @@ bge_intr(xsc)
|
|||
bge_txeof(sc);
|
||||
}
|
||||
|
||||
if (sc->bge_pending_rxintr_change) {
|
||||
uint32_t rx_ticks = sc->bge_rx_coal_ticks;
|
||||
uint32_t rx_bds = sc->bge_rx_max_coal_bds;
|
||||
uint32_t junk;
|
||||
|
||||
CSR_WRITE_4(sc, BGE_HCC_RX_COAL_TICKS, rx_ticks);
|
||||
DELAY(10);
|
||||
junk = CSR_READ_4(sc, BGE_HCC_RX_COAL_TICKS);
|
||||
|
||||
CSR_WRITE_4(sc, BGE_HCC_RX_MAX_COAL_BDS, rx_bds);
|
||||
DELAY(10);
|
||||
junk = CSR_READ_4(sc, BGE_HCC_RX_MAX_COAL_BDS);
|
||||
|
||||
sc->bge_pending_rxintr_change = 0;
|
||||
}
|
||||
bge_handle_events(sc);
|
||||
|
||||
/* Re-enable interrupts. */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_bgereg.h,v 1.16 2004/01/22 02:13:48 jonathan Exp $ */
|
||||
/* $NetBSD: if_bgereg.h,v 1.17 2004/01/22 02:29:46 jonathan Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001 Wind River Systems
|
||||
* Copyright (c) 1997, 1998, 1999, 2001
|
||||
|
@ -2331,6 +2331,7 @@ struct bge_softc {
|
|||
struct callout bge_timeout;
|
||||
char *bge_vpd_prodname;
|
||||
char *bge_vpd_readonly;
|
||||
int bge_pending_rxintr_change;
|
||||
SLIST_HEAD(, txdmamap_pool_entry) txdma_list;
|
||||
struct txdmamap_pool_entry *txdma[BGE_TX_RING_CNT];
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue