Whamcloud - gitweb
3df2c3a29d8f613dbad9f5900c7d5a51874d35e0
[fs/lustre-release.git] / lnet / klnds / ptllnd / ptllnd.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2005 Cluster File Systems, Inc. All rights reserved.
5  *   Author: PJ Kirner <pjkirner@clusterfs.com>
6  *
7  *   This file is part of the Lustre file system, http://www.lustre.org
8  *   Lustre is a trademark of Cluster File Systems, Inc.
9  *
10  *   This file is confidential source code owned by Cluster File Systems.
11  *   No viewing, modification, compilation, redistribution, or any other
12  *   form of use is permitted except through a signed license agreement.
13  *
14  *   If you have not signed such an agreement, then you have no rights to
15  *   this file.  Please destroy it immediately and contact CFS.
16  *
17  */
18
19 #ifndef EXPORT_SYMTAB
20 # define EXPORT_SYMTAB
21 #endif
22
23 #include <linux/config.h>
24 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/mm.h>
27 #include <linux/string.h>
28 #include <linux/stat.h>
29 #include <linux/errno.h>
30 #include <linux/smp_lock.h>
31 #include <linux/unistd.h>
32 #include <linux/uio.h>
33
34 #include <asm/system.h>
35 #include <asm/uaccess.h>
36 #include <asm/io.h>
37
38 #include <linux/init.h>
39 #include <linux/fs.h>
40 #include <linux/file.h>
41 #include <linux/stat.h>
42 #include <linux/list.h>
43 #include <linux/kmod.h>
44 #include <linux/sysctl.h>
45 #include <linux/random.h>
46
47 #include <net/sock.h>
48 #include <linux/in.h>
49
50
51 #define DEBUG_SUBSYSTEM S_LND
52
53 #include <libcfs/kp30.h>
54 #include <lnet/lnet.h>
55 #include <lnet/lib-lnet.h>
56 #include <portals/p30.h>
57 #ifdef CRAY_XT3
58 #include <portals/ptltrace.h>
59 #endif
60 #include <lnet/ptllnd.h>        /* Depends on portals/p30.h */
61
62 /*
63  * Define this to enable console debug logging
64  * and simulation
65  */
66 //#define PJK_DEBUGGING
67
68 #ifdef CONFIG_SMP
69 # define PTLLND_N_SCHED         num_online_cpus()   /* # schedulers */
70 #else
71 # define PTLLND_N_SCHED         1                   /* # schedulers */
72 #endif
73
74 #define PTLLND_CREDIT_HIGHWATER ((*kptllnd_tunables.kptl_peercredits)-1)
75   /* when eagerly to return credits */
76
77 typedef struct
78 {
79         int             *kptl_ntx;              /* # tx descs to pre-allocate */
80         int             *kptl_max_nodes;        /* max # nodes all talking to me */
81         int             *kptl_max_procs_per_node; /* max # processes per node */
82         int             *kptl_checksum;         /* checksum kptl_msg_t? */
83         int             *kptl_timeout;          /* comms timeout (seconds) */
84         int             *kptl_portal;           /* portal number */
85         int             *kptl_pid;              /* portals PID (self + kernel peers) */
86         int             *kptl_rxb_npages;       /* number of pages for rx buffer */
87         int             *kptl_rxb_nspare;       /* number of spare rx buffers */
88         int             *kptl_credits;          /* number of credits */
89         int             *kptl_peercredits;      /* number of credits */
90         int             *kptl_max_msg_size;     /* max immd message size*/
91         int             *kptl_peer_hash_table_size; /* # slots in peer hash table */
92         int             *kptl_reschedule_loops; /* scheduler yield loops */
93         int             *kptl_ack_puts;         /* make portals ack PUTs */
94 #ifdef CRAY_XT3
95         int             *kptl_ptltrace_on_timeout; /* dump pltrace on timeout? */
96         char           **kptl_ptltrace_basename;  /* ptltrace dump file basename */
97 #endif
98 #ifdef PJK_DEBUGGING
99         int             *kptl_simulation_bitmap;/* simulation bitmap */
100 #endif
101
102 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
103         struct ctl_table_header *kptl_sysctl;    /* sysctl interface */
104 #endif
105 } kptl_tunables_t;
106
107 #include "lnet/ptllnd_wire.h"
108
109 /***********************************************************************/
110
111 typedef struct kptl_data kptl_data_t;
112 typedef struct kptl_rx_buffer kptl_rx_buffer_t;
113 typedef struct kptl_peer kptl_peer_t;
114
115 typedef struct {
116         char      eva_type;
117 } kptl_eventarg_t;
118
119 #define PTLLND_EVENTARG_TYPE_MSG    0x1
120 #define PTLLND_EVENTARG_TYPE_RDMA   0x2
121 #define PTLLND_EVENTARG_TYPE_BUF    0x3
122
123 typedef struct kptl_rx                          /* receive message */
124 {
125         struct list_head        rx_list;        /* queue for attention */
126         kptl_rx_buffer_t       *rx_rxb;         /* the rx buffer pointer */
127         kptl_msg_t             *rx_msg;         /* received message */
128         int                     rx_nob;         /* received message size */
129         unsigned long           rx_treceived;   /* time received */
130         ptl_process_id_t        rx_initiator;   /* sender's address */
131 #ifdef CRAY_XT3
132         ptl_uid_t               rx_uid;         /* sender's uid */
133 #endif
134         kptl_peer_t            *rx_peer;        /* pointer to peer */
135         char                    rx_space[0];    /* copy of incoming request */
136 } kptl_rx_t;
137
138 typedef struct kptl_rx_buffer_pool
139 {
140         spinlock_t              rxbp_lock;
141         struct list_head        rxbp_list;      /* all allocated buffers */
142         int                     rxbp_count;     /* # allocated buffers */
143         int                     rxbp_reserved;  /* # requests to buffer */
144         int                     rxbp_shutdown;  /* shutdown flag */
145 } kptl_rx_buffer_pool_t;
146
147 struct kptl_rx_buffer
148 {
149         kptl_rx_buffer_pool_t  *rxb_pool;
150         struct list_head        rxb_list;       /* for the rxb_pool list */
151         struct list_head        rxb_repost_list;/* for the kptl_sched_rxbq list */
152         int                     rxb_posted:1;   /* on the net */
153         int                     rxb_idle:1;     /* all done */
154         kptl_eventarg_t         rxb_eventarg;   /* event->md.user_ptr */
155         int                     rxb_refcount;   /* reference count */
156         ptl_handle_md_t         rxb_mdh;        /* the portals memory descriptor (MD) handle */
157         char                   *rxb_buffer;     /* the buffer */
158
159 };
160
161 enum kptl_tx_type
162 {
163         TX_TYPE_RESERVED                = 0,
164         TX_TYPE_SMALL_MESSAGE           = 1,
165         TX_TYPE_PUT_REQUEST             = 2,
166         TX_TYPE_GET_REQUEST             = 3,
167         TX_TYPE_PUT_RESPONSE            = 4,
168         TX_TYPE_GET_RESPONSE            = 5,
169 };
170
171 typedef union {
172 #ifdef _USING_LUSTRE_PORTALS_
173         struct iovec iov[PTL_MD_MAX_IOV];
174         lnet_kiov_t kiov[PTL_MD_MAX_IOV];
175 #else
176         ptl_md_iovec_t iov[PTL_MD_MAX_IOV];
177 #endif
178 } kptl_fragvec_t;
179
180 typedef struct kptl_tx                           /* transmit message */
181 {
182         struct list_head        tx_list;      /* queue on idle_txs etc */
183         atomic_t                tx_refcount;  /* reference count*/
184         enum kptl_tx_type       tx_type;      /* small msg/{put,get}{req,resp} */
185         int                     tx_active:1;  /* queued on the peer */
186         int                     tx_idle:1;    /* on the free list */
187         int                     tx_acked:1;   /* portals ACK wanted (for debug only) */
188         kptl_eventarg_t         tx_msg_eventarg; /* event->md.user_ptr */
189         kptl_eventarg_t         tx_rdma_eventarg; /* event->md.user_ptr */
190         int                     tx_status;    /* the status of this tx descriptor */
191         ptl_handle_md_t         tx_rdma_mdh;  /* RDMA buffer */
192         ptl_handle_md_t         tx_msg_mdh;   /* the portals MD handle for the initial message */
193         lnet_msg_t             *tx_lnet_msg;  /* LNET message to finalize */
194         lnet_msg_t             *tx_lnet_replymsg; /* LNET reply message to finalize */
195         kptl_msg_t             *tx_msg;       /* the message data */
196         kptl_peer_t            *tx_peer;      /* the peer this is waiting on */
197         unsigned long           tx_deadline;  /* deadline */
198         unsigned long           tx_tposted;   /* time posted */
199         ptl_md_t                tx_rdma_md;   /* rdma descriptor */
200         kptl_fragvec_t         *tx_frags;     /* buffer fragments */
201 } kptl_tx_t;
202
203 enum kptllnd_peer_state
204 {
205         PEER_STATE_UNINITIALIZED        = 0,
206         PEER_STATE_ALLOCATED            = 1,
207         PEER_STATE_WAITING_HELLO        = 2,
208         PEER_STATE_ACTIVE               = 3,
209         PEER_STATE_CLOSING              = 4,
210         PEER_STATE_ZOMBIE               = 5,
211 };
212
213 struct kptl_peer
214 {
215         struct list_head        peer_list;
216         atomic_t                peer_refcount;          /* The current refrences */
217         enum kptllnd_peer_state peer_state;
218         spinlock_t              peer_lock;              /* serialize */
219         struct list_head        peer_sendq;             /* txs waiting for mh handles */
220         struct list_head        peer_activeq;           /* txs awaiting completion */
221         lnet_process_id_t       peer_id;                /* Peer's LNET id */
222         ptl_process_id_t        peer_ptlid;             /* Peer's portals id */
223         __u64                   peer_incarnation;       /* peer's incarnation */
224         __u64                   peer_myincarnation;     /* my incarnation at HELLO */
225         int                     peer_sent_hello;        /* have I sent HELLO? */
226         int                     peer_credits;           /* number of send credits */
227         int                     peer_outstanding_credits;/* number of peer credits to return */
228         int                     peer_sent_credits;      /* #msg buffers posted for peer */
229         int                     peer_max_msg_size;      /* peer's rx buffer size */
230         int                     peer_error;             /* errno on closing this peer */
231         int                     peer_retry_noop;        /* need to retry returning credits */
232         int                     peer_check_stamp;       /* watchdog check stamp */
233         cfs_time_t              peer_last_alive;        /* when (in jiffies) I was last alive */
234         __u64                   peer_next_matchbits;    /* Next value to register RDMA from peer */
235         __u64                   peer_last_matchbits_seen; /* last matchbits used to RDMA to peer */
236 };
237
238 struct kptl_data
239 {
240         int                     kptl_init;             /* initialisation state */
241         volatile int            kptl_shutdown;         /* shut down? */
242         atomic_t                kptl_nthreads;         /* # live threads */
243         lnet_ni_t              *kptl_ni;               /* _the_ LND instance */
244         ptl_handle_ni_t         kptl_nih;              /* network inteface handle */
245         ptl_process_id_t        kptl_portals_id;       /* Portals ID of interface */
246         __u64                   kptl_incarnation;      /* which one am I */
247         ptl_handle_eq_t         kptl_eqh;              /* Event Queue (EQ) */
248
249         spinlock_t              kptl_sched_lock;       /* serialise... */
250         wait_queue_head_t       kptl_sched_waitq;      /* schedulers sleep here */
251         struct list_head        kptl_sched_txq;        /* tx requiring attention */
252         struct list_head        kptl_sched_rxq;        /* rx requiring attention */
253         struct list_head        kptl_sched_rxbq;       /* rxb requiring reposting */
254
255         wait_queue_head_t       kptl_watchdog_waitq;   /* watchdog sleeps here */
256
257         kptl_rx_buffer_pool_t   kptl_rx_buffer_pool;   /* rx buffer pool */
258         cfs_mem_cache_t*        kptl_rx_cache;         /* rx descripter cache */
259
260         atomic_t                kptl_ntx;              /* # tx descs allocated */
261         spinlock_t              kptl_tx_lock;          /* serialise idle tx list*/
262         struct list_head        kptl_idle_txs;         /* idle tx descriptors */
263
264         rwlock_t                kptl_peer_rw_lock;     /* lock for peer table */
265         struct list_head       *kptl_peers;            /* hash table of all my known peers */
266         struct list_head        kptl_closing_peers;    /* peers being closed */
267         struct list_head        kptl_zombie_peers;     /* peers waiting for refs to drain */
268         int                     kptl_peer_hash_size;   /* size of kptl_peers */
269         int                     kptl_npeers;           /* # peers extant */
270         int                     kptl_n_active_peers;   /* # active peers */
271         int                     kptl_expected_peers;   /* # peers I can buffer HELLOs from */
272
273         kptl_msg_t             *kptl_nak_msg;          /* common NAK message */
274         spinlock_t              kptl_ptlid2str_lock;   /* serialise str ops */
275 };
276
277 enum 
278 {
279         PTLLND_INIT_NOTHING = 0,
280         PTLLND_INIT_DATA,
281         PTLLND_INIT_ALL,
282 };
283
284 extern kptl_tunables_t  kptllnd_tunables;
285 extern kptl_data_t      kptllnd_data;
286
287 static inline lnet_nid_t 
288 kptllnd_ptl2lnetnid(ptl_nid_t ptl_nid)
289 {
290 #ifdef _USING_LUSTRE_PORTALS_
291         return LNET_MKNID(LNET_NIDNET(kptllnd_data.kptl_ni->ni_nid), 
292                           LNET_NIDADDR(ptl_nid));
293 #else
294         return LNET_MKNID(LNET_NIDNET(kptllnd_data.kptl_ni->ni_nid), 
295                           ptl_nid);
296 #endif
297 }
298
299 static inline ptl_nid_t 
300 kptllnd_lnet2ptlnid(lnet_nid_t lnet_nid)
301 {
302 #ifdef _USING_LUSTRE_PORTALS_
303         return LNET_MKNID(LNET_NIDNET(kptllnd_data.kptl_portals_id.nid),
304                           LNET_NIDADDR(lnet_nid));
305 #else
306         return LNET_NIDADDR(lnet_nid);
307 #endif
308 }
309
310 int  kptllnd_startup(lnet_ni_t *ni);
311 void kptllnd_shutdown(lnet_ni_t *ni);
312 int  kptllnd_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg);
313 int  kptllnd_send(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg);
314 int  kptllnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *lntmsg,
315                   int delayed, unsigned int niov, 
316                   struct iovec *iov, lnet_kiov_t *kiov,
317                   unsigned int offset, unsigned int mlen, unsigned int rlen);
318 int  kptllnd_eager_recv(struct lnet_ni *ni, void *private, 
319                         lnet_msg_t *msg, void **new_privatep);
320 void kptllnd_eq_callback(ptl_event_t *evp);
321 int  kptllnd_scheduler(void *arg);
322 int  kptllnd_watchdog(void *arg);
323 int  kptllnd_thread_start(int (*fn)(void *arg), void *arg);
324 int  kptllnd_tunables_init(void);
325 void kptllnd_tunables_fini(void);
326
327 const char *kptllnd_evtype2str(int evtype);
328 const char *kptllnd_msgtype2str(int msgtype);
329 const char *kptllnd_errtype2str(int errtype);
330
331 static inline void *
332 kptllnd_eventarg2obj (kptl_eventarg_t *eva)
333 {
334         switch (eva->eva_type) {
335         default:
336                 LBUG();
337         case PTLLND_EVENTARG_TYPE_BUF:
338                 return list_entry(eva, kptl_rx_buffer_t, rxb_eventarg);
339         case PTLLND_EVENTARG_TYPE_RDMA:
340                 return list_entry(eva, kptl_tx_t, tx_rdma_eventarg);
341         case PTLLND_EVENTARG_TYPE_MSG:
342                 return list_entry(eva, kptl_tx_t, tx_msg_eventarg);
343         }
344 }
345
346 /*
347  * RX BUFFER SUPPORT FUNCTIONS
348  */
349 void kptllnd_rx_buffer_pool_init(kptl_rx_buffer_pool_t *rxbp);
350 void kptllnd_rx_buffer_pool_fini(kptl_rx_buffer_pool_t *rxbp);
351 int  kptllnd_rx_buffer_pool_reserve(kptl_rx_buffer_pool_t *rxbp, int count);
352 void kptllnd_rx_buffer_pool_unreserve(kptl_rx_buffer_pool_t *rxbp, int count);
353 void kptllnd_rx_buffer_callback(ptl_event_t *ev);
354 void kptllnd_rx_buffer_post(kptl_rx_buffer_t *rxb);
355
356 static inline int
357 kptllnd_rx_buffer_size(void)
358 {
359         return PAGE_SIZE * (*kptllnd_tunables.kptl_rxb_npages);
360 }
361
362 static inline void
363 kptllnd_rx_buffer_addref(kptl_rx_buffer_t *rxb)
364 {
365         unsigned long flags;
366         
367         spin_lock_irqsave(&rxb->rxb_pool->rxbp_lock, flags);
368         rxb->rxb_refcount++;
369         spin_unlock_irqrestore(&rxb->rxb_pool->rxbp_lock, flags);
370 }
371
372 static inline void
373 kptllnd_rx_buffer_decref_locked(kptl_rx_buffer_t *rxb)
374 {
375         if (--(rxb->rxb_refcount) == 0) {
376                 spin_lock(&kptllnd_data.kptl_sched_lock);
377         
378                 list_add_tail(&rxb->rxb_repost_list,
379                               &kptllnd_data.kptl_sched_rxbq);
380                 wake_up(&kptllnd_data.kptl_sched_waitq);
381
382                 spin_unlock(&kptllnd_data.kptl_sched_lock);
383         }
384 }
385
386 static inline void
387 kptllnd_rx_buffer_decref(kptl_rx_buffer_t *rxb)
388 {
389         unsigned long flags;
390         int           count;
391         
392         spin_lock_irqsave(&rxb->rxb_pool->rxbp_lock, flags);
393         count = --(rxb->rxb_refcount);
394         spin_unlock_irqrestore(&rxb->rxb_pool->rxbp_lock, flags);
395
396         if (count == 0)
397                 kptllnd_rx_buffer_post(rxb);
398 }
399
400 /*
401  * RX SUPPORT FUNCTIONS
402  */
403 void kptllnd_rx_done(kptl_rx_t *rx);
404 void kptllnd_rx_parse(kptl_rx_t *rx);
405
406 /*
407  * PEER SUPPORT FUNCTIONS
408  */
409 int kptllnd_get_peer_info(int index,
410                           lnet_process_id_t *id, 
411                           int *state, int *sent_hello,
412                           int *refcount, __u64 *incarnation,
413                           __u64 *next_matchbits, __u64 *last_matchbits_seen,
414                           int *nsendq, int *nactiveq,
415                           int *credits, int *outstanding_credits);
416 void kptllnd_peer_destroy(kptl_peer_t *peer);
417 int  kptllnd_peer_del(lnet_process_id_t id);
418 void kptllnd_peer_close_locked(kptl_peer_t *peer, int why);
419 void kptllnd_peer_close(kptl_peer_t *peer, int why);
420 void kptllnd_handle_closing_peers(void);
421 int  kptllnd_peer_connect(kptl_tx_t *tx, lnet_nid_t nid);
422 void kptllnd_peer_check_sends(kptl_peer_t *peer);
423 void kptllnd_peer_check_bucket(int idx, int stamp);
424 void kptllnd_tx_launch(kptl_peer_t *peer, kptl_tx_t *tx, int nfrag);
425 int  kptllnd_find_target(kptl_peer_t **peerp, lnet_process_id_t target);
426 kptl_peer_t *kptllnd_peer_handle_hello(ptl_process_id_t initiator,
427                                        kptl_msg_t *msg);
428 kptl_peer_t *kptllnd_id2peer_locked(lnet_process_id_t id);
429 void kptllnd_peer_alive(kptl_peer_t *peer);
430
431 static inline void
432 kptllnd_peer_addref (kptl_peer_t *peer)
433 {
434         atomic_inc(&peer->peer_refcount);
435 }
436
437 static inline void
438 kptllnd_peer_decref (kptl_peer_t *peer)
439 {
440         if (atomic_dec_and_test(&peer->peer_refcount))
441                 kptllnd_peer_destroy(peer);
442 }
443
444 static inline void
445 kptllnd_set_tx_peer(kptl_tx_t *tx, kptl_peer_t *peer) 
446 {
447         LASSERT (tx->tx_peer == NULL);
448         
449         kptllnd_peer_addref(peer);
450         tx->tx_peer = peer;
451 }
452
453 static inline struct list_head *
454 kptllnd_nid2peerlist(lnet_nid_t nid)
455 {
456         unsigned int hash = ((unsigned int)nid) %
457                             kptllnd_data.kptl_peer_hash_size;
458
459         return &kptllnd_data.kptl_peers[hash];
460 }
461
462 static inline kptl_peer_t *
463 kptllnd_id2peer(lnet_process_id_t id)
464 {
465         kptl_peer_t   *peer;
466         unsigned long  flags;
467
468         read_lock_irqsave(&kptllnd_data.kptl_peer_rw_lock, flags);
469         peer = kptllnd_id2peer_locked(id);
470         read_unlock_irqrestore(&kptllnd_data.kptl_peer_rw_lock, flags);
471
472         return peer;
473 }
474
475 static inline int
476 kptllnd_reserve_buffers(int n)
477 {
478         return kptllnd_rx_buffer_pool_reserve(&kptllnd_data.kptl_rx_buffer_pool,
479                                               n);
480 }
481
482 static inline int
483 kptllnd_peer_reserve_buffers(void)
484 {
485         return kptllnd_reserve_buffers(*kptllnd_tunables.kptl_peercredits);
486 }
487
488 static inline void
489 kptllnd_peer_unreserve_buffers(void)
490 {
491         kptllnd_rx_buffer_pool_unreserve(&kptllnd_data.kptl_rx_buffer_pool,
492                                          *kptllnd_tunables.kptl_peercredits);
493 }
494
495 /*
496  * TX SUPPORT FUNCTIONS
497  */
498 int  kptllnd_setup_tx_descs(void);
499 void kptllnd_cleanup_tx_descs(void);
500 void kptllnd_tx_fini(kptl_tx_t *tx);
501 kptl_tx_t *kptllnd_get_idle_tx(enum kptl_tx_type purpose);
502 void kptllnd_tx_callback(ptl_event_t *ev);
503 const char *kptllnd_tx_typestr(int type);
504
505 static inline void
506 kptllnd_tx_addref(kptl_tx_t *tx)
507 {
508         atomic_inc(&tx->tx_refcount);
509 }
510
511 static inline void 
512 kptllnd_tx_decref(kptl_tx_t *tx)
513 {
514         LASSERT (!in_interrupt());        /* Thread context only */
515
516         if (atomic_dec_and_test(&tx->tx_refcount))
517                 kptllnd_tx_fini(tx);
518 }
519
520 /*
521  * MESSAGE SUPPORT FUNCTIONS
522  */
523 void kptllnd_init_msg(kptl_msg_t *msg, int type, int body_nob);
524 void kptllnd_msg_pack(kptl_msg_t *msg, kptl_peer_t *peer);
525 int  kptllnd_msg_unpack(kptl_msg_t *msg, int nob);
526
527 /*
528  * MISC SUPPORT FUNCTIONS
529  */
530 void kptllnd_init_rdma_md(kptl_tx_t *tx, unsigned int niov,
531                           struct iovec *iov, lnet_kiov_t *kiov,
532                           unsigned int offset, unsigned int nob);
533 char *kptllnd_ptlid2str(ptl_process_id_t id);
534
535 void kptllnd_init_ptltrace(void);
536 void kptllnd_dump_ptltrace(void);
537
538 #ifdef PJK_DEBUGGING
539 #define SIMULATION_FAIL_TX_PUT_ALLOC   0       /* 0x00000001 */
540 #define SIMULATION_FAIL_TX_GET_ALLOC   1       /* 0x00000002 */
541 #define SIMULATION_FAIL_TX             2       /* 0x00000004 */
542 #define SIMULATION_FAIL_RX_ALLOC       3       /* 0x00000008 */
543
544 #define IS_SIMULATION_ENABLED(x) \
545         (((*kptllnd_tunables.kptl_simulation_bitmap) & 1<< SIMULATION_##x) != 0)
546 #else
547 #define IS_SIMULATION_ENABLED(x)       0
548 #endif
549