Пример #1
0
int sock_cntr_progress(struct sock_cntr *cntr)
{
	struct sock_tx_ctx *tx_ctx;
	struct sock_rx_ctx *rx_ctx;
	struct dlist_entry *entry;

	struct fid_list_entry *fid_entry;

	if (cntr->domain->progress_mode == FI_PROGRESS_AUTO)
		return 0;

	fastlock_acquire(&cntr->list_lock);
	for (entry = cntr->tx_list.next; entry != &cntr->tx_list;
	     entry = entry->next) {
		fid_entry = container_of(entry, struct fid_list_entry, entry);
		tx_ctx = container_of(fid_entry->fid, struct sock_tx_ctx, fid.ctx.fid);
		if (tx_ctx->use_shared)
			sock_pe_progress_tx_ctx(cntr->domain->pe, tx_ctx->stx_ctx);
		else
			sock_pe_progress_tx_ctx(cntr->domain->pe, tx_ctx);
	}

	for (entry = cntr->rx_list.next; entry != &cntr->rx_list;
	     entry = entry->next) {
		fid_entry = container_of(entry, struct fid_list_entry, entry);
		rx_ctx = container_of(fid_entry->fid, struct sock_rx_ctx, ctx.fid);
		if (rx_ctx->use_shared)
			sock_pe_progress_rx_ctx(cntr->domain->pe, rx_ctx->srx_ctx);
		else
			sock_pe_progress_rx_ctx(cntr->domain->pe, rx_ctx);
	}

	fastlock_release(&cntr->list_lock);
	return 0;
}
Пример #2
0
int sock_cq_progress(struct sock_cq *cq)
{
	struct sock_tx_ctx *tx_ctx;
	struct sock_rx_ctx *rx_ctx;
	struct dlist_entry *entry;

	if (cq->domain->progress_mode == FI_PROGRESS_AUTO)
		return 0;

	fastlock_acquire(&cq->list_lock);
	for (entry = cq->tx_list.next; entry != &cq->tx_list;
	     entry = entry->next) {
		tx_ctx = container_of(entry, struct sock_tx_ctx, cq_entry);
		sock_pe_progress_tx_ctx(cq->domain->pe, tx_ctx);
	}

	for (entry = cq->rx_list.next; entry != &cq->rx_list;
	     entry = entry->next) {
		rx_ctx = container_of(entry, struct sock_rx_ctx, cq_entry);
		sock_pe_progress_rx_ctx(cq->domain->pe, rx_ctx);
	}
	fastlock_release(&cq->list_lock);

	return 0;
}