summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-09-17 11:32:34 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-09-17 11:32:34 +0000
commita2435eea0fd4937d2779dd36ee4c494704d07472 (patch)
tree0f16c4f4f3dfe0682f0aa6b5a18a0c6a1854063a
parent73fb888b08574ef1b33df70ad8f9adc7f2508b41 (diff)
parent260b78324e5b8479cc94f897a36e996f026c3fef (diff)
downloadillumos-joyent-a2435eea0fd4937d2779dd36ee4c494704d07472.tar.gz
[illumos-gate merge]
commit 260b78324e5b8479cc94f897a36e996f026c3fef 13108 mlxcx fails to attach on system using pcplusmp after 12988 commit 8c5b3a5a518f93629928bd6ed373422602ce74a9 13136 libc: memset_s() error: unchecked function return
-rw-r--r--usr/src/lib/libc/port/gen/memset_s.c2
-rw-r--r--usr/src/uts/common/io/mlxcx/mlxcx_intr.c55
2 files changed, 45 insertions, 12 deletions
diff --git a/usr/src/lib/libc/port/gen/memset_s.c b/usr/src/lib/libc/port/gen/memset_s.c
index c77b02de20..f1f0d732e9 100644
--- a/usr/src/lib/libc/port/gen/memset_s.c
+++ b/usr/src/lib/libc/port/gen/memset_s.c
@@ -63,7 +63,7 @@ memset_s(void *s, rsize_t smax, int c, rsize_t n)
* memset() called through a volatile pointer to guarantee
* it will not be optimized away.
*/
- (*__memset_vp)(s, v, lim);
+ (void) (*__memset_vp)(s, v, lim);
if (n > RSIZE_MAX) {
__throw_constraint_handler_s("memset_s: n > RSIZE_MAX",
diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_intr.c b/usr/src/uts/common/io/mlxcx/mlxcx_intr.c
index 10d8d19b2f..53ea4d683e 100644
--- a/usr/src/uts/common/io/mlxcx/mlxcx_intr.c
+++ b/usr/src/uts/common/io/mlxcx/mlxcx_intr.c
@@ -12,6 +12,7 @@
/*
* Copyright (c) 2020, the University of Queensland
* Copyright 2020 RackTop Systems, Inc.
+ * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
*/
/*
@@ -1195,12 +1196,17 @@ mlxcx_intr_setup(mlxcx_t *mlxp)
return (B_FALSE);
}
if (nintrs < 2) {
- mlxcx_warn(mlxp, "%d MSI-X interrupts available, but mlxcx "
+ mlxcx_warn(mlxp, "%d MSI-X interrupts supported, but mlxcx "
"requires 2", nintrs);
return (B_FALSE);
}
ret = ddi_intr_get_navail(dip, DDI_INTR_TYPE_MSIX, &navail);
+ if (ret != DDI_SUCCESS) {
+ mlxcx_warn(mlxp,
+ "Failed to get number of available interrupts");
+ return (B_FALSE);
+ }
if (navail < 2) {
mlxcx_warn(mlxp, "%d MSI-X interrupts available, but mlxcx "
"requires 2", navail);
@@ -1281,11 +1287,30 @@ mlxcx_intr_setup(mlxcx_t *mlxp)
offsetof(mlxcx_completion_queue_t, mlcq_eq_entry));
}
- ret = ddi_intr_set_pri(mlxp->mlx_intr_handles[0],
- mlxp->mlx_async_intr_pri);
- if (ret != DDI_SUCCESS) {
- mlxcx_warn(mlxp, "Failed to set interrupt priority to %u for "
+ while (mlxp->mlx_async_intr_pri > DDI_INTR_PRI_MIN) {
+ ret = ddi_intr_set_pri(mlxp->mlx_intr_handles[0],
+ mlxp->mlx_async_intr_pri);
+ if (ret == DDI_SUCCESS)
+ break;
+ mlxcx_note(mlxp,
+ "!Failed to set interrupt priority to %u for "
"async interrupt vector", mlxp->mlx_async_intr_pri);
+ /*
+ * If it was not possible to set the IPL for the async
+ * interrupt to the desired value, then try a lower priority.
+ * Some PSMs can only accommodate a limited number of vectors
+ * at eatch priority level (or group of priority levels). Since
+ * the async priority must be set higher than the ring
+ * handlers, lower both. The ring handler priority is set
+ * below.
+ */
+ mlxp->mlx_async_intr_pri--;
+ mlxp->mlx_intr_pri--;
+ }
+
+ if (mlxp->mlx_async_intr_pri == DDI_INTR_PRI_MIN) {
+ mlxcx_warn(mlxp, "Failed to find an interrupt priority for "
+ "async interrupt vector");
mlxcx_intr_teardown(mlxp);
return (B_FALSE);
}
@@ -1320,12 +1345,20 @@ mlxcx_intr_setup(mlxcx_t *mlxp)
eqt = MLXCX_EQ_TYPE_RX;
}
- ret = ddi_intr_set_pri(mlxp->mlx_intr_handles[i],
- mlxp->mlx_intr_pri);
- if (ret != DDI_SUCCESS) {
- mlxcx_warn(mlxp, "Failed to set interrupt priority to "
- "%u for interrupt vector %d", mlxp->mlx_intr_pri,
- i);
+ while (mlxp->mlx_intr_pri >= DDI_INTR_PRI_MIN) {
+ ret = ddi_intr_set_pri(mlxp->mlx_intr_handles[i],
+ mlxp->mlx_intr_pri);
+ if (ret == DDI_SUCCESS)
+ break;
+ mlxcx_note(mlxp, "!Failed to set interrupt priority to "
+ "%u for interrupt vector %d",
+ mlxp->mlx_intr_pri, i);
+ mlxp->mlx_intr_pri--;
+ }
+ if (mlxp->mlx_intr_pri < DDI_INTR_PRI_MIN) {
+ mlxcx_warn(mlxp,
+ "Failed to find an interrupt priority for "
+ "interrupt vector %d", i);
mlxcx_intr_teardown(mlxp);
return (B_FALSE);
}