forked from cornelisnetworks/opa-psm2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
psm_mq_recv.c
596 lines (524 loc) · 17.1 KB
/
psm_mq_recv.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
/*
This file is provided under a dual BSD/GPLv2 license. When using or
redistributing this file, you may do so under either license.
GPL LICENSE SUMMARY
Copyright(c) 2015 Intel Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
Contact Information:
Intel Corporation, www.intel.com
BSD LICENSE
Copyright(c) 2015 Intel Corporation.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Copyright (c) 2003-2015 Intel Corporation. All rights reserved. */
#include "psm_user.h"
#include "psm_mq_internal.h"
#include "ptl_ips/ips_proto_header.h"
#if 0
/* Not exposed in public psm, but may extend parts of PSM 2.1 to support
* this feature before 2.3 */
psm_mq_unexpected_callback_fn_t
psmi_mq_register_unexpected_callback(psm2_mq_t mq,
psm_mq_unexpected_callback_fn_t fn)
{
psm_mq_unexpected_callback_fn_t old_fn = mq->unexpected_callback;
mq->unexpected_callback = fn;
return old_fn;
}
#endif
void psmi_mq_handle_rts_complete(psm2_mq_req_t req)
{
psm2_mq_t mq = req->mq;
/* Stats on rendez-vous messages */
psmi_mq_stats_rts_account(req);
req->state = MQ_STATE_COMPLETE;
ips_barrier();
mq_qq_append(&mq->completed_q, req);
#ifdef PSM_VALGRIND
if (MQE_TYPE_IS_RECV(req->type))
PSM_VALGRIND_DEFINE_MQ_RECV(req->buf, req->buf_len,
req->recv_msglen);
else
VALGRIND_MAKE_MEM_DEFINED(req->buf, req->buf_len);
#endif
_HFI_VDBG("RTS complete, req=%p, recv_msglen = %d\n",
req, req->recv_msglen);
return;
}
static void
psmi_mq_req_copy(psm2_mq_req_t req,
uint32_t offset, const void *buf, uint32_t nbytes)
{
/* recv_msglen may be changed by unexpected receive buf. */
uint32_t msglen_this, end;
uint8_t *msgptr = (uint8_t *) req->buf + offset;
/* out of receiving range. */
if (offset >= req->recv_msglen) {
req->send_msgoff += nbytes;
return;
}
end = offset + nbytes;
if (end > req->recv_msglen) {
msglen_this = req->recv_msglen - offset;
end = req->recv_msglen;
} else {
msglen_this = nbytes;
}
VALGRIND_MAKE_MEM_DEFINED(msgptr, msglen_this);
psmi_mq_mtucpy(msgptr, buf, msglen_this);
if (req->recv_msgoff < end) {
req->recv_msgoff = end;
}
req->send_msgoff += nbytes;
return;
}
int
psmi_mq_handle_data(psm2_mq_t mq, psm2_mq_req_t req,
uint32_t offset, const void *buf, uint32_t nbytes)
{
psmi_assert(req != NULL);
int rc;
if (req->state == MQ_STATE_MATCHED)
rc = MQ_RET_MATCH_OK;
else {
psmi_assert(req->state == MQ_STATE_UNEXP);
rc = MQ_RET_UNEXP_OK;
}
psmi_mq_req_copy(req, offset, buf, nbytes);
/*
* the reason to use >= is because send_msgoff
* may be DW pad included.
*/
if (req->send_msgoff >= req->send_msglen) {
if (req->type & MQE_TYPE_EAGER_QUEUE) {
STAILQ_REMOVE(&mq->eager_q, req, psm2_mq_req, nextq);
}
if (req->state == MQ_STATE_MATCHED) {
req->state = MQ_STATE_COMPLETE;
ips_barrier();
mq_qq_append(&mq->completed_q, req);
} else { /* MQ_STATE_UNEXP */
req->state = MQ_STATE_COMPLETE;
}
}
return rc;
}
/* in case the compiler can't figure out how to preserve the hashed values
between mq_req_match() and mq_add_to_unexpected_hashes() ... */
static unsigned hashvals[NUM_HASH_CONFIGS];
static
void mq_add_to_unexpected_hashes(psm2_mq_t mq, psm2_mq_req_t req)
{
int table;
mq_qq_append(&mq->unexpected_q, req);
req->q[PSM2_ANYTAG_ANYSRC] = &mq->unexpected_q;
mq->unexpected_list_len++;
if_pt (mq->nohash_fastpath) {
if_pf (mq->unexpected_list_len >= HASH_THRESHOLD)
psmi_mq_fastpath_disable(mq);
return;
}
for (table = PSM2_TAG_SRC; table < PSM2_ANYTAG_ANYSRC; table++)
mq_qq_append_which(mq->unexpected_htab,
table, hashvals[table], req);
mq->unexpected_hash_len++;
}
psm2_mq_req_t
mq_list_scan(struct mqq *q, psm2_epaddr_t src, psm2_mq_tag_t *tag, int which, uint64_t *time_threshold)
{
psm2_mq_req_t *curp, cur;
for (curp = &q->first;
((cur = *curp) != NULL) && (cur->timestamp < *time_threshold);
curp = &cur->next[which]) {
if ((cur->peer == PSM2_MQ_ANY_ADDR || src == cur->peer) &&
!((tag->tag[0] ^ cur->tag.tag[0]) & cur->tagsel.tag[0]) &&
!((tag->tag[1] ^ cur->tag.tag[1]) & cur->tagsel.tag[1]) &&
!((tag->tag[2] ^ cur->tag.tag[2]) & cur->tagsel.tag[2])) {
*time_threshold = cur->timestamp;
return cur;
}
}
return NULL;
}
psm2_mq_req_t
mq_req_match(psm2_mq_t mq, psm2_epaddr_t src, psm2_mq_tag_t *tag, int remove)
{
psm2_mq_req_t match[4];
int table;
uint64_t best_ts = -1;
if (mq->nohash_fastpath) {
table = PSM2_ANYTAG_ANYSRC;
match[table] =
mq_list_scan(&mq->expected_q,
src, tag, PSM2_ANYTAG_ANYSRC, &best_ts);
if (match[table] && remove) {
mq->expected_list_len--;
mq_qq_remove_which(match[table], table);
}
return match[table];
}
hashvals[PSM2_TAG_SRC] = hash_64(*(uint64_t *) tag->tag) % NUM_HASH_BUCKETS;
hashvals[PSM2_TAG_ANYSRC] = hash_32(tag->tag[0]) % NUM_HASH_BUCKETS;
hashvals[PSM2_ANYTAG_SRC] = hash_32(tag->tag[1]) % NUM_HASH_BUCKETS;
for (table = PSM2_TAG_SRC; table < PSM2_ANYTAG_ANYSRC; table++)
match[table] =
mq_list_scan(&mq->expected_htab[table][hashvals[table]],
src, tag, table, &best_ts);
table = PSM2_ANYTAG_ANYSRC;
match[table] = mq_list_scan(&mq->expected_q, src, tag, table, &best_ts);
table = min_timestamp_4(match);
if (table == -1)
return NULL;
if (remove) {
if_pt (table == PSM2_ANYTAG_ANYSRC)
mq->expected_list_len--;
else
mq->expected_hash_len--;
mq_qq_remove_which(match[table], table);
psmi_mq_fastpath_try_reenable(mq);
}
return match[table];
}
/*
* This handles the rendezvous MPI envelopes, the packet might have the whole
* message payload, or zero payload.
*/
int
psmi_mq_handle_rts(psm2_mq_t mq, psm2_epaddr_t src, psm2_mq_tag_t *tag,
uint32_t send_msglen, const void *payload, uint32_t paylen,
int msgorder, mq_rts_callback_fn_t cb, psm2_mq_req_t *req_o)
{
psm2_mq_req_t req;
uint32_t msglen;
int rc;
PSMI_PLOCK_ASSERT();
if (msgorder && (req = mq_req_match(mq, src, tag, 1))) {
/* we have a match, no need to callback */
msglen = mq_set_msglen(req, req->buf_len, send_msglen);
/* reset send_msglen because sender only sends this many */
req->send_msglen = msglen;
req->state = MQ_STATE_MATCHED;
req->peer = src;
req->tag = *tag;
if (paylen > msglen) paylen = msglen;
if (paylen) {
psmi_mq_mtucpy(req->buf, payload, paylen);
}
req->recv_msgoff = req->send_msgoff = paylen;
*req_o = req; /* yes match */
PSM_LOG_EPM(OPCODE_LONG_RTS,PSM_LOG_EPM_RX,src->epid,mq->ep->epid,
"req->rts_reqidx_peer: %d",req->rts_reqidx_peer);
rc = MQ_RET_MATCH_OK;
} else if (msgorder > 1) {
/* There is NO request match, and this is the first time
* to try to process this packet, we leave the packet in
* hardware queue for retry in hope there is a request
* match nex time, this is for performance
* consideration.
*/
rc = MQ_RET_UNEXP_NO_RESOURCES;
} else { /* No match, keep track of callback */
req = psmi_mq_req_alloc(mq, MQE_TYPE_RECV);
psmi_assert(req != NULL);
/* We don't know recv_msglen yet but we set it here for
* mq_iprobe */
req->send_msglen = req->recv_msglen = send_msglen;
PSM_LOG_EPM_COND(req->send_msglen > mq->hfi_thresh_rv,
OPCODE_LONG_RTS,PSM_LOG_EPM_RX,src->epid,mq->ep->epid,
"req->rts_reqidx_peer: %d",req->rts_reqidx_peer);
req->state = MQ_STATE_UNEXP_RV;
req->peer = src;
req->tag = *tag;
req->rts_callback = cb;
if (paylen > send_msglen) paylen = send_msglen;
if (paylen) {
req->buf = psmi_sysbuf_alloc(paylen);
mq->stats.rx_sysbuf_num++;
mq->stats.rx_sysbuf_bytes += paylen;
psmi_mq_mtucpy(req->buf, payload, paylen);
}
req->recv_msgoff = req->send_msgoff = paylen;
if (msgorder) {
mq_add_to_unexpected_hashes(mq, req);
}
/* caller will handle out of order case */
*req_o = req; /* no match, will callback */
rc = MQ_RET_UNEXP_OK;
}
#ifdef PSM_DEBUG
if (req)
_HFI_VDBG("match=%s (req=%p) src=%s mqtag=%08x.%08x.%08x recvlen=%d "
"sendlen=%d errcode=%d\n",
rc == MQ_RET_MATCH_OK ? "YES" : "NO", req,
psmi_epaddr_get_name(src->epid),
req->tag.tag[0], req->tag.tag[1], req->tag.tag[2],
req->recv_msglen, req->send_msglen, req->error_code);
else
_HFI_VDBG("match=%s (req=%p) src=%s\n",
rc == MQ_RET_MATCH_OK ? "YES" : "NO", req,
psmi_epaddr_get_name(src->epid));
#endif /* #ifdef PSM_DEBUG */
return rc;
}
/*
* This handles the regular (i.e. non-rendezvous MPI envelopes)
*/
int
psmi_mq_handle_envelope(psm2_mq_t mq, psm2_epaddr_t src, psm2_mq_tag_t *tag,
uint32_t send_msglen, uint32_t offset,
const void *payload, uint32_t paylen, int msgorder,
uint32_t opcode, psm2_mq_req_t *req_o)
{
psm2_mq_req_t req;
uint32_t msglen;
if (msgorder && (req = mq_req_match(mq, src, tag, 1))) {
/* we have a match */
psmi_assert(MQE_TYPE_IS_RECV(req->type));
req->peer = src;
req->tag = *tag;
msglen = mq_set_msglen(req, req->buf_len, send_msglen);
_HFI_VDBG("match=YES (req=%p) opcode=%x src=%s mqtag=%x.%x.%x"
" msglen=%d paylen=%d\n", req, opcode,
psmi_epaddr_get_name(src->epid),
tag->tag[0], tag->tag[1], tag->tag[2], msglen,
paylen);
switch (opcode) {
case MQ_MSG_TINY:
PSM_VALGRIND_DEFINE_MQ_RECV(req->buf, req->buf_len,
msglen);
/* mq_copy_tiny() can handle zero byte */
mq_copy_tiny((uint32_t *) req->buf,
(uint32_t *) payload, msglen);
req->state = MQ_STATE_COMPLETE;
ips_barrier();
mq_qq_append(&mq->completed_q, req);
break;
case MQ_MSG_SHORT: /* message fits in 1 payload */
PSM_VALGRIND_DEFINE_MQ_RECV(req->buf, req->buf_len,
msglen);
if (msglen <= paylen) {
psmi_mq_mtucpy(req->buf, payload, msglen);
} else {
psmi_assert((msglen & ~0x3) == paylen);
psmi_mq_mtucpy(req->buf, payload, paylen);
/*
* there are nonDW bytes attached in header,
* copy after the DW payload.
*/
mq_copy_tiny((uint32_t *)(req->buf+paylen),
(uint32_t *)&offset, msglen & 0x3);
}
req->state = MQ_STATE_COMPLETE;
ips_barrier();
mq_qq_append(&mq->completed_q, req);
break;
case MQ_MSG_EAGER:
req->state = MQ_STATE_MATCHED;
req->type |= MQE_TYPE_EAGER_QUEUE;
req->send_msgoff = req->recv_msgoff = 0;
STAILQ_INSERT_TAIL(&mq->eager_q, req, nextq);
_HFI_VDBG("exp MSG_EAGER of length %d bytes pay=%d\n",
msglen, paylen);
if (paylen > 0)
psmi_mq_handle_data(mq, req, offset, payload,
paylen);
break;
default:
psmi_handle_error(PSMI_EP_NORETURN, PSM2_INTERNAL_ERR,
"Internal error, unknown packet 0x%x",
opcode);
}
mq->stats.rx_user_bytes += msglen;
mq->stats.rx_user_num++;
*req_o = req; /* yes match */
return MQ_RET_MATCH_OK;
}
/* unexpected message or out of order message. */
#if 0
/*
* Keep a callback here in case we want to fit some other high-level
* protocols over MQ (i.e. shmem). These protocols would bypass the
* normal mesage handling and go to higher-level message handlers.
*/
if (msgorder && mq->unexpected_callback) {
mq->unexpected_callback(mq, opcode, epaddr, tag, send_msglen,
payload, paylen);
*req_o = NULL;
return MQ_RET_UNEXP_OK;
}
#endif
if (msgorder > 1) {
/* There is NO request match, and this is the first time
* to try to process this packet, we leave the packet in
* hardware queue for retry in hope there is a request
* match nex time, this is for performance
* consideration.
*/
return MQ_RET_UNEXP_NO_RESOURCES;
}
req = psmi_mq_req_alloc(mq, MQE_TYPE_RECV);
psmi_assert(req != NULL);
req->peer = src;
req->tag = *tag;
req->recv_msgoff = 0;
req->recv_msglen = req->send_msglen = req->buf_len = msglen =
send_msglen;
_HFI_VDBG("match=NO (req=%p) opcode=%x src=%s mqtag=%08x.%08x.%08x"
" send_msglen=%d\n", req, opcode,
psmi_epaddr_get_name(src->epid),
tag->tag[0], tag->tag[1], tag->tag[2], send_msglen);
switch (opcode) {
case MQ_MSG_TINY:
if (msglen > 0) {
req->buf = psmi_sysbuf_alloc(msglen);
mq->stats.rx_sysbuf_num++;
mq->stats.rx_sysbuf_bytes += paylen;
mq_copy_tiny((uint32_t *) req->buf,
(uint32_t *) payload, msglen);
} else
req->buf = NULL;
req->state = MQ_STATE_COMPLETE;
break;
case MQ_MSG_SHORT:
req->buf = psmi_sysbuf_alloc(msglen);
mq->stats.rx_sysbuf_num++;
mq->stats.rx_sysbuf_bytes += paylen;
if (msglen <= paylen) {
psmi_mq_mtucpy(req->buf, payload, msglen);
} else {
psmi_assert((msglen & ~0x3) == paylen);
psmi_mq_mtucpy(req->buf, payload, paylen);
/*
* there are nonDW bytes attached in header,
* copy after the DW payload.
*/
mq_copy_tiny((uint32_t *)(req->buf+paylen),
(uint32_t *)&offset, msglen & 0x3);
}
req->state = MQ_STATE_COMPLETE;
break;
case MQ_MSG_EAGER:
req->send_msgoff = 0;
req->buf = psmi_sysbuf_alloc(msglen);
mq->stats.rx_sysbuf_num++;
mq->stats.rx_sysbuf_bytes += paylen;
req->state = MQ_STATE_UNEXP;
req->type |= MQE_TYPE_EAGER_QUEUE;
STAILQ_INSERT_TAIL(&mq->eager_q, req, nextq);
_HFI_VDBG("unexp MSG_EAGER of length %d bytes pay=%d\n",
msglen, paylen);
if (paylen > 0)
psmi_mq_handle_data(mq, req, offset, payload, paylen);
break;
default:
psmi_handle_error(PSMI_EP_NORETURN, PSM2_INTERNAL_ERR,
"Internal error, unknown packet 0x%x",
opcode);
}
mq->stats.rx_sys_bytes += msglen;
mq->stats.rx_sys_num++;
if (msgorder) {
mq_add_to_unexpected_hashes(mq, req);
}
/* caller will handle out of order case */
*req_o = req; /* no match, will callback */
return MQ_RET_UNEXP_OK;
}
int psmi_mq_handle_outoforder(psm2_mq_t mq, psm2_mq_req_t ureq)
{
psm2_mq_req_t ereq;
uint32_t msglen;
ereq = mq_req_match(mq, ureq->peer, &ureq->tag, 1);
if (ereq == NULL) {
mq_add_to_unexpected_hashes(mq, ureq);
return 0;
}
psmi_assert(MQE_TYPE_IS_RECV(ereq->type));
ereq->peer = ureq->peer;
ereq->tag = ureq->tag;
msglen = mq_set_msglen(ereq, ereq->buf_len, ureq->send_msglen);
switch (ureq->state) {
case MQ_STATE_COMPLETE:
if (ureq->buf != NULL) { /* 0-byte don't alloc a sysbuf */
psmi_mq_mtucpy(ereq->buf, (const void *)ureq->buf,
msglen);
psmi_sysbuf_free(ureq->buf);
}
ereq->state = MQ_STATE_COMPLETE;
ips_barrier();
mq_qq_append(&mq->completed_q, ereq);
break;
case MQ_STATE_UNEXP: /* not done yet */
ereq->state = MQ_STATE_MATCHED;
ereq->msg_seqnum = ureq->msg_seqnum;
ereq->ptl_req_ptr = ureq->ptl_req_ptr;
ereq->send_msgoff = ureq->send_msgoff;
ereq->recv_msgoff = min(ureq->recv_msgoff, msglen);
if (ereq->recv_msgoff) {
psmi_mq_mtucpy(ereq->buf,
(const void *)ureq->buf,
ereq->recv_msgoff);
}
psmi_sysbuf_free(ureq->buf);
ereq->type = ureq->type;
STAILQ_INSERT_AFTER(&mq->eager_q, ureq, ereq, nextq);
STAILQ_REMOVE(&mq->eager_q, ureq, psm2_mq_req, nextq);
break;
case MQ_STATE_UNEXP_RV: /* rendez-vous ... */
ereq->state = MQ_STATE_MATCHED;
ereq->rts_peer = ureq->rts_peer;
ereq->rts_sbuf = ureq->rts_sbuf;
ereq->send_msgoff = ureq->send_msgoff;
ereq->recv_msgoff = min(ureq->recv_msgoff, msglen);
if (ereq->recv_msgoff) {
psmi_mq_mtucpy(ereq->buf,
(const void *)ureq->buf,
ereq->recv_msgoff);
}
if (ereq->send_msgoff) {
psmi_sysbuf_free(ureq->buf);
}
ereq->rts_callback = ureq->rts_callback;
ereq->rts_reqidx_peer = ureq->rts_reqidx_peer;
ereq->type = ureq->type;
ereq->rts_callback(ereq, 0);
break;
default:
fprintf(stderr, "Unexpected state %d in req %p\n", ureq->state,
ureq);
fprintf(stderr, "type=%d, mq=%p, tag=%08x.%08x.%08x\n",
ureq->type, ureq->mq, ureq->tag.tag[0],
ureq->tag.tag[1], ureq->tag.tag[2]);
abort();
}
psmi_mq_req_free(ureq);
return 0;
}