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>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/iscsit/iscsit_sess.c
          +++ new/usr/src/uts/common/io/comstar/port/iscsit/iscsit_sess.c
↓ open down ↓ 29 lines elided ↑ open up ↑
  30   30  #include <sys/ddi.h>
  31   31  #include <sys/sunddi.h>
  32   32  #include <sys/modctl.h>
  33   33  #include <sys/sysmacros.h>
  34   34  #include <sys/scsi/generic/persist.h>
  35   35  
  36   36  #include <sys/socket.h>
  37   37  #include <sys/strsubr.h>
  38   38  #include <sys/note.h>
  39   39  #include <sys/sdt.h>
       40 +#include <sys/kstat.h>
  40   41  
  41   42  #include <sys/stmf.h>
  42   43  #include <sys/stmf_ioctl.h>
  43   44  #include <sys/portif.h>
  44   45  #include <sys/idm/idm.h>
  45   46  
  46   47  #define ISCSIT_SESS_SM_STRINGS
  47   48  #include "iscsit.h"
  48   49  
  49   50  typedef struct {
↓ open down ↓ 154 lines elided ↑ open up ↑
 204  205           * failed.  The resources will get freed later.
 205  206           */
 206  207          return (result);
 207  208  }
 208  209  
 209  210  static void
 210  211  iscsit_sess_unref(void *ist_void)
 211  212  {
 212  213          iscsit_sess_t *ist = ist_void;
 213  214          stmf_scsi_session_t *iss;
      215 +        char prop_buf[KSTAT_STRLEN + 1];
 214  216  
 215  217          /*
 216  218           * State machine has run to completion, destroy session
 217  219           *
 218  220           * If we have an associated STMF session we should clean it
 219  221           * up now.
 220  222           *
 221  223           * This session is no longer associated with a target at this
 222  224           * point so don't touch the target.
 223  225           */
 224  226          mutex_enter(&ist->ist_mutex);
 225  227          ASSERT(ist->ist_conn_count == 0);
 226  228          iss = ist->ist_stmf_sess;
 227  229          if (iss != NULL) {
      230 +                (void) snprintf(prop_buf, sizeof (prop_buf),
      231 +                    "peername_%"PRIxPTR"", (uintptr_t)ist);
      232 +                stmf_remove_rport_info(iss, prop_buf);
 228  233                  stmf_deregister_scsi_session(ist->ist_lport, iss);
 229  234                  kmem_free(iss->ss_rport_id, sizeof (scsi_devid_desc_t) +
 230  235                      strlen(ist->ist_initiator_name) + 1);
 231  236                  stmf_remote_port_free(iss->ss_rport);
 232  237                  if (iss->ss_rport_alias)
 233  238                          strfree(iss->ss_rport_alias);
 234  239                  stmf_free(iss);
 235  240          }
 236  241          mutex_exit(&ist->ist_mutex);
 237  242  
↓ open down ↓ 640 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX