[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7

Mike Christie michaelc at cs.wisc.edu
Sat Apr 7 15:44:14 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 4e8da605ea7855709b964dcbd72c6a39bd6cc8ec
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Fri Mar 16 01:59:55 2012 -0500

    iscsiadm: print port speed and link state
    
    This patch has iscsiadm print the link state and speed for
    offload ports that support that feature in the kernel.

diff --git a/usr/config.h b/usr/config.h
index 768b9e4..998caff 100644
--- a/usr/config.h
+++ b/usr/config.h
@@ -229,6 +229,8 @@ typedef struct iface_rec {
 							   * 1 = enable */
 	uint16_t		mtu;
 	uint16_t		port;
+	char			port_state[ISCSI_MAX_STR_LEN];
+	char			port_speed[ISCSI_MAX_STR_LEN];
 	/*
 	 * TODO: we may have to make this bigger and interconnect
 	 * specific for infinniband 
diff --git a/usr/host.c b/usr/host.c
index 57ea44f..e8c43b7 100644
--- a/usr/host.c
+++ b/usr/host.c
@@ -174,6 +174,16 @@ static int print_host_iface(void *data, struct iface_rec *iface)
 			       iface->ipv6_router);
 	}
 
+	if (!strlen(iface->port_state))
+		printf("%sPort State: %s\n", prefix, UNKNOWN_VALUE);
+	else
+		printf("%sPort State: %s\n", prefix, iface->port_state);
+
+	if (!strlen(iface->port_speed))
+		printf("%sPort Speed: %s\n", prefix, UNKNOWN_VALUE);
+	else
+		printf("%sPort Speed: %s\n", prefix, iface->port_speed);
+
 	if (!iface->port)
 		printf("%sPort: %s\n", prefix, UNKNOWN_VALUE);
 	else
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 2ec5f69..f56554e 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -532,6 +532,12 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no,
 		ret = 0;
 	}
 
+	sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "port_state",
+		      iface->port_state, sizeof(iface->port_state));
+
+	sysfs_get_str(host_id, ISCSI_HOST_SUBSYS, "port_speed",
+		      iface->port_speed, sizeof(iface->port_speed));
+
 	/*
 	 * this is on the session, because we support multiple bindings
 	 * per device.

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list