summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/lib/fm/topo/modules/common/ses/ses.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/usr/src/lib/fm/topo/modules/common/ses/ses.c b/usr/src/lib/fm/topo/modules/common/ses/ses.c
index 081ed619ec..39f18783e8 100644
--- a/usr/src/lib/fm/topo/modules/common/ses/ses.c
+++ b/usr/src/lib/fm/topo/modules/common/ses/ses.c
@@ -23,7 +23,7 @@
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2018, Joyent, Inc.
+ * Copyright (c) 2019, Joyent, Inc.
*/
#include <alloca.h>
@@ -293,6 +293,34 @@ static ses_open_fail_list_t *ses_sofh;
static pthread_mutex_t ses_sofmt;
static void ses_ct_print(char *ptr);
+/*
+ * Static list of enclosure manufacturers/models that we will skip enumerating.
+ * To skip all models from a particular vendor, set the seb_model field to "*".
+ */
+typedef struct ses_enc_blacklist {
+ const char *seb_manuf;
+ const char *seb_model;
+} ses_enc_blacklist_t;
+
+static const ses_enc_blacklist_t enc_blacklist[] = {
+ { "LSI", "VirtualSES" }
+};
+
+#define N_ENC_BLACKLIST (sizeof (enc_blacklist) / \
+ sizeof (enc_blacklist[0]))
+
+static boolean_t
+ses_is_blacklisted(ses_enc_blacklist_t *seb)
+{
+ for (uint_t i = 0; i < N_ENC_BLACKLIST; i++) {
+ if (strcmp(seb->seb_manuf, enc_blacklist[i].seb_manuf) == 0 &&
+ (strcmp(enc_blacklist[i].seb_model, "*") == 0 ||
+ strcmp(seb->seb_model, enc_blacklist[i].seb_model) == 0))
+ return (B_TRUE);
+ }
+ return (B_FALSE);
+}
+
static void
ses_recheck_dir()
{
@@ -3196,9 +3224,24 @@ ses_enum_gather(ses_node_t *np, void *data)
uint64_t prevstatus, status;
boolean_t report;
uint64_t subchassis = NO_SUBCHASSIS;
+ ses_enc_blacklist_t seb;
if (ses_node_type(np) == SES_NODE_ENCLOSURE) {
/*
+ * Compare the enclosure identity against the entries in the SES
+ * enclosure blacklist and ignore it, if found.
+ */
+ verify(nvlist_lookup_string(props, SES_EN_PROP_VID,
+ (char **)&seb.seb_manuf) == 0);
+ verify(nvlist_lookup_string(props, SES_EN_PROP_PID,
+ (char **)&seb.seb_model) == 0);
+ if (ses_is_blacklisted(&seb) == B_TRUE) {
+ topo_mod_dprintf(mod, "Skipping enclosure %s-%s: is "
+ "blacklisted", seb.seb_manuf, seb.seb_model);
+ return (SES_WALK_ACTION_TERMINATE);
+ }
+
+ /*
* If we have already identified the chassis for this target,
* then this is a secondary enclosure and we should ignore it,
* along with the rest of the tree (since this is depth-first).