summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2017-11-16 13:56:03 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2017-11-16 13:56:03 +0000
commita142ba1cb0758f1c8119b8460d2b7ec63441c626 (patch)
tree1c888b33d5f46209e77cf0cb45426fe6e7197a1d
parent2fbcca79e5f2eef09fec107dbeb20d643db90100 (diff)
parent45d3dd981abb9025d8ac994cf4cc8ce8cb1a9480 (diff)
downloadillumos-joyent-a142ba1cb0758f1c8119b8460d2b7ec63441c626.tar.gz
[illumos-gate merge]
commit 45d3dd981abb9025d8ac994cf4cc8ce8cb1a9480 8699 Want NIC transceiver visibility 8700 ixgbe MAC_CAPAB_TRANSCEIVER support 8701 i40e MAC_CAPAB_TRANSCEIVER support Conflicts: usr/src/uts/common/sys/mac_provider.h usr/src/uts/common/sys/mac_impl.h usr/src/uts/common/sys/dld.h usr/src/uts/common/io/mac/mac_provider.c usr/src/uts/common/io/mac/mac.c usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c usr/src/uts/common/io/ixgbe/ixgbe_gld.c usr/src/uts/common/io/i40e/i40e_gld.c usr/src/uts/common/io/dld/dld_drv.c usr/src/test/util-tests/tests/libsff/Makefile usr/src/test/util-tests/tests/Makefile usr/src/test/util-tests/runfiles/default.run usr/src/man/man9e/Makefile usr/src/lib/libsff/common/libsff.c usr/src/lib/fm/topo/modules/common/shared/topo_port.c
-rw-r--r--exception_lists/copyright1
-rw-r--r--exception_lists/packaging12
-rw-r--r--usr/src/cmd/dlutil/Makefile7
-rw-r--r--usr/src/lib/fm/topo/modules/common/shared/topo_port.c2
-rw-r--r--usr/src/lib/libsff/common/libsff.c4
-rw-r--r--usr/src/pkg/manifests/service-fault-management.mf1
-rw-r--r--usr/src/pkg/manifests/system-kernel.man9e.inc3
-rw-r--r--usr/src/pkg/manifests/system-kernel.man9f.inc5
-rw-r--r--usr/src/pkg/manifests/system-library.mf2
-rw-r--r--usr/src/pkg/manifests/system-network.mf2
-rw-r--r--usr/src/pkg/manifests/system-test-utiltest.mf31
-rw-r--r--usr/src/test/util-tests/tests/libsff/Makefile20
-rw-r--r--usr/src/uts/common/io/ixgbe/ixgbe_main.c2
-rw-r--r--usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c6
-rw-r--r--usr/src/uts/common/io/mac/mac.c4
-rw-r--r--usr/src/uts/common/sys/mac_provider.h2
16 files changed, 89 insertions, 15 deletions
diff --git a/exception_lists/copyright b/exception_lists/copyright
index 0f65caf5a3..c221ee35fb 100644
--- a/exception_lists/copyright
+++ b/exception_lists/copyright
@@ -410,6 +410,7 @@ usr/src/test/util-tests/tests/dis/*/*.out
usr/src/test/util-tests/tests/libsff/*.out
usr/src/test/util-tests/tests/grep_xpg4/files/gout*
usr/src/test/util-tests/tests/grep_xpg4/files/test*
+usr/src/test/util-tests/tests/libsff/*.out
usr/src/test/zfs-tests/tests/functional/history/*Z
usr/src/test/zfs-tests/tests/functional/history/*txt
usr/src/tools/btxld/btx.h
diff --git a/exception_lists/packaging b/exception_lists/packaging
index 24fa387e57..69bb86b174 100644
--- a/exception_lists/packaging
+++ b/exception_lists/packaging
@@ -1000,3 +1000,15 @@ usr/lib/sparcv9/libficl-sys.so sparc
usr/lib/llib-lficl-sys
usr/lib/llib-lficl-sys.ln
usr/lib/libficl-sys.so
+
+#
+# libsff is private
+#
+usr/include/libsff.h
+usr/lib/amd64/libsff.so i386
+usr/lib/amd64/llib-lsff.ln i386
+usr/lib/sparcv9/libsff.so sparc
+usr/lib/sparcv9/llib-lsff.ln sparc
+usr/lib/libsff.so
+usr/lib/llib-lsff
+usr/lib/llib-lsff.ln
diff --git a/usr/src/cmd/dlutil/Makefile b/usr/src/cmd/dlutil/Makefile
index 8644786603..bbbb5220c4 100644
--- a/usr/src/cmd/dlutil/Makefile
+++ b/usr/src/cmd/dlutil/Makefile
@@ -14,6 +14,7 @@
#
PROG= dltraninfo dlsend dlrecv dlled
+LINTPROGS= $(PROG:%=%.ln)
include ../Makefile.cmd
@@ -21,6 +22,7 @@ ROOTCMDDIR = $(ROOTLIB)/dl
CFLAGS += $(CCVERBOSE)
dltraninfo := LDLIBS += -ldladm -lsff -lnvpair
+dltraninfo.ln := LDLIBS += -ldladm -lsff -lnvpair
dlled := LDLIBS += -ldladm
dlsend := LDLIBS += -ldlpi -lsocket -lmd
dlrecv := LDLIBS += -ldlpi
@@ -35,6 +37,9 @@ install: all $(ROOTCMD)
clean:
-lint: lint_PROG
+%.ln: %.c
+ $(LINT.c) $< $(LDLIBS)
+
+lint: $(LINTPROGS)
include ../Makefile.targ
diff --git a/usr/src/lib/fm/topo/modules/common/shared/topo_port.c b/usr/src/lib/fm/topo/modules/common/shared/topo_port.c
index 29efcf6bd9..8f0ba8690e 100644
--- a/usr/src/lib/fm/topo/modules/common/shared/topo_port.c
+++ b/usr/src/lib/fm/topo/modules/common/shared/topo_port.c
@@ -113,7 +113,7 @@ error:
nvlist_free(fmri);
nvlist_free(auth);
nvlist_free(presource);
- return (tn);
+ return (NULL);
}
int
diff --git a/usr/src/lib/libsff/common/libsff.c b/usr/src/lib/libsff/common/libsff.c
index cd0a1228a6..43ca69c75d 100644
--- a/usr/src/lib/libsff/common/libsff.c
+++ b/usr/src/lib/libsff/common/libsff.c
@@ -33,6 +33,7 @@
#include <strings.h>
#include <libsff.h>
#include <errno.h>
+#include <ctype.h>
#include "sff.h"
@@ -852,7 +853,8 @@ sff_parse_string(const uint8_t *buf, uint_t start, uint_t len,
* characters that aren't, don't include this string.
*/
for (i = 0; i < len; i++) {
- if (buf[start + i] < ' ' || buf[start + i] > '~') {
+ if (isascii(buf[start + i]) == 0 ||
+ isprint(buf[start + i]) == 0) {
return (0);
}
}
diff --git a/usr/src/pkg/manifests/service-fault-management.mf b/usr/src/pkg/manifests/service-fault-management.mf
index c2dd3890ee..e83432f48f 100644
--- a/usr/src/pkg/manifests/service-fault-management.mf
+++ b/usr/src/pkg/manifests/service-fault-management.mf
@@ -569,6 +569,7 @@ file path=usr/lib/fm/topo/plugins/disk.so mode=0555
file path=usr/lib/fm/topo/plugins/fac_prov_ipmi.so mode=0555
file path=usr/lib/fm/topo/plugins/fac_prov_mptsas.so mode=0555
file path=usr/lib/fm/topo/plugins/ipmi.so mode=0555
+file path=usr/lib/fm/topo/plugins/nic.so mode=0555
file path=usr/lib/fm/topo/plugins/ses.so mode=0555
file path=usr/lib/fm/topo/plugins/xfp.so mode=0555
#
diff --git a/usr/src/pkg/manifests/system-kernel.man9e.inc b/usr/src/pkg/manifests/system-kernel.man9e.inc
index a3e8bc6788..b45d3cbabe 100644
--- a/usr/src/pkg/manifests/system-kernel.man9e.inc
+++ b/usr/src/pkg/manifests/system-kernel.man9e.inc
@@ -37,6 +37,7 @@ file path=usr/share/man/man9e/ioctl.9e
file path=usr/share/man/man9e/ks_snapshot.9e
file path=usr/share/man/man9e/ks_update.9e
file path=usr/share/man/man9e/mac.9e
+file path=usr/share/man/man9e/mac_capab_transceiver.9e
file path=usr/share/man/man9e/mc_getcapab.9e
file path=usr/share/man/man9e/mc_getprop.9e
file path=usr/share/man/man9e/mc_getstat.9e
@@ -94,6 +95,8 @@ link path=usr/share/man/man9e/gldv3.9e target=mac.9e
link path=usr/share/man/man9e/intro.9e target=Intro.9e
link path=usr/share/man/man9e/mc_close.9e target=mc_open.9e
link path=usr/share/man/man9e/mc_stop.9e target=mc_start.9e
+link path=usr/share/man/man9e/mct_info.9e target=mac_capab_transceiver.9e
+link path=usr/share/man/man9e/mct_read.9e target=mac_capab_transceiver.9e
link path=usr/share/man/man9e/tran_destroy_pkt.9e target=tran_init_pkt.9e
link path=usr/share/man/man9e/tran_pkt_constructor.9e target=tran_setup_pkt.9e
link path=usr/share/man/man9e/tran_pkt_destructor.9e target=tran_setup_pkt.9e
diff --git a/usr/src/pkg/manifests/system-kernel.man9f.inc b/usr/src/pkg/manifests/system-kernel.man9f.inc
index f613ee4800..d12a1900d5 100644
--- a/usr/src/pkg/manifests/system-kernel.man9f.inc
+++ b/usr/src/pkg/manifests/system-kernel.man9f.inc
@@ -327,6 +327,7 @@ file path=usr/share/man/man9f/mac_maxsdu_update.9f
file path=usr/share/man/man9f/mac_prop_info.9f
file path=usr/share/man/man9f/mac_register.9f
file path=usr/share/man/man9f/mac_rx.9f
+file path=usr/share/man/man9f/mac_transceiver_info.9f
file path=usr/share/man/man9f/mac_tx_update.9f
file path=usr/share/man/man9f/makecom.9f
file path=usr/share/man/man9f/makedevice.9f
@@ -1017,6 +1018,10 @@ link path=usr/share/man/man9f/mac_prop_info_set_perm.9f \
target=mac_prop_info.9f
link path=usr/share/man/man9f/mac_prop_info_set_range_uint32.9f \
target=mac_prop_info.9f
+link path=usr/share/man/man9f/mac_transceiver_info_set_present.9f \
+ target=mac_transceiver_info.9f
+link path=usr/share/man/man9f/mac_transceiver_info_set_usable.9f \
+ target=mac_transceiver_info.9f
link path=usr/share/man/man9f/mac_unregister.9f target=mac_register.9f
link path=usr/share/man/man9f/makecom_g0.9f target=makecom.9f
link path=usr/share/man/man9f/makecom_g0_s.9f target=makecom.9f
diff --git a/usr/src/pkg/manifests/system-library.mf b/usr/src/pkg/manifests/system-library.mf
index 87b6465d5e..523abb44d7 100644
--- a/usr/src/pkg/manifests/system-library.mf
+++ b/usr/src/pkg/manifests/system-library.mf
@@ -375,6 +375,7 @@ file path=usr/lib/$(ARCH64)/libreparse.so.1
$(i386_ONLY)file path=usr/lib/$(ARCH64)/libsaveargs.so.1
file path=usr/lib/$(ARCH64)/libsched.so.1
file path=usr/lib/$(ARCH64)/libsctp.so.1
+file path=usr/lib/$(ARCH64)/libsff.so.1
file path=usr/lib/$(ARCH64)/libshell.so.1
file path=usr/lib/$(ARCH64)/libsip.so.1
file path=usr/lib/$(ARCH64)/libsldap.so.1
@@ -450,6 +451,7 @@ file path=usr/lib/libraidcfg.so.1
file path=usr/lib/libreparse.so.1
file path=usr/lib/libsched.so.1
file path=usr/lib/libsctp.so.1
+file path=usr/lib/libsff.so.1
file path=usr/lib/libshell.so.1
file path=usr/lib/libsip.so.1
file path=usr/lib/libsldap.so.1
diff --git a/usr/src/pkg/manifests/system-network.mf b/usr/src/pkg/manifests/system-network.mf
index bcc96e4b34..fd44515945 100644
--- a/usr/src/pkg/manifests/system-network.mf
+++ b/usr/src/pkg/manifests/system-network.mf
@@ -43,6 +43,7 @@ dir path=etc/nwam group=netadm owner=netadm
dir path=etc/nwam/loc group=netadm owner=netadm
dir path=etc/nwam/loc/NoNet group=netadm owner=netadm
dir path=sbin group=sys
+dir path=usr/lib/dl
dir path=usr/share/man
dir path=usr/share/man/man1m
file path=etc/default/dhcpagent group=sys \
@@ -82,6 +83,7 @@ file path=sbin/dlstat mode=0555
file path=sbin/flowadm mode=0555
file path=sbin/flowstat mode=0555
file path=sbin/ipadm mode=0555
+file path=usr/lib/dl/dltraninfo mode=0555
file path=usr/share/man/man1m/dladm.1m
file path=usr/share/man/man1m/flowadm.1m
file path=usr/share/man/man1m/ipadm.1m
diff --git a/usr/src/pkg/manifests/system-test-utiltest.mf b/usr/src/pkg/manifests/system-test-utiltest.mf
index 045ba608b0..1bf15858bd 100644
--- a/usr/src/pkg/manifests/system-test-utiltest.mf
+++ b/usr/src/pkg/manifests/system-test-utiltest.mf
@@ -31,6 +31,7 @@ dir path=opt/util-tests/tests/dis/i386
dir path=opt/util-tests/tests/dis/sparc
dir path=opt/util-tests/tests/files
dir path=opt/util-tests/tests/libnvpair_json
+dir path=opt/util-tests/tests/libsff
file path=opt/util-tests/README mode=0444
file path=opt/util-tests/bin/print_json mode=0555
file path=opt/util-tests/bin/utiltest mode=0555
@@ -237,6 +238,36 @@ file path=opt/util-tests/tests/libnvpair_json/json_05_strings mode=0555
file path=opt/util-tests/tests/libnvpair_json/json_06_nested mode=0555
file path=opt/util-tests/tests/libnvpair_json/json_07_nested_arrays mode=0555
file path=opt/util-tests/tests/libnvpair_json/json_common mode=0555
+file path=opt/util-tests/tests/libsff/libsff mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8472 mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8472.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_8636_diag mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8636_diag.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_8636_extspec mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8636_extspec.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_8636_tech mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8636_tech.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_8636_temp mode=0555
+file path=opt/util-tests/tests/libsff/libsff_8636_temp.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_br mode=0555
+file path=opt/util-tests/tests/libsff/libsff_br.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_compliance mode=0555
+file path=opt/util-tests/tests/libsff/libsff_compliance.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_conn mode=0555
+file path=opt/util-tests/tests/libsff/libsff_conn.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_efault mode=0555
+file path=opt/util-tests/tests/libsff/libsff_einval mode=0555
+file path=opt/util-tests/tests/libsff/libsff_enc mode=0555
+file path=opt/util-tests/tests/libsff/libsff_enc.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_ident mode=0555
+file path=opt/util-tests/tests/libsff/libsff_ident.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_lengths mode=0555
+file path=opt/util-tests/tests/libsff/libsff_lengths.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_opts mode=0555
+file path=opt/util-tests/tests/libsff/libsff_opts.out mode=0444
+file path=opt/util-tests/tests/libsff/libsff_strings mode=0555
+file path=opt/util-tests/tests/libsff/libsff_wave mode=0555
+file path=opt/util-tests/tests/libsff/libsff_wave.out mode=0444
file path=opt/util-tests/tests/printf_test mode=0555
file path=opt/util-tests/tests/set-linkprop mode=0555
file path=opt/util-tests/tests/xargs_test mode=0555
diff --git a/usr/src/test/util-tests/tests/libsff/Makefile b/usr/src/test/util-tests/tests/libsff/Makefile
index a4134ae739..b379b5023b 100644
--- a/usr/src/test/util-tests/tests/libsff/Makefile
+++ b/usr/src/test/util-tests/tests/libsff/Makefile
@@ -33,9 +33,12 @@ DIFF_PROGS = \
libsff_opts \
libsff_wave
-PROGS = $(DIFF_PROGS) \
+ERR_PROGS = \
libsff_efault \
- libsff_einval \
+ libsff_einval
+
+PROGS = $(DIFF_PROGS) \
+ $(ERR_PROGS) \
libsff_strings
SCRIPTS = libsff
@@ -50,7 +53,14 @@ $(CMDS) := FILEMODE = 0555
$(OUTFILES) := FILEMODE = 0444
CPPFLAGS += -I$(SRC)/lib/libsff/common
-LDLIBS += -lsff -lnvpair
+
+#
+# Different tests require different sets of libraries. If we try and use
+# the same set, we'll get guidance errors from ld.
+#
+$(ERR_PROGS) := LDLIBS += -lsff
+$(DIFF_PROGS) := LDLIBS += -lsff -lnvpair
+libsff_strings := LDLIBS += -lsff -lnvpair
all: $(PROGS)
@@ -76,6 +86,4 @@ $(TESTDIR)/%: %.ksh
%: %.c
$(LINK.c) -o $@ $< $(LDLIBS)
- $(POST_PROCESS_O)
-
-
+ $(POST_PROCESS)
diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_main.c b/usr/src/uts/common/io/ixgbe/ixgbe_main.c
index 3ca88e4696..c44a5de359 100644
--- a/usr/src/uts/common/io/ixgbe/ixgbe_main.c
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_main.c
@@ -25,7 +25,7 @@
/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2017, Joyent, Inc.
+ * Copyright (c) 2017, Joyent, Inc.
* Copyright 2012 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2013 Saso Kiselkov. All rights reserved.
* Copyright (c) 2013 OSN Online Service Nuernberg GmbH. All rights reserved.
diff --git a/usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c b/usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c
index aa3f6a75fe..131b43d418 100644
--- a/usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c
+++ b/usr/src/uts/common/io/ixgbe/ixgbe_transceiver.c
@@ -149,13 +149,13 @@ ixgbe_transceiver_read(void *arg, uint_t id, uint_t page, void *bp,
return (EINVAL);
}
- for (i = 0; i < nbytes; i++, offset++, bp++) {
+ for (i = 0; i < nbytes; i++, offset++, buf++) {
int32_t ret;
if (page == 0xa0) {
- ret = hw->phy.ops.read_i2c_eeprom(hw, offset, bp);
+ ret = hw->phy.ops.read_i2c_eeprom(hw, offset, buf);
} else {
- ret = hw->phy.ops.read_i2c_sff8472(hw, offset, bp);
+ ret = hw->phy.ops.read_i2c_sff8472(hw, offset, buf);
}
if (ret != 0) {
mutex_exit(&ixgbe->gen_lock);
diff --git a/usr/src/uts/common/io/mac/mac.c b/usr/src/uts/common/io/mac/mac.c
index 1fcc38fb54..769babb520 100644
--- a/usr/src/uts/common/io/mac/mac.c
+++ b/usr/src/uts/common/io/mac/mac.c
@@ -8139,8 +8139,8 @@ mac_transceiver_read(mac_handle_t mh, uint_t tranid, uint_t page, void *buf,
ret = mip->mi_transceiver.mct_read(mip->mi_driver, tranid, page, buf,
nbytes, offset, nread);
if (ret == 0 && *nread > nbytes) {
- dev_err(mip->mi_dip, CE_PANIC, "driver wrote %ld bytes into "
- "%ld byte sized buffer, possible memory corruption",
+ dev_err(mip->mi_dip, CE_PANIC, "driver wrote %lu bytes into "
+ "%lu byte sized buffer, possible memory corruption",
*nread, nbytes);
}
diff --git a/usr/src/uts/common/sys/mac_provider.h b/usr/src/uts/common/sys/mac_provider.h
index 5d94a0d7d8..42104a5283 100644
--- a/usr/src/uts/common/sys/mac_provider.h
+++ b/usr/src/uts/common/sys/mac_provider.h
@@ -111,6 +111,8 @@ typedef enum {
MAC_CAPAB_OVERLAY = 0x00800000, /* boolean only, no data */
MAC_CAPAB_TRANSCEIVER = 0x01000000, /* mac_capab_transciever_t */
MAC_CAPAB_LED = 0x02000000, /* data is mac_capab_led_t */
+ MAC_CAPAB_VRRP = 0x00400000, /* data is mac_capab_vrrp_t */
+ MAC_CAPAB_TRANSCEIVER = 0x01000000 /* mac_capab_transciever_t */
} mac_capab_t;
/*