Assorted fixes to krping. Disconnect the rest of sys/contrib/rdma from
the build while here. sys/ofed has more recent RDMA code and should be used instead. We should probably move krping out of sys/contrib/rdma and get rid of the rest of it. Obtained from: Chelsio
This commit is contained in:
parent
f336c6303e
commit
ea68a7142e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254735
@ -119,7 +119,7 @@ static void krping_wait(struct krping_cb *cb, int state)
|
||||
int rc;
|
||||
mtx_lock(&cb->lock);
|
||||
while (cb->state < state) {
|
||||
rc = msleep(cb, &cb->lock, 0, "krping", 0);
|
||||
rc = msleep(cb, &cb->lock, PCATCH, "krping", 0);
|
||||
if (rc && rc != ERESTART) {
|
||||
cb->state = ERROR;
|
||||
break;
|
||||
@ -188,7 +188,12 @@ static int krping_cma_event_handler(struct rdma_cm_id *cma_id,
|
||||
|
||||
case RDMA_CM_EVENT_DEVICE_REMOVAL:
|
||||
DEBUG_LOG(PFX "cma detected device removal!!!!\n");
|
||||
break;
|
||||
cb->state = ERROR;
|
||||
wakeup(cb);
|
||||
mtx_unlock(&cb->lock);
|
||||
krping_wait(cb, CLEANUP);
|
||||
tsleep(cb, 0, "krping", 5000);
|
||||
return 0;
|
||||
|
||||
default:
|
||||
log(LOG_ERR, "oof bad type!\n");
|
||||
@ -603,6 +608,8 @@ static int krping_setup_qp(struct krping_cb *cb, struct rdma_cm_id *cm_id)
|
||||
}
|
||||
DEBUG_LOG(PFX "created pd %p\n", cb->pd);
|
||||
|
||||
strlcpy(cb->name, cb->pd->device->name, sizeof(cb->name));
|
||||
|
||||
cb->cq = ib_create_cq(cm_id->device, krping_cq_event_handler, NULL,
|
||||
cb, cb->txdepth * 2, 0);
|
||||
if (IS_ERR(cb->cq)) {
|
||||
@ -1164,7 +1171,7 @@ static void krping_wlat_test_server(struct krping_cb *cb)
|
||||
}
|
||||
|
||||
wlat_test(cb);
|
||||
|
||||
krping_wait(cb, ERROR);
|
||||
}
|
||||
|
||||
static void krping_bw_test_server(struct krping_cb *cb)
|
||||
@ -1776,6 +1783,12 @@ int krping_doit(char *cmd)
|
||||
else
|
||||
krping_run_client(cb);
|
||||
DEBUG_LOG(PFX "destroy cm_id %p\n", cb->cm_id);
|
||||
|
||||
mtx_lock(&cb->lock);
|
||||
cb->state = CLEANUP;
|
||||
wakeup(cb);
|
||||
mtx_unlock(&cb->lock);
|
||||
|
||||
rdma_destroy_id(cb->cm_id);
|
||||
out:
|
||||
mtx_lock(&krping_mutex);
|
||||
|
@ -37,7 +37,8 @@ enum test_state {
|
||||
RDMA_READ_COMPLETE,
|
||||
RDMA_WRITE_ADV,
|
||||
RDMA_WRITE_COMPLETE,
|
||||
ERROR
|
||||
ERROR,
|
||||
CLEANUP
|
||||
};
|
||||
|
||||
struct krping_rdma_info {
|
||||
@ -100,13 +101,15 @@ struct krping_cb {
|
||||
/* listener on service side. */
|
||||
struct rdma_cm_id *child_cm_id; /* connection on server side */
|
||||
TAILQ_ENTRY(krping_cb) list;
|
||||
|
||||
|
||||
int rlat; /* run read latency test */
|
||||
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;
|
||||
|
||||
char name[16];
|
||||
};
|
||||
|
||||
static __inline uint64_t
|
||||
|
@ -112,12 +112,11 @@ krping_read(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
mtx_unlock(&krping_mutex);
|
||||
|
||||
while (!TAILQ_EMPTY(©_cbs)) {
|
||||
|
||||
cb = TAILQ_FIRST(©_cbs);
|
||||
TAILQ_REMOVE(©_cbs, cb, list);
|
||||
if (cb->pd) {
|
||||
uprintf("krping: %4d %10s %10u %10u %10u %10u %10u %10u %10u %10u\n",
|
||||
num++, cb->pd->device->name, cb->stats.send_bytes,
|
||||
num++, cb->name, cb->stats.send_bytes,
|
||||
cb->stats.send_msgs, cb->stats.recv_bytes,
|
||||
cb->stats.recv_msgs, cb->stats.write_bytes,
|
||||
cb->stats.write_msgs,
|
||||
|
@ -1,9 +1,9 @@
|
||||
# $FreeBSD$
|
||||
|
||||
SUBDIR= addr
|
||||
SUBDIR+= cma
|
||||
SUBDIR+= iwcm
|
||||
SUBDIR+= core
|
||||
#SUBDIR= addr
|
||||
#SUBDIR+= cma
|
||||
#SUBDIR+= iwcm
|
||||
#SUBDIR+= core
|
||||
SUBDIR+= krping
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
Loading…
Reference in New Issue
Block a user