summaryrefslogtreecommitdiff
path: root/sys/dev/mps
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2013-08-09 01:10:33 +0000
committerScott Long <scottl@FreeBSD.org>2013-08-09 01:10:33 +0000
commitfe8391035a82db0b0f1c3343bdc760334dc6431c (patch)
tree104855b97638ae3714c11fd9eeaf419861ee0cc3 /sys/dev/mps
parentd9802deb4eab51b08699148d8a206f8748bc1682 (diff)
Notes
Diffstat (limited to 'sys/dev/mps')
-rw-r--r--sys/dev/mps/mps.c9
-rw-r--r--sys/dev/mps/mpsvar.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/mps/mps.c b/sys/dev/mps/mps.c
index 5a6718f83eb8..3cfc5eb438e4 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 15b660f7e755..14015fa0d6d3 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 {