public RdmaCqProcessor(IbvContext context, int cqSize, int wrSize, long affinity, int clusterId, int timeout, boolean polling) throws IOException { super(context, cqSize); this.clusterId = clusterId; this.affinity = affinity; this.running = false; this.wrSize = Math.min(cqSize, wrSize); this.wcList = new IbvWC[this.wrSize]; for (int i = 0; i < wcList.length; i++){ wcList[i] = new IbvWC(); } this.blocking = !polling; this.ackCounter = 0; this.reqNotify = cq.reqNotification(false); this.poll = cq.poll(wcList, wcList.length); this.timeout = timeout; if (blocking){ reqNotify.execute(); } this.qpMap = new ConcurrentHashMap<Integer, C>(); this.thread = new Thread(this); }
public void close() throws IOException, InterruptedException { logger.info("shutting cq provider, destroying cq1"); compChannel.destroyCompChannel(); logger.info("compChannel destroyed"); cq.destroyCQ(); logger.info("cq destroyed"); }
public int ackCqEvents(IbvCQ cq, int nevents) throws IOException { NatIbvCQ natCQ = (NatIbvCQ) cq; if (!cq.isOpen()) { throw new IOException("Trying to acknowledge events on closed CQ."); } int ret = nativeDispatcher._ackCqEvent(natCQ.getObjId(), nevents); return ret; }
private SVCPollCq getPollCqCall(int size) throws Exception{ if (!CachingON || pollCqCall == null || !pollCqCall.isValid()) { wcList = new IbvWC[size]; for (int i = 0; i < size; i++){ wcList[i] = new IbvWC(); } pollCqCall = cq.poll(wcList, size); } return pollCqCall; } }
private SVCReqNotify getReqNotifyCall() throws Exception{ if (!CachingON || reqNotifyCall == null || !reqNotifyCall.isValid()) { reqNotifyCall = cq.reqNotification(false); } return reqNotifyCall; }
this.ackCounter++; if (ackCounter == MAX_ACK_COUNT){ cq.ackEvents(ackCounter); ackCounter = 0;
@Override protected synchronized void init() throws IOException { super.init(); for (int i = 0; i < RdmaConstants.STORAGE_RDMA_QUEUESIZE; i++){ SVCPostSend write = initWriteOp(); writeOps.add(write); SVCPostSend read = initReadOp(); readOps.add(read); } IbvCQ cq = getCqProvider().getCQ(); this.wcList = new IbvWC[getCqProvider().getCqSize()]; for (int i = 0; i < wcList.length; i++){ wcList[i] = new IbvWC(); } this.poll = cq.poll(wcList, wcList.length); }
cq.reqNotification(false).execute().free();
cq.ackEvents(res); if (elementsRead == expectedElements){ success = true;
@Override public void init() throws IOException { super.init(); IbvCQ cq = getCqProvider().getCQ(); this.wcList = new IbvWC[getCqProvider().getCqSize()]; for (int i = 0; i < wcList.length; i++){ wcList[i] = new IbvWC(); } this.poll = cq.poll(wcList, wcList.length); }
cq.reqNotification(false).execute().free();
@Override protected synchronized void init() throws IOException { super.init(); IbvCQ cq = getCqProvider().getCQ(); this.wcList = new IbvWC[getCqProvider().getCqSize()]; for (int i = 0; i < wcList.length; i++){ wcList[i] = new IbvWC(); } this.poll = cq.poll(wcList, wcList.length); for(int i = 0; i < pipelineLength; i++){ recvBufs[i] = ByteBuffer.allocateDirect(bufferSize); sendBufs[i] = ByteBuffer.allocateDirect(bufferSize); this.recvCall[i] = setupRecvTask(recvBufs[i], i); this.sendCall[i] = setupSendTask(sendBufs[i], i); } }
@Override protected synchronized void init() throws IOException { super.init(); IbvCQ cq = getCqProvider().getCQ(); this.wcList = new IbvWC[getCqProvider().getCqSize()]; for (int i = 0; i < wcList.length; i++){ wcList[i] = new IbvWC(); } this.poll = cq.poll(wcList, wcList.length); for(int i = 0; i < pipelineLength; i++){ recvBufs[i] = ByteBuffer.allocateDirect(bufferSize); sendBufs[i] = ByteBuffer.allocateDirect(bufferSize); this.recvCall[i] = setupRecvTask(recvBufs[i], i); this.sendCall[i] = setupSendTask(sendBufs[i], i); } this.installRecvs(pipelineLength); }
wcList[i] = new IbvWC(); this.poll = cq.poll(wcList, wcList.length);