6911993 Fabric Xlate should not send rc.xx-msgs on systems with a real PCIe RP.
--- a/usr/src/cmd/fm/modules/common/fabric-xlate/fabric-xlate.c Fri Jan 15 10:17:34 2010 +0800
+++ b/usr/src/cmd/fm/modules/common/fabric-xlate/fabric-xlate.c Fri Jan 15 10:42:30 2010 +0800
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <fm/libtopo.h>
@@ -72,6 +72,8 @@
/* Init xpath */
fab_xpathCtx = xmlXPathNewContext(fab_doc);
+ fab_set_fake_rp(hdl);
+
fab_valid_topo = 1;
}
--- a/usr/src/cmd/fm/modules/common/fabric-xlate/fabric-xlate.h Fri Jan 15 10:17:34 2010 +0800
+++ b/usr/src/cmd/fm/modules/common/fabric-xlate/fabric-xlate.h Fri Jan 15 10:42:30 2010 +0800
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -165,6 +165,8 @@
extern char *fab_find_bdf(fmd_hdl_t *hdl, nvlist_t *nvl, pcie_req_id_t bdf);
extern boolean_t fab_hc2dev(fmd_hdl_t *, const char *, char **);
extern boolean_t fab_hc2dev_nvl(fmd_hdl_t *, nvlist_t *, char **);
+extern char *fab_get_rpdev(fmd_hdl_t *hdl);
+extern void fab_set_fake_rp(fmd_hdl_t *hdl);
#ifdef __cplusplus
}
--- a/usr/src/cmd/fm/modules/common/fabric-xlate/fx_fabric.c Fri Jan 15 10:17:34 2010 +0800
+++ b/usr/src/cmd/fm/modules/common/fabric-xlate/fx_fabric.c Fri Jan 15 10:42:30 2010 +0800
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stddef.h>
@@ -271,15 +271,6 @@
FAB_LOOKUP(32, "pcie_adv_rp_command", &data->pcie_rp_err_cmd);
FAB_LOOKUP(16, "pcie_adv_rp_ce_src_id", &data->pcie_rp_ce_src_id);
FAB_LOOKUP(16, "pcie_adv_rp_ue_src_id", &data->pcie_rp_ue_src_id);
-
- /*
- * If the system has a PCIe complaint RP with AER, turn off translating
- * fake RP ereports.
- */
- if (fab_xlate_fake_rp &&
- (data->dev_type == PCIE_PCIECAP_DEV_TYPE_ROOT) &&
- data->aer_off)
- fab_xlate_fake_rp = B_FALSE;
}
static int
@@ -806,6 +797,39 @@
fab_xlate_pcie_erpts(hdl, &data);
}
+void
+fab_set_fake_rp(fmd_hdl_t *hdl)
+{
+ char *rppath = fab_get_rpdev(hdl), *str = NULL;
+ int count = 0;
+
+ if (!rppath) {
+ fmd_hdl_debug(hdl, "Can't find root port dev path");
+ return;
+ }
+
+ /*
+ * For the path '/pci@xxx' is fake root port,
+ * and '/pci@xxx/pci@y' is real root port.
+ */
+ str = rppath;
+ while (*str) {
+ if (*str == '/')
+ count++;
+ str++;
+ }
+
+ if (count == 1)
+ fab_xlate_fake_rp = B_TRUE;
+ else
+ /*
+ * If count is 0, then it should still be B_FALSE
+ */
+ fab_xlate_fake_rp = B_FALSE;
+
+ fmd_hdl_strfree(hdl, rppath);
+}
+
#define SET_TBL(n, err, reg, sz) \
fab_master_err_tbl[n].erpt_tbl = fab_ ## err ## _erpt_tbl; \
fab_master_err_tbl[n].reg_offset = offsetof(fab_data_t, reg); \
--- a/usr/src/cmd/fm/modules/common/fabric-xlate/fx_subr.c Fri Jan 15 10:17:34 2010 +0800
+++ b/usr/src/cmd/fm/modules/common/fabric-xlate/fx_subr.c Fri Jan 15 10:42:30 2010 +0800
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <strings.h>
@@ -835,3 +835,23 @@
}
}
}
+
+char *
+fab_get_rpdev(fmd_hdl_t *hdl)
+{
+ char *retval;
+ char query[500];
+
+ (void) snprintf(query, sizeof (query), "//propval["
+ "@name='extended-capabilities' and contains(@value, '%s')]"
+ "/parent::*/parent::*/propgroup[@name='io']"
+ "/propval[@name='dev']/@value", PCIEX_ROOT);
+
+ retval = fab_xpath_query(hdl, query);
+ if (retval) {
+ fmd_hdl_debug(hdl, "Root port path is %s\n", retval);
+ return (retval);
+ }
+
+ return (NULL);
+}