DABC (Data Acquisition Backbone Core)  2.9.9
Transport.h
Go to the documentation of this file.
1 /************************************************************
2  * The Data Acquisition Backbone Core (DABC) *
3  ************************************************************
4  * Copyright (C) 2009 - *
5  * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
6  * Planckstr. 1, 64291 Darmstadt, Germany *
7  * Contact: http://dabc.gsi.de *
8  ************************************************************
9  * This software can be used under the GPL license *
10  * agreements as stated in LICENSE.txt file *
11  * which is part of the distribution. *
12  ************************************************************/
13 
14 #ifndef VERBS_Transport
15 #define VERBS_Transport
16 
17 #ifndef DABC_NetworkTransport
18 #include "dabc/NetworkTransport.h"
19 #endif
20 
21 #ifndef VERBS_Worker
22 #include "verbs/Worker.h"
23 #endif
24 
25 #ifndef VERBS_Context
26 #include "verbs/Context.h"
27 #endif
28 
29 namespace verbs {
30 
31  class Device;
32  class PoolRegistry;
33 
38  public dabc::NetworkInetrface {
39  protected:
40  friend class Device;
41 
42  enum Events {
46  };
47 
48 
50 
51  bool fInitOk;
53  struct ibv_recv_wr *f_rwr; // field for receive config, allocated dynamically
54  struct ibv_send_wr *f_swr; // field for send config, allocated dynamically
55  struct ibv_sge *f_sge; // memory segment description, used for both send/recv
56  MemoryPool *fHeadersPool; // polls with headers
57  unsigned fSegmPerOper;
58  struct ibv_ah *f_ud_ah;
59  uint32_t f_ud_qpn;
60  uint32_t f_ud_qkey;
61  int f_multi; // return value by ManageMulticast
62  ibv_gid f_multi_gid;
63  uint16_t f_multi_lid;
64  bool f_multi_attch; // true if QP was attached to multicast group
65 
66 
67  virtual long Notify(const std::string&, int);
68 
69  virtual void VerbsProcessSendCompl(uint32_t);
70  virtual void VerbsProcessRecvCompl(uint32_t);
71  virtual void VerbsProcessOperError(uint32_t);
72 
73  public:
75  virtual ~VerbsNetworkInetrface();
76 
77  bool AssignMultiGid(ibv_gid* multi_gid);
78 
79  bool IsInitOk() const { return fInitOk; }
80  bool IsUD() const { return f_ud_ah!=0; }
81 
82  void SetUdAddr(struct ibv_ah *ud_ah, uint32_t ud_qpn, uint32_t ud_qkey);
83 
84 
85  virtual void AllocateNet(unsigned fulloutputqueue, unsigned fullinputqueue);
86  virtual void SubmitSend(uint32_t recid);
87  virtual void SubmitRecv(uint32_t recid);
88 
89  };
90 
91 
92 }
93 
94 #endif
Network interface.
Reference to verbs::Context
Definition: Context.h:74
Device for VERBS
Definition: Device.h:42
Special memory pool, which automatically includes PoolRegistry.
Definition: MemoryPool.h:31
Reference on verbs::PoolRegistry
Definition: Context.h:143
Represent VERBS queue pair functionality.
Definition: QueuePair.h:37
Implementation of NetworkTransport for VERBS.
Definition: Transport.h:38
struct ibv_send_wr * f_swr
Definition: Transport.h:54
virtual void VerbsProcessSendCompl(uint32_t)
Definition: Transport.cxx:277
virtual void AllocateNet(unsigned fulloutputqueue, unsigned fullinputqueue)
Definition: Transport.cxx:115
void SetUdAddr(struct ibv_ah *ud_ah, uint32_t ud_qpn, uint32_t ud_qkey)
Definition: Transport.cxx:75
virtual void SubmitSend(uint32_t recid)
Definition: Transport.cxx:173
virtual void VerbsProcessOperError(uint32_t)
Definition: Transport.cxx:291
virtual void VerbsProcessRecvCompl(uint32_t)
Definition: Transport.cxx:284
virtual void SubmitRecv(uint32_t recid)
Definition: Transport.cxx:231
VerbsNetworkInetrface(verbs::ContextRef ctx, QueuePair *qp)
Definition: Transport.cxx:24
verbs::ContextRef fContext
Definition: Transport.h:49
struct ibv_recv_wr * f_rwr
Definition: Transport.h:53
PoolRegistryRef fPoolReg
Definition: Transport.h:52
virtual long Notify(const std::string &, int)
Light-weight command interface, which can be used from worker.
Definition: Transport.cxx:68
bool AssignMultiGid(ibv_gid *multi_gid)
Definition: Transport.cxx:82
struct ibv_ah * f_ud_ah
Definition: Transport.h:58
struct ibv_sge * f_sge
Definition: Transport.h:55
Addon for VERBS thread
Definition: Worker.h:39
Support of InfiniBand verbs.
Definition: Device.cxx:54