Print this page
10686 Debug macros causes smatch issues

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h
          +++ new/usr/src/uts/common/io/comstar/port/srpt/srpt_impl.h
↓ open down ↓ 15 lines elided ↑ open up ↑
  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  /*
  23   23   * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2019, Joyent, Inc.
       28 + */
       29 +
  26   30  #ifndef _SRPT_IMPL_H_
  27   31  #define _SRPT_IMPL_H_
  28   32  
  29   33  /*
  30   34   * Prototypes and data structures for the SRP Target Port Provider.
  31   35   */
  32   36  
  33   37  #include <sys/types.h>
  34   38  #include <sys/ddi.h>
  35   39  #include <sys/ib/ibtl/ibti.h>
↓ open down ↓ 49 lines elided ↑ open up ↑
  85   89  
  86   90  /*
  87   91   * SRP Session - represents a SCSI I_T_Nexus.
  88   92   *
  89   93   * Sessions map 1 or more initiator logins to a specific I/O
  90   94   * Controller SCSI Target Port.  Targets create sessions
  91   95   * at initiator login and release when no longer referenced
  92   96   * by a login.
  93   97   */
  94   98  typedef struct srpt_session_s {
  95      -        krwlock_t                       ss_rwlock;
       99 +        krwlock_t                       ss_rwlock;
  96  100          list_node_t                     ss_node;
  97  101  
  98  102          /*
  99  103           * ADVANCED FEATURE, NOT YET SUPPORTED.
 100  104           * In multi-channel mode, multiple RDMA communication
 101  105           * channels may reference the same SCSI session.  When
 102  106           * a channel releases its reference to the SCSI session,
 103  107           * it should have no tasks associated with the session.
 104  108           *
 105  109           * If multi-channel is implemented, add a channel list
↓ open down ↓ 54 lines elided ↑ open up ↑
 160  164   * SRP Channel - the RDMA communications channel associated with
 161  165   * a specific SRP login.
 162  166   */
 163  167  typedef enum srpt_channel_state_e {
 164  168          SRPT_CHANNEL_CONNECTING = 0,
 165  169          SRPT_CHANNEL_CONNECTED,
 166  170          SRPT_CHANNEL_DISCONNECTING
 167  171  } srpt_channel_state_t;
 168  172  
 169  173  typedef struct srpt_channel_s {
 170      -        krwlock_t                       ch_rwlock;
      174 +        krwlock_t                       ch_rwlock;
 171  175  
 172  176          kmutex_t                        ch_reflock;
 173  177          uint_t                          ch_refcnt;
 174  178          kcondvar_t                      ch_cv_complete;
 175  179          uint_t                          ch_cv_waiters;
 176  180  
 177  181          list_node_t                     ch_stp_node;
 178  182          srpt_channel_state_t            ch_state;
 179  183          ibt_cq_hdl_t                    ch_scq_hdl;
 180  184          ibt_cq_hdl_t                    ch_rcq_hdl;
↓ open down ↓ 134 lines elided ↑ open up ↑
 315  319  
 316  320  /*
 317  321   * SRP Target hardware device.  A SRP Target hardware device
 318  322   * is an IB HCA.  All ports of the HCA comprise a single
 319  323   * I/O Controller that is registered with the IB Device
 320  324   * Managment Agent.
 321  325   */
 322  326  typedef struct srpt_ioc_s {
 323  327          list_node_t                     ioc_node;
 324  328  
 325      -        krwlock_t                       ioc_rwlock;
      329 +        krwlock_t                       ioc_rwlock;
 326  330          ibt_hca_hdl_t                   ioc_ibt_hdl;
 327  331          ibt_hca_attr_t                  ioc_attr;
 328  332          ib_guid_t                       ioc_guid;
 329  333  
 330  334          /*
 331  335           * By default each HCA is a single SRP.T10 service based on
 332  336           * the HCA GUID.  We have implemented the target here as a
 333  337           * pointer to facilitate moving to a list of targets if
 334  338           * appropriate down the road.
 335  339           */
↓ open down ↓ 175 lines elided ↑ open up ↑
 511  515                                          cmn_err(CE_NOTE, __VA_ARGS__);\
 512  516                                  }
 513  517  #ifdef  DEBUG
 514  518  #define SRPT_DPRINTF_L3(...)    if (srpt_errlevel >= SRPT_LOG_L3) { \
 515  519                                          cmn_err(CE_NOTE, __VA_ARGS__);\
 516  520                                  }
 517  521  #define SRPT_DPRINTF_L4(...)    if (srpt_errlevel >= SRPT_LOG_L4) { \
 518  522                                          cmn_err(CE_NOTE, __VA_ARGS__);\
 519  523                                  }
 520  524  #else
 521      -#define SRPT_DPRINTF_L3         0 &&
 522      -#define SRPT_DPRINTF_L4         0 &&
      525 +#define SRPT_DPRINTF_L3(...)
      526 +#define SRPT_DPRINTF_L4(...)
 523  527  #endif
 524  528  
 525  529  #ifdef __cplusplus
 526  530  }
 527  531  #endif
 528  532  
 529  533  #endif /* _SRPT_IMPL_H_ */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX