diff options
author | scottl <scottl@FreeBSD.org> | 2013-08-09 01:10:33 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-08-09 01:10:33 +0000 |
commit | 735f6843c64b09ce16ccac6f7abf947974241d2c (patch) | |
tree | 104855b97638ae3714c11fd9eeaf419861ee0cc3 /sys/dev/mps | |
parent | d1c9a480cbae281f1f04c590e3a63b8fa0cfb03b (diff) | |
download | FreeBSD-src-735f6843c64b09ce16ccac6f7abf947974241d2c.zip FreeBSD-src-735f6843c64b09ce16ccac6f7abf947974241d2c.tar.gz |
Rate limit the 'out of chain frame' messages to once per 60 seconds.
Obtained from: Netflix
MFC after: 3 days
Diffstat (limited to 'sys/dev/mps')
-rw-r--r-- | sys/dev/mps/mps.c | 9 | ||||
-rw-r--r-- | sys/dev/mps/mpsvar.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c index 5a6718f..3cfc5eb 100644 --- a/sys/dev/mps/mps.c +++ b/sys/dev/mps/mps.c @@ -123,6 +123,9 @@ typedef union _reply_descriptor { } u; }reply_descriptor,address_descriptor; +/* Rate limit chain-fail messages to 1 per minute */ +static struct timeval mps_chainfail_interval = { 60, 0 }; + /* * sleep_flag can be either CAN_SLEEP or NO_SLEEP. * If this function is called from process context, it can sleep @@ -1467,6 +1470,7 @@ mps_attach(struct mps_softc *sc) mtx_init(&sc->mps_mtx, "MPT2SAS lock", NULL, MTX_DEF); callout_init_mtx(&sc->periodic, &sc->mps_mtx, 0); TAILQ_INIT(&sc->event_list); + timevalclear(&sc->lastfail); if ((error = mps_transition_ready(sc)) != 0) { mps_printf(sc, "%s failed to transition ready\n", __func__); @@ -2413,8 +2417,9 @@ mps_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) sflags, nsegs - i); if (error != 0) { /* Resource shortage, roll back! */ - mps_dprint(sc, MPS_INFO, "Out of chain frames, " - "consider increasing hw.mps.max_chains.\n"); + if (ratecheck(&sc->lastfail, &mps_chainfail_interval)) + mps_dprint(sc, MPS_INFO, "Out of chain frames, " + "consider increasing hw.mps.max_chains.\n"); cm->cm_flags |= MPS_CM_FLAGS_CHAIN_FAILED; mps_complete_command(sc, cm); return; diff --git a/sys/dev/mps/mpsvar.h b/sys/dev/mps/mpsvar.h index 15b660f..14015fa 100644 --- a/sys/dev/mps/mpsvar.h +++ b/sys/dev/mps/mpsvar.h @@ -416,6 +416,7 @@ struct mps_softc { struct mps_column_map DD_column_map[MPS_MAX_DISKS_IN_VOL]; char exclude_ids[80]; + struct timeval lastfail; }; struct mps_config_params { |