PERFORCE change 137922 for review
Steve Wise
swise at FreeBSD.org
Mon Mar 17 16:09:20 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=137922
Change 137922 by swise at swise:vic10:iwarp on 2008/03/17 16:09:03
blocking support for krping rlat.
Affected files ...
.. //depot/projects/iwarp/sys/contrib/rdma/krping/krping.c#13 edit
.. //depot/projects/iwarp/sys/contrib/rdma/krping/krping.h#6 edit
Differences ...
==== //depot/projects/iwarp/sys/contrib/rdma/krping/krping.c#13 (text+ko) ====
@@ -80,6 +80,7 @@
{"rlat", OPT_NOPARAM, 'L'},
{"bw", OPT_NOPARAM, 'B'},
{"tx-depth", OPT_INT, 't'},
+ {"poll", OPT_NOPARAM, 'P'},
{NULL, 0, 0}
};
@@ -841,8 +842,13 @@
cb->rdma_sq_wr.sg_list->length = cb->size;
microtime(&start_tv);
+ if (!cb->poll) {
+ cb->state = RDMA_READ_ADV;
+ ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP);
+ }
while (scnt < iters) {
+ cb->state = RDMA_READ_ADV;
ret = ib_post_send(cb->qp, &cb->rdma_sq_wr, &bad_wr);
if (ret) {
printf(PFX
@@ -852,7 +858,16 @@
}
do {
- ne = ib_poll_cq(cb->cq, 1, &wc);
+ if (!cb->poll) {
+ krping_wait(cb, RDMA_READ_COMPLETE);
+ if (cb->state == RDMA_READ_COMPLETE) {
+ ne = 1;
+ ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP);
+ } else {
+ ne = -1;
+ }
+ } else
+ ne = ib_poll_cq(cb->cq, 1, &wc);
if (cb->state == ERROR) {
printf(PFX
"state == ERROR...bailing scnt %d\n", scnt);
@@ -864,7 +879,7 @@
printf(PFX "poll CQ failed %d\n", ne);
return;
}
- if (wc.status != IB_WC_SUCCESS) {
+ if (cb->poll && wc.status != IB_WC_SUCCESS) {
printf(PFX "Completion wth error at %s:\n",
cb->server ? "server" : "client");
printf(PFX "Failed status %d: wr_id %d\n",
@@ -1740,6 +1755,10 @@
cb->port = htons(optint);
DEBUG_LOG(PFX "port %d\n", (int)optint);
break;
+ case 'P':
+ cb->poll = 1;
+ DEBUG_LOG("server\n");
+ break;
case 's':
cb->server = 1;
DEBUG_LOG(PFX "server\n");
==== //depot/projects/iwarp/sys/contrib/rdma/krping/krping.h#6 (text+ko) ====
@@ -106,6 +106,7 @@
int wlat; /* run write latency test */
int bw; /* run write bw test */
int duplex; /* run write bw full duplex test */
+ int poll; /* poll vs block in rlat */
int txdepth;
};
More information about the p4-projects
mailing list