summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-03-26 11:35:55 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-03-26 11:35:55 +0000
commitb0624b90ec9a0c04cca626925beee3ae403457ce (patch)
treea88450568127edc124ad1a8214c161ac52c6c145
parent94eb3b821b728e8dc462bb87d35b5f55b5835edc (diff)
parent8b11ca880a902725fb8b0bb2c639f3671ac806d6 (diff)
downloadillumos-joyent-b0624b90ec9a0c04cca626925beee3ae403457ce.tar.gz
[illumos-gate merge]
commit 8b11ca880a902725fb8b0bb2c639f3671ac806d6 12382 Mellanox driver is missing advertisement in dladm link-prop commit e5c541a6c70df2548bbaa19fa43a7dbebe4b637a 12425 /opt/util-tests/bin/utiltest needs default run file handling commit 7adb68a6af9135eabca6203d488597cb40c4675c 12196 fmadm faulty NULL pointer dereference
-rw-r--r--usr/src/cmd/fm/fmadm/common/faulty.c25
-rw-r--r--usr/src/test/util-tests/cmd/utiltest.ksh6
-rw-r--r--usr/src/uts/common/io/mlxcx/mlxcx_gld.c125
3 files changed, 143 insertions, 13 deletions
diff --git a/usr/src/cmd/fm/fmadm/common/faulty.c b/usr/src/cmd/fm/fmadm/common/faulty.c
index 21d4143532..ef3d5671dc 100644
--- a/usr/src/cmd/fm/fmadm/common/faulty.c
+++ b/usr/src/cmd/fm/fmadm/common/faulty.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2020 Joyent, Inc.
*/
#include <sys/types.h>
@@ -1214,17 +1215,19 @@ print_sup_record(status_record_t *srp, int opt_i, int full)
n++;
}
(void) printf("\n");
- (void) printf("%s %s", dgettext("FMD", "Host :"),
- srp->host->server);
- if (srp->host->domain)
- (void) printf("\t%s %s", dgettext("FMD", "Domain :"),
- srp->host->domain);
- (void) printf("\n%s %s", dgettext("FMD", "Platform :"),
- srp->host->platform);
- (void) printf("\t%s %s", dgettext("FMD", "Chassis_id :"),
- srp->host->chassis ? srp->host->chassis : "");
- (void) printf("\n%s %s\n\n", dgettext("FMD", "Product_sn :"),
- srp->host->product_sn? srp->host->product_sn : "");
+ if (srp->host) {
+ (void) printf("%s %s", dgettext("FMD", "Host :"),
+ srp->host->server);
+ if (srp->host->domain)
+ (void) printf("\t%s %s", dgettext("FMD",
+ "Domain :"), srp->host->domain);
+ (void) printf("\n%s %s", dgettext("FMD", "Platform :"),
+ srp->host->platform);
+ (void) printf("\t%s %s", dgettext("FMD", "Chassis_id :"),
+ srp->host->chassis ? srp->host->chassis : "");
+ (void) printf("\n%s %s\n\n", dgettext("FMD", "Product_sn :"),
+ srp->host->product_sn ? srp->host->product_sn : "");
+ }
if (srp->class)
print_name_list(srp->class,
dgettext("FMD", "Fault class :"), 0, srp->class->pct,
diff --git a/usr/src/test/util-tests/cmd/utiltest.ksh b/usr/src/test/util-tests/cmd/utiltest.ksh
index e701aeb854..01f365cde9 100644
--- a/usr/src/test/util-tests/cmd/utiltest.ksh
+++ b/usr/src/test/util-tests/cmd/utiltest.ksh
@@ -37,8 +37,10 @@ function find_runfile
distro=openindiana
elif [[ 0 -ne $(grep -c OmniOS /etc/release 2>/dev/null) ]]; then
distro=omnios
- elif [[ -f $MY_TESTS/runfiles/default.run ]]; then
- # optional catch-all
+ fi
+
+ if [[ ! -f $MY_TESTS/runfiles/$distro.run ]] && \
+ [[ -f $MY_TESTS/runfiles/default.run ]]; then
distro=default
fi
diff --git a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c
index 871c4f30b3..7b01702376 100644
--- a/usr/src/uts/common/io/mlxcx/mlxcx_gld.c
+++ b/usr/src/uts/common/io/mlxcx/mlxcx_gld.c
@@ -11,6 +11,7 @@
/*
* Copyright (c) 2020, the University of Queensland
+ * Copyright 2020 RackTop Systems, Inc.
*/
/*
@@ -1056,6 +1057,61 @@ mlxcx_mac_propinfo(void *arg, const char *pr_name, mac_prop_id_t pr_num,
mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
mac_prop_info_set_default_uint8(prh, 1);
break;
+ case MAC_PROP_ADV_100GFDX_CAP:
+ case MAC_PROP_EN_100GFDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto &
+ (MLXCX_PROTO_100GBASE_CR4 | MLXCX_PROTO_100GBASE_SR4 |
+ MLXCX_PROTO_100GBASE_KR4)) != 0);
+ break;
+ case MAC_PROP_ADV_50GFDX_CAP:
+ case MAC_PROP_EN_50GFDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto &
+ (MLXCX_PROTO_50GBASE_CR2 | MLXCX_PROTO_50GBASE_KR2 |
+ MLXCX_PROTO_50GBASE_SR2)) != 0);
+ break;
+ case MAC_PROP_ADV_40GFDX_CAP:
+ case MAC_PROP_EN_40GFDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto &
+ (MLXCX_PROTO_40GBASE_SR4 | MLXCX_PROTO_40GBASE_LR4_ER4 |
+ MLXCX_PROTO_40GBASE_CR4 | MLXCX_PROTO_40GBASE_KR4))
+ != 0);
+ break;
+ case MAC_PROP_ADV_25GFDX_CAP:
+ case MAC_PROP_EN_25GFDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto &
+ (MLXCX_PROTO_25GBASE_CR | MLXCX_PROTO_25GBASE_KR |
+ MLXCX_PROTO_25GBASE_SR)) != 0);
+ break;
+ case MAC_PROP_ADV_10GFDX_CAP:
+ case MAC_PROP_EN_10GFDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto &
+ (MLXCX_PROTO_10GBASE_CX4 | MLXCX_PROTO_10GBASE_KX4 |
+ MLXCX_PROTO_10GBASE_KR | MLXCX_PROTO_10GBASE_CR |
+ MLXCX_PROTO_10GBASE_SR | MLXCX_PROTO_10GBASE_ER_LR)) != 0);
+ break;
+ case MAC_PROP_ADV_1000FDX_CAP:
+ case MAC_PROP_EN_1000FDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto & (MLXCX_PROTO_1000BASE_KX |
+ MLXCX_PROTO_SGMII)) != 0);
+ break;
+ case MAC_PROP_ADV_100FDX_CAP:
+ case MAC_PROP_EN_100FDX_CAP:
+ mac_prop_info_set_perm(prh, MAC_PROP_PERM_READ);
+ mac_prop_info_set_default_uint8(prh,
+ (port->mlp_oper_proto & MLXCX_PROTO_SGMII_100BASE) != 0);
+ break;
default:
break;
}
@@ -1189,6 +1245,75 @@ mlxcx_mac_getprop(void *arg, const char *pr_name, mac_prop_id_t pr_num,
}
*(uint32_t *)pr_val = port->mlp_mtu - MLXCX_MTU_OFFSET;
break;
+ case MAC_PROP_ADV_100GFDX_CAP:
+ case MAC_PROP_EN_100GFDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_100GBASE_CR4 | MLXCX_PROTO_100GBASE_SR4 |
+ MLXCX_PROTO_100GBASE_KR4)) != 0;
+ break;
+ case MAC_PROP_ADV_50GFDX_CAP:
+ case MAC_PROP_EN_50GFDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_50GBASE_CR2 | MLXCX_PROTO_50GBASE_KR2 |
+ MLXCX_PROTO_50GBASE_SR2)) != 0;
+ break;
+ case MAC_PROP_ADV_40GFDX_CAP:
+ case MAC_PROP_EN_40GFDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_40GBASE_SR4 | MLXCX_PROTO_40GBASE_LR4_ER4 |
+ MLXCX_PROTO_40GBASE_CR4 | MLXCX_PROTO_40GBASE_KR4)) != 0;
+ break;
+ case MAC_PROP_ADV_25GFDX_CAP:
+ case MAC_PROP_EN_25GFDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_25GBASE_CR | MLXCX_PROTO_25GBASE_KR |
+ MLXCX_PROTO_25GBASE_SR)) != 0;
+ break;
+ case MAC_PROP_ADV_10GFDX_CAP:
+ case MAC_PROP_EN_10GFDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_10GBASE_CX4 | MLXCX_PROTO_10GBASE_KX4 |
+ MLXCX_PROTO_10GBASE_KR | MLXCX_PROTO_10GBASE_CR |
+ MLXCX_PROTO_10GBASE_SR | MLXCX_PROTO_10GBASE_ER_LR)) != 0;
+ break;
+ case MAC_PROP_ADV_1000FDX_CAP:
+ case MAC_PROP_EN_1000FDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ (MLXCX_PROTO_1000BASE_KX | MLXCX_PROTO_SGMII)) != 0;
+ break;
+ case MAC_PROP_ADV_100FDX_CAP:
+ case MAC_PROP_EN_100FDX_CAP:
+ if (pr_valsize < sizeof (uint8_t)) {
+ ret = EOVERFLOW;
+ break;
+ }
+ *(uint8_t *)pr_val = (port->mlp_max_proto &
+ MLXCX_PROTO_SGMII_100BASE) != 0;
+ break;
default:
ret = ENOTSUP;
break;