Print this page
NEX-3856 panic is occurred in module "fct" due to a NULL pointer dereference
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Steve Peng <steve.peng@nexenta.com>
NEX-3277 Panic of both nodes in failover time (FC clients)
        Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
        Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
NEX-2787 Multiple comstar / fibre channel / qlt threads stuck waiting on locks with a spinning interrupt thread
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Approved by: Jean McCormack <jean.mccormack@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/fct/fct_impl.h
          +++ new/usr/src/uts/common/io/comstar/port/fct/fct_impl.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
       23 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  #ifndef _FCT_IMPL_H
  26   27  #define _FCT_IMPL_H
  27   28  
  28   29  #ifdef  __cplusplus
  29   30  extern "C" {
  30   31  #endif
  31   32  
  32   33  #define RSCN_OPTION_VERIFY      0x0001
↓ open down ↓ 32 lines elided ↑ open up ↑
  65   66  #define USEC_DEREG_RP_INTERVAL  (2 * 1000 * 1000)
  66   67  
  67   68  struct fct_i_cmd;
  68   69  typedef void (* fct_icmd_cb_t)(struct fct_i_cmd *icmd);
  69   70  typedef struct fct_i_cmd {
  70   71          fct_cmd_t               *icmd_cmd;
  71   72          uint32_t                 icmd_alloc_size;
  72   73          fct_struct_id_t          icmd_struct_id;
  73   74          uint32_t                 icmd_flags;
  74   75          clock_t                  icmd_start_time;
  75      -        struct fct_i_cmd        *icmd_next;     /* iport_abort_queue and irp */
       76 +        list_node_t             icmd_node;      /* iport_abort_queue and irp */
  76   77          struct fct_i_cmd        *icmd_solcmd_next;      /* iport_solcmd_queue */
  77   78          fct_icmd_cb_t            icmd_cb;
  78   79          void                    *icmd_cb_private;
  79   80  } fct_i_cmd_t;
  80   81  
  81   82  /*
  82   83   * icmd_flags
  83   84   */
  84   85  #define ICMD_SESSION_AFFECTING          0x0002
  85   86  #define ICMD_IN_IRP_QUEUE               0x0004
↓ open down ↓ 23 lines elided ↑ open up ↑
 109  110          uint32_t                        irp_alloc_size;
 110  111          fct_struct_id_t                 irp_struct_id;
 111  112          krwlock_t                       irp_lock;
 112  113  
 113  114          /* For queueing to local port */
 114  115          struct fct_i_remote_port        *irp_next;
 115  116  
 116  117          /* For queueing to handle elses */
 117  118          struct fct_i_remote_port        *irp_discovery_next;
 118  119  
 119      -        fct_i_cmd_t                     *irp_els_list;
      120 +        list_t                          irp_els_list;
 120  121  
 121  122          /*
 122  123           * sa stands for session affecting, nsa is non session affecting.
 123  124           * The els counts only represent elses under progress not the ones
 124  125           * that are terminated. active_xchg_count covers everything including
 125  126           * the ones waiting to be terminated.
 126  127           */
 127  128          uint16_t                        irp_sa_elses_count;
 128  129          uint16_t                        irp_nsa_elses_count;
 129  130          uint16_t                        irp_fcp_xchg_count;
↓ open down ↓ 7 lines elided ↑ open up ↑
 137  138          uint8_t                         irp_id[24];
 138  139          uint32_t                        irp_rcvd_prli_params;
 139  140          uint32_t                        irp_sent_prli_params;
 140  141  
 141  142          /*
 142  143           * Most HBAs will only register symbolic node name instead of port name,
 143  144           * so we use SNN as session alias.
 144  145           */
 145  146          stmf_scsi_session_t             *irp_session;
 146  147          char                            *irp_snn;
      148 +        uint16_t                        irp_snn_len;
 147  149  
 148  150          /* items will be filled in ns cmd */
 149  151          uint8_t                         irp_fc4types[32]; /* FC-4 types */
 150  152          char                            *irp_spn;       /* port symbolic name */
      153 +        uint16_t                        irp_spn_len;
 151  154          uint32_t                        irp_cos;        /* class of service */
 152  155  
 153  156          uint32_t                        irp_rscn_counter;
 154  157  } fct_i_remote_port_t;
 155  158  
 156  159  /*
 157  160   * structure used for fct_rls_cb() callback private data
 158  161   */
 159  162  typedef struct fct_rls_cb_data {
 160  163          struct fct_port_link_status     *fct_link_status;
↓ open down ↓ 64 lines elided ↑ open up ↑
 225  228  
 226  229          /*
 227  230           * Max active cmds in last interval (10 or 30 seconds)
 228  231           */
 229  232          uint32_t                iport_max_active_ncmds;
 230  233  
 231  234          /*
 232  235           * # of free cmds sitting on the iport_cached_cmdlist
 233  236           */
 234  237          uint32_t                iport_cached_ncmds;
 235      -        struct fct_i_cmd        *iport_cached_cmdlist;
      238 +        list_t                  iport_cached_cmdlist;
 236  239          kmutex_t                iport_cached_cmd_lock;
 237  240  
 238  241          /*
 239  242           * To release free cmds periodically
 240  243           */
 241  244          clock_t                 iport_cmdcheck_clock;
 242  245  
 243  246          uint16_t                iport_task_green_limit;
 244  247          uint16_t                iport_task_yellow_limit;
 245  248          uint16_t                iport_task_red_limit;
↓ open down ↓ 8 lines elided ↑ open up ↑
 254  257          uint8_t                 iport_link_cleanup_retry;
 255  258          clock_t                 iport_li_cmd_timeout; /* for li state m/c */
 256  259          fct_cmd_slot_t          *iport_cmd_slots;
 257  260  
 258  261          /* worker thread data */
 259  262          ddi_taskq_t             *iport_worker_taskq;
 260  263          kmutex_t                iport_worker_lock;
 261  264          kcondvar_t              iport_worker_cv;
 262  265          struct fct_i_event      *iport_event_head;
 263  266          struct fct_i_event      *iport_event_tail;
 264      -        struct fct_i_cmd        *iport_abort_queue;
 265      -        struct fct_i_cmd        **iport_ppicmd_term;
      267 +        list_t                  iport_abort_queue;
      268 +        struct fct_i_cmd        *iport_ppicmd_term;
 266  269  
 267  270          /* link initialization */
 268  271          fct_status_t            iport_li_comp_status;
 269  272          enum fct_li_state       iport_li_state;
 270  273  
 271  274          /* solicited cmd link */
 272  275          struct fct_i_cmd        *iport_solcmd_queue;
 273  276  
 274  277          /* rpwe = remote port with pending els(es) */
 275  278          fct_i_remote_port_t     *iport_rpwe_head;
↓ open down ↓ 152 lines elided ↑ open up ↑
 428  431  void fct_handle_solct(fct_cmd_t *cmd);
 429  432  void fct_post_to_solcmd_queue(fct_local_port_t *port, fct_cmd_t *cmd);
 430  433  void fct_logo_cb(fct_i_cmd_t *icmd);
 431  434  void fct_link_init_cb(fct_i_cmd_t *icmd);
 432  435  void fct_gsnn_cb(fct_i_cmd_t *icmd);
 433  436  void fct_gcs_cb(fct_i_cmd_t *icmd);
 434  437  void fct_gft_cb(fct_i_cmd_t *icmd);
 435  438  void fct_gspn_cb(fct_i_cmd_t *icmd);
 436  439  void fct_rls_cb(fct_i_cmd_t *icmd);
 437  440  disc_action_t fct_process_link_init(fct_i_local_port_t *iport);
      441 +void fct_cmd_unlink_els(fct_i_remote_port_t *irp, fct_i_cmd_t *icmd);
 438  442  
 439  443  #ifdef  __cplusplus
 440  444  }
 441  445  #endif
 442  446  
 443  447  #endif /* _FCT_IMPL_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX