Print this page
NEX-3622 COMSTAR should have per remote port kstats for I/O and latency
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

@@ -35,10 +35,11 @@
 
 #include <sys/socket.h>
 #include <sys/strsubr.h>
 #include <sys/note.h>
 #include <sys/sdt.h>
+#include <sys/kstat.h>
 
 #include <sys/stmf.h>
 #include <sys/stmf_ioctl.h>
 #include <sys/portif.h>
 #include <sys/idm/idm.h>

@@ -209,10 +210,11 @@
 static void
 iscsit_sess_unref(void *ist_void)
 {
         iscsit_sess_t *ist = ist_void;
         stmf_scsi_session_t *iss;
+        char prop_buf[KSTAT_STRLEN + 1];
 
         /*
          * State machine has run to completion, destroy session
          *
          * If we have an associated STMF session we should clean it

@@ -223,10 +225,13 @@
          */
         mutex_enter(&ist->ist_mutex);
         ASSERT(ist->ist_conn_count == 0);
         iss = ist->ist_stmf_sess;
         if (iss != NULL) {
+                (void) snprintf(prop_buf, sizeof (prop_buf),
+                    "peername_%"PRIxPTR"", (uintptr_t)ist);
+                stmf_remove_rport_info(iss, prop_buf);
                 stmf_deregister_scsi_session(ist->ist_lport, iss);
                 kmem_free(iss->ss_rport_id, sizeof (scsi_devid_desc_t) +
                     strlen(ist->ist_initiator_name) + 1);
                 stmf_remote_port_free(iss->ss_rport);
                 if (iss->ss_rport_alias)