pthr              772 drivers/ntb/test/ntb_perf.c 	struct perf_thread *pthr = data;
pthr              774 drivers/ntb/test/ntb_perf.c 	atomic_dec(&pthr->dma_sync);
pthr              775 drivers/ntb/test/ntb_perf.c 	wake_up(&pthr->dma_wait);
pthr              778 drivers/ntb/test/ntb_perf.c static int perf_copy_chunk(struct perf_thread *pthr,
pthr              791 drivers/ntb/test/ntb_perf.c 	dma_dev = pthr->dma_chan->device->dev;
pthr              793 drivers/ntb/test/ntb_perf.c 	if (!is_dma_copy_aligned(pthr->dma_chan->device, offset_in_page(src),
pthr              819 drivers/ntb/test/ntb_perf.c 		tx = dmaengine_prep_dma_memcpy(pthr->dma_chan, unmap->addr[1],
pthr              831 drivers/ntb/test/ntb_perf.c 	tx->callback_param = pthr;
pthr              842 drivers/ntb/test/ntb_perf.c 	atomic_inc(&pthr->dma_sync);
pthr              843 drivers/ntb/test/ntb_perf.c 	dma_async_issue_pending(pthr->dma_chan);
pthr              846 drivers/ntb/test/ntb_perf.c 	return likely(atomic_read(&pthr->perf->tsync) > 0) ? 0 : -EINTR;
pthr              864 drivers/ntb/test/ntb_perf.c static int perf_init_test(struct perf_thread *pthr)
pthr              866 drivers/ntb/test/ntb_perf.c 	struct perf_ctx *perf = pthr->perf;
pthr              869 drivers/ntb/test/ntb_perf.c 	pthr->src = kmalloc_node(perf->test_peer->outbuf_size, GFP_KERNEL,
pthr              871 drivers/ntb/test/ntb_perf.c 	if (!pthr->src)
pthr              874 drivers/ntb/test/ntb_perf.c 	get_random_bytes(pthr->src, perf->test_peer->outbuf_size);
pthr              881 drivers/ntb/test/ntb_perf.c 	pthr->dma_chan = dma_request_channel(dma_mask, perf_dma_filter, perf);
pthr              882 drivers/ntb/test/ntb_perf.c 	if (!pthr->dma_chan) {
pthr              884 drivers/ntb/test/ntb_perf.c 			pthr->tidx);
pthr              887 drivers/ntb/test/ntb_perf.c 		kfree(pthr->src);
pthr              891 drivers/ntb/test/ntb_perf.c 	atomic_set(&pthr->dma_sync, 0);
pthr              896 drivers/ntb/test/ntb_perf.c static int perf_run_test(struct perf_thread *pthr)
pthr              898 drivers/ntb/test/ntb_perf.c 	struct perf_peer *peer = pthr->perf->test_peer;
pthr              899 drivers/ntb/test/ntb_perf.c 	struct perf_ctx *perf = pthr->perf;
pthr              909 drivers/ntb/test/ntb_perf.c 	flt_src = pthr->src;
pthr              913 drivers/ntb/test/ntb_perf.c 	pthr->duration = ktime_get();
pthr              916 drivers/ntb/test/ntb_perf.c 	while (pthr->copied < total_size) {
pthr              917 drivers/ntb/test/ntb_perf.c 		ret = perf_copy_chunk(pthr, flt_dst, flt_src, chunk_size);
pthr              920 drivers/ntb/test/ntb_perf.c 				pthr->tidx, ret);
pthr              924 drivers/ntb/test/ntb_perf.c 		pthr->copied += chunk_size;
pthr              930 drivers/ntb/test/ntb_perf.c 			flt_src = pthr->src;
pthr              940 drivers/ntb/test/ntb_perf.c static int perf_sync_test(struct perf_thread *pthr)
pthr              942 drivers/ntb/test/ntb_perf.c 	struct perf_ctx *perf = pthr->perf;
pthr              947 drivers/ntb/test/ntb_perf.c 	wait_event(pthr->dma_wait,
pthr              948 drivers/ntb/test/ntb_perf.c 		   (atomic_read(&pthr->dma_sync) == 0 ||
pthr              955 drivers/ntb/test/ntb_perf.c 	pthr->duration = ktime_sub(ktime_get(), pthr->duration);
pthr              958 drivers/ntb/test/ntb_perf.c 		pthr->tidx, pthr->copied);
pthr              961 drivers/ntb/test/ntb_perf.c 		pthr->tidx, ktime_to_us(pthr->duration));
pthr              963 drivers/ntb/test/ntb_perf.c 	dev_dbg(&perf->ntb->dev, "%d: %llu MBytes/s\n", pthr->tidx,
pthr              964 drivers/ntb/test/ntb_perf.c 		div64_u64(pthr->copied, ktime_to_us(pthr->duration)));
pthr              969 drivers/ntb/test/ntb_perf.c static void perf_clear_test(struct perf_thread *pthr)
pthr              971 drivers/ntb/test/ntb_perf.c 	struct perf_ctx *perf = pthr->perf;
pthr              980 drivers/ntb/test/ntb_perf.c 	(void)dmaengine_terminate_sync(pthr->dma_chan);
pthr              982 drivers/ntb/test/ntb_perf.c 	dma_release_channel(pthr->dma_chan);
pthr              987 drivers/ntb/test/ntb_perf.c 	kfree(pthr->src);
pthr              992 drivers/ntb/test/ntb_perf.c 	struct perf_thread *pthr = to_thread_work(work);
pthr             1002 drivers/ntb/test/ntb_perf.c 	ret = perf_init_test(pthr);
pthr             1004 drivers/ntb/test/ntb_perf.c 		pthr->status = ret;
pthr             1008 drivers/ntb/test/ntb_perf.c 	ret = perf_run_test(pthr);
pthr             1010 drivers/ntb/test/ntb_perf.c 		pthr->status = ret;
pthr             1014 drivers/ntb/test/ntb_perf.c 	pthr->status = perf_sync_test(pthr);
pthr             1017 drivers/ntb/test/ntb_perf.c 	perf_clear_test(pthr);
pthr             1051 drivers/ntb/test/ntb_perf.c 	struct perf_thread *pthr;
pthr             1064 drivers/ntb/test/ntb_perf.c 		pthr = &perf->threads[tidx];
pthr             1066 drivers/ntb/test/ntb_perf.c 		pthr->status = -ENODATA;
pthr             1067 drivers/ntb/test/ntb_perf.c 		pthr->copied = 0;
pthr             1068 drivers/ntb/test/ntb_perf.c 		pthr->duration = ktime_set(0, 0);
pthr             1070 drivers/ntb/test/ntb_perf.c 			(void)queue_work(perf_wq, &pthr->work);
pthr             1088 drivers/ntb/test/ntb_perf.c 	struct perf_thread *pthr;
pthr             1098 drivers/ntb/test/ntb_perf.c 		pthr = &perf->threads[tidx];
pthr             1100 drivers/ntb/test/ntb_perf.c 		if (pthr->status == -ENODATA)
pthr             1103 drivers/ntb/test/ntb_perf.c 		if (pthr->status) {
pthr             1105 drivers/ntb/test/ntb_perf.c 				"%d: error status %d\n", tidx, pthr->status);
pthr             1111 drivers/ntb/test/ntb_perf.c 			tidx, pthr->copied, ktime_to_us(pthr->duration),
pthr             1112 drivers/ntb/test/ntb_perf.c 			div64_u64(pthr->copied, ktime_to_us(pthr->duration)));
pthr             1122 drivers/ntb/test/ntb_perf.c 	struct perf_thread *pthr;
pthr             1130 drivers/ntb/test/ntb_perf.c 		pthr = &perf->threads[tidx];
pthr             1132 drivers/ntb/test/ntb_perf.c 		pthr->perf = perf;
pthr             1133 drivers/ntb/test/ntb_perf.c 		pthr->tidx = tidx;
pthr             1134 drivers/ntb/test/ntb_perf.c 		pthr->status = -ENODATA;
pthr             1135 drivers/ntb/test/ntb_perf.c 		init_waitqueue_head(&pthr->dma_wait);
pthr             1136 drivers/ntb/test/ntb_perf.c 		INIT_WORK(&pthr->work, perf_thread_work);