Print this page
10686 Debug macros causes smatch issues

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/ib/clients/eoib/enx_impl.h
          +++ new/usr/src/uts/common/sys/ib/clients/eoib/enx_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) 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2019, Joyent, Inc.
       28 + */
       29 +
  26   30  #ifndef _SYS_IB_EOIB_ENX_IMPL_H
  27   31  #define _SYS_IB_EOIB_ENX_IMPL_H
  28   32  
  29   33  #ifdef __cplusplus
  30   34  extern "C" {
  31   35  #endif
  32   36  
  33   37  #include <sys/ddi.h>
  34   38  #include <sys/sunddi.h>
  35   39  #include <sys/varargs.h>
↓ open down ↓ 28 lines elided ↑ open up ↑
  64   68  #define ENX_LOGSZ_DEFAULT       0x20000
  65   69  
  66   70  #define ENX_DPRINTF_CRIT        eibnx_dprintf_crit
  67   71  #define ENX_DPRINTF_ERR         eibnx_dprintf_err
  68   72  #define ENX_DPRINTF_WARN        eibnx_dprintf_warn
  69   73  #ifdef ENX_DEBUG
  70   74  #define ENX_DPRINTF_DEBUG       eibnx_dprintf_debug
  71   75  #define ENX_DPRINTF_ARGS        eibnx_dprintf_args
  72   76  #define ENX_DPRINTF_VERBOSE     eibnx_dprintf_verbose
  73   77  #else
  74      -#define ENX_DPRINTF_DEBUG       0 &&
  75      -#define ENX_DPRINTF_ARGS        0 &&
  76      -#define ENX_DPRINTF_VERBOSE     0 &&
       78 +#define ENX_DPRINTF_DEBUG(...)
       79 +#define ENX_DPRINTF_ARGS(...)
       80 +#define ENX_DPRINTF_VERBOSE(...)
  77   81  #endif
  78   82  
  79   83  /*
  80   84   *  EoIB Nexus service threads
  81   85   */
  82   86  #define ENX_PORT_MONITOR        "eibnx_port_%d_monitor"
  83   87  #define ENX_NODE_CREATOR        "eibnx_node_creator"
  84   88  
  85   89  /*
  86   90   * Default period (us) for unicast solicitations to discovered gateways.
  87   91   * EoIB specification requires that hosts send solicitation atleast every
  88   92   * 4 * GW_ADV_PERIOD.
  89   93   */
  90   94  #define ENX_DFL_SOLICIT_PERIOD_USEC     32000000
  91   95  
  92   96  /*
  93   97   * Portinfo list per HCA
  94   98   */
  95   99  typedef struct eibnx_port_s {
  96      -        struct eibnx_port_s     *po_next;
      100 +        struct eibnx_port_s     *po_next;
  97  101          ibt_hca_portinfo_t      *po_pi;
  98  102          uint_t                  po_pi_size;
  99  103  } eibnx_port_t;
 100  104  
 101  105  /*
 102  106   * HCA details
 103  107   */
 104  108  typedef struct eibnx_hca_s {
 105      -        struct eibnx_hca_s      *hc_next;
      109 +        struct eibnx_hca_s      *hc_next;
 106  110          ib_guid_t               hc_guid;
 107  111          ibt_hca_hdl_t           hc_hdl;
 108  112          ibt_pd_hdl_t            hc_pd;
 109  113          eibnx_port_t            *hc_port;
 110  114  } eibnx_hca_t;
 111  115  
 112  116  /*
 113  117   * The port_monitor thread in EoIB nexus driver only sends two types of
 114  118   * packets: multicast solicitation the first time around, and periodic
 115  119   * unicast solicitations later to gateways that have been discovered. So
↓ open down ↓ 417 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX