// $Id$ /************************************************************ * The Data Acquisition Backbone Core (DABC) * ************************************************************ * Copyright (C) 2009 - * * GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * Planckstr. 1, 64291 Darmstadt, Germany * * Contact: http://dabc.gsi.de * ************************************************************ * This software can be used under the GPL license * * agreements as stated in LICENSE.txt file * * which is part of the distribution. * ************************************************************/ #include "verbs/MemoryPool.h" #include "verbs/QueuePair.h" #include "verbs/Device.h" verbs::MemoryPool::MemoryPool(ContextRef ctx, const char *name, int32_t number, int64_t bufsize, bool isud, bool without_wr) : dabc::MemoryPool(name, false), fUD(isud), fSendBufferOffset(isud ? VERBS_UD_MEMADDON : 0), fReg(), f_rwr(nullptr), f_swr(nullptr), f_sge(nullptr) { DOUT4("Create verbs::Pool %s %p", GetName(), this); if (isud && (bufsize>0x1000)) bufsize = 0x1000; SetAlignment((bufsize<0x100) ? 0x10 : 0x100); Allocate(bufsize, number); fReg = new PoolRegistry(ctx, this); fReg()->SyncMRStructure(); if (without_wr) return; f_rwr = new ibv_recv_wr [number]; f_swr = new ibv_send_wr [number]; f_sge = new ibv_sge [number]; for (int32_t id = 0; id