コード例 #1
0
ファイル: pscom_openib.c プロジェクト: RWTH-OS/pscom
static
void pscom_openib_do_write(pscom_con_t *con)
{
	size_t len;
	struct iovec iov[2];
	pscom_req_t *req;

	req = pscom_write_get_iov(con, iov);

	if (req) {
		psoib_con_info_t *mcon = con->arch.openib.mcon;
		len = iov[0].iov_len + iov[1].iov_len;

		perf_add("openib_sendv");
		ssize_t rlen = psoib_sendv(mcon, iov, len);

		if (rlen >= 0) {
			pscom_write_done(con, req, rlen);
			pscom_check_cq_poll();
		} else if ((rlen == -EINTR) || (rlen == -EAGAIN)) {
			// Busy: Maybe out of tokens? try to read more tokens:
			_pscom_openib_do_read(con, mcon);
		} else {
			// Error
			pscom_con_error(con, PSCOM_OP_WRITE, PSCOM_ERR_STDERROR);
		}
	}
}
コード例 #2
0
ファイル: openib_pp.c プロジェクト: carsten-clauss/pscom
static
void x_send_pscom(unsigned msglen)
{
	int len;
	struct iovec amsg = {
		.iov_base = abuffer,
		.iov_len = msglen,
	};

	len = psoib_sendv(mcon, &amsg, msglen);
	assert(len == (int)msglen);

	// Flush cq:
	while (mcon->outstanding_cq_entries) {
		psoib_progress();
	}
}