Print this page
10686 Debug macros causes smatch issues


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 




  26 #ifndef _SYS_IB_EOIB_ENX_IMPL_H
  27 #define _SYS_IB_EOIB_ENX_IMPL_H
  28 
  29 #ifdef __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <sys/ddi.h>
  34 #include <sys/sunddi.h>
  35 #include <sys/varargs.h>
  36 #include <sys/ib/ibtl/ibti.h>
  37 #include <sys/ib/ibtl/ibvti.h>
  38 #include <sys/ib/ib_pkt_hdrs.h>
  39 #include <sys/ib/ibtl/impl/ibtl_ibnex.h>
  40 #include <sys/ib/mgt/sm_attr.h>
  41 
  42 #include <sys/ib/clients/eoib/fip.h>
  43 #include <sys/ib/clients/eoib/eib.h>
  44 
  45 /*


  54  * Debug messages
  55  */
  56 #define ENX_MSGS_CRIT           0x01
  57 #define ENX_MSGS_ERR            0x02
  58 #define ENX_MSGS_WARN           0x04
  59 #define ENX_MSGS_DEBUG          0x08
  60 #define ENX_MSGS_ARGS           0x10
  61 #define ENX_MSGS_VERBOSE        0x20
  62 #define ENX_MSGS_DEFAULT        (ENX_MSGS_CRIT | ENX_MSGS_ERR | ENX_MSGS_WARN)
  63 
  64 #define ENX_LOGSZ_DEFAULT       0x20000
  65 
  66 #define ENX_DPRINTF_CRIT        eibnx_dprintf_crit
  67 #define ENX_DPRINTF_ERR         eibnx_dprintf_err
  68 #define ENX_DPRINTF_WARN        eibnx_dprintf_warn
  69 #ifdef ENX_DEBUG
  70 #define ENX_DPRINTF_DEBUG       eibnx_dprintf_debug
  71 #define ENX_DPRINTF_ARGS        eibnx_dprintf_args
  72 #define ENX_DPRINTF_VERBOSE     eibnx_dprintf_verbose
  73 #else
  74 #define ENX_DPRINTF_DEBUG       0 &&
  75 #define ENX_DPRINTF_ARGS        0 &&
  76 #define ENX_DPRINTF_VERBOSE     0 &&
  77 #endif
  78 
  79 /*
  80  *  EoIB Nexus service threads
  81  */
  82 #define ENX_PORT_MONITOR        "eibnx_port_%d_monitor"
  83 #define ENX_NODE_CREATOR        "eibnx_node_creator"
  84 
  85 /*
  86  * Default period (us) for unicast solicitations to discovered gateways.
  87  * EoIB specification requires that hosts send solicitation atleast every
  88  * 4 * GW_ADV_PERIOD.
  89  */
  90 #define ENX_DFL_SOLICIT_PERIOD_USEC     32000000
  91 
  92 /*
  93  * Portinfo list per HCA
  94  */
  95 typedef struct eibnx_port_s {
  96         struct eibnx_port_s     *po_next;




   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*
  27  * Copyright 2019, Joyent, Inc.
  28  */
  29 
  30 #ifndef _SYS_IB_EOIB_ENX_IMPL_H
  31 #define _SYS_IB_EOIB_ENX_IMPL_H
  32 
  33 #ifdef __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 #include <sys/ddi.h>
  38 #include <sys/sunddi.h>
  39 #include <sys/varargs.h>
  40 #include <sys/ib/ibtl/ibti.h>
  41 #include <sys/ib/ibtl/ibvti.h>
  42 #include <sys/ib/ib_pkt_hdrs.h>
  43 #include <sys/ib/ibtl/impl/ibtl_ibnex.h>
  44 #include <sys/ib/mgt/sm_attr.h>
  45 
  46 #include <sys/ib/clients/eoib/fip.h>
  47 #include <sys/ib/clients/eoib/eib.h>
  48 
  49 /*


  58  * Debug messages
  59  */
  60 #define ENX_MSGS_CRIT           0x01
  61 #define ENX_MSGS_ERR            0x02
  62 #define ENX_MSGS_WARN           0x04
  63 #define ENX_MSGS_DEBUG          0x08
  64 #define ENX_MSGS_ARGS           0x10
  65 #define ENX_MSGS_VERBOSE        0x20
  66 #define ENX_MSGS_DEFAULT        (ENX_MSGS_CRIT | ENX_MSGS_ERR | ENX_MSGS_WARN)
  67 
  68 #define ENX_LOGSZ_DEFAULT       0x20000
  69 
  70 #define ENX_DPRINTF_CRIT        eibnx_dprintf_crit
  71 #define ENX_DPRINTF_ERR         eibnx_dprintf_err
  72 #define ENX_DPRINTF_WARN        eibnx_dprintf_warn
  73 #ifdef ENX_DEBUG
  74 #define ENX_DPRINTF_DEBUG       eibnx_dprintf_debug
  75 #define ENX_DPRINTF_ARGS        eibnx_dprintf_args
  76 #define ENX_DPRINTF_VERBOSE     eibnx_dprintf_verbose
  77 #else
  78 #define ENX_DPRINTF_DEBUG(...)
  79 #define ENX_DPRINTF_ARGS(...)
  80 #define ENX_DPRINTF_VERBOSE(...)
  81 #endif
  82 
  83 /*
  84  *  EoIB Nexus service threads
  85  */
  86 #define ENX_PORT_MONITOR        "eibnx_port_%d_monitor"
  87 #define ENX_NODE_CREATOR        "eibnx_node_creator"
  88 
  89 /*
  90  * Default period (us) for unicast solicitations to discovered gateways.
  91  * EoIB specification requires that hosts send solicitation atleast every
  92  * 4 * GW_ADV_PERIOD.
  93  */
  94 #define ENX_DFL_SOLICIT_PERIOD_USEC     32000000
  95 
  96 /*
  97  * Portinfo list per HCA
  98  */
  99 typedef struct eibnx_port_s {
 100         struct eibnx_port_s     *po_next;