コード例 #1
0
ファイル: tcpx_progress.c プロジェクト: gbtitus/libfabric
static int process_rx_entry(struct tcpx_xfer_entry *rx_entry)
{
	struct tcpx_cq *tcpx_cq;
	int ret;

	ret = tcpx_recv_msg_data(rx_entry);
	if (OFI_SOCK_TRY_SND_RCV_AGAIN(-ret))
		return ret;

	if (!ret)
		goto done;

	FI_WARN(&tcpx_prov, FI_LOG_DOMAIN, "msg recv Failed ret = %d\n", ret);

	if (ret == -FI_ENOTCONN)
		tcpx_ep_shutdown_report(rx_entry->ep,
					&rx_entry->ep->util_ep.ep_fid.fid);
done:
	if (ntohl(rx_entry->msg_hdr.hdr.flags) & OFI_DELIVERY_COMPLETE) {

		if (tcpx_prepare_rx_entry_resp(rx_entry))
			rx_entry->ep->cur_rx_proc_fn = tcpx_prepare_rx_entry_resp;

		return FI_SUCCESS;
	}

	tcpx_cq_report_completion(rx_entry->ep->util_ep.rx_cq,
				  rx_entry, -ret);
	tcpx_cq = container_of(rx_entry->ep->util_ep.rx_cq,
			       struct tcpx_cq, util_cq);
	tcpx_xfer_entry_release(tcpx_cq, rx_entry);
	return FI_SUCCESS;
}
コード例 #2
0
ファイル: tcpx_progress.c プロジェクト: a-ilango/libfabric
static int process_rx_entry(struct tcpx_xfer_entry *rx_entry)
{
	int ret = FI_SUCCESS;

	ret = tcpx_recv_msg_data(rx_entry);
	if (OFI_SOCK_TRY_SND_RCV_AGAIN(-ret))
		return ret;

	if (ret) {
		FI_WARN(&tcpx_prov, FI_LOG_EP_DATA,
			"msg recv Failed ret = %d\n", ret);

		tcpx_ep_shutdown_report(rx_entry->ep,
					&rx_entry->ep->util_ep.ep_fid.fid);
		tcpx_cq_report_error(rx_entry->ep->util_ep.rx_cq,
				     rx_entry, ret);
		tcpx_rx_msg_release(rx_entry);
	} else 	if (rx_entry->hdr.base_hdr.flags & OFI_DELIVERY_COMPLETE) {
		if (tcpx_prepare_rx_entry_resp(rx_entry))
			rx_entry->ep->cur_rx_proc_fn = tcpx_prepare_rx_entry_resp;
	} else {
		tcpx_cq_report_success(rx_entry->ep->util_ep.rx_cq,
				       rx_entry);
		tcpx_rx_msg_release(rx_entry);
	}
	return ret;
}
コード例 #3
0
ファイル: tcpx_progress.c プロジェクト: gbtitus/libfabric
static int process_srx_entry(struct tcpx_xfer_entry *rx_entry)
{
	int ret;

	ret = tcpx_recv_msg_data(rx_entry);
	if (OFI_SOCK_TRY_SND_RCV_AGAIN(-ret))
		return ret;

	if (ret) {
		FI_WARN(&tcpx_prov, FI_LOG_DOMAIN,
			"msg recv Failed ret = %d\n", ret);

		tcpx_ep_shutdown_report(rx_entry->ep,
					&rx_entry->ep->util_ep.ep_fid.fid);
	}

	if ((ntohl(rx_entry->msg_hdr.hdr.flags) &
	     OFI_DELIVERY_COMPLETE) && !ret) {
		if (tcpx_prepare_rx_entry_resp(rx_entry))
			rx_entry->ep->cur_rx_proc_fn = tcpx_prepare_rx_entry_resp;

		return FI_SUCCESS;
	}

	tcpx_cq_report_completion(rx_entry->ep->util_ep.rx_cq,
				  rx_entry, -ret);

	/* release the shared entry */
	if (rx_entry->ep->cur_rx_entry == rx_entry) {
		rx_entry->ep->cur_rx_entry = NULL;
	}

	fastlock_acquire(&rx_entry->ep->srx_ctx->lock);
	util_buf_release(rx_entry->ep->srx_ctx->buf_pool, rx_entry);
	fastlock_release(&rx_entry->ep->srx_ctx->lock);
	return FI_SUCCESS;
}