switch (type) { case QUEUE_TYPE_FROM_CLIENT: /* used by rxe, client owns the index */
prod = smp_load_acquire(&q->buf->producer_index); break; case QUEUE_TYPE_TO_CLIENT: /* used by rxe which owns the index */
prod = q->index; break; case QUEUE_TYPE_FROM_ULP: /* used by ulp which owns the index */
prod = q->buf->producer_index; break; case QUEUE_TYPE_TO_ULP: /* used by ulp, rxe owns the index */
prod = smp_load_acquire(&q->buf->producer_index); break;
}
switch (type) { case QUEUE_TYPE_FROM_CLIENT: /* used by rxe which owns the index */
cons = q->index; break; case QUEUE_TYPE_TO_CLIENT: /* used by rxe, client owns the index */
cons = smp_load_acquire(&q->buf->consumer_index); break; case QUEUE_TYPE_FROM_ULP: /* used by ulp, rxe owns the index */
cons = smp_load_acquire(&q->buf->consumer_index); break; case QUEUE_TYPE_TO_ULP: /* used by ulp which owns the index */
cons = q->buf->consumer_index; break;
}
switch (type) { case QUEUE_TYPE_FROM_CLIENT: /* used by rxe, client owns the index */ if (WARN_ON(1))
pr_warn("%s: attempt to advance client index\n",
__func__); break; case QUEUE_TYPE_TO_CLIENT: /* used by rxe which owns the index */
prod = q->index;
prod = (prod + 1) & q->index_mask;
q->index = prod; /* release so client can read it safely */
smp_store_release(&q->buf->producer_index, prod); break; case QUEUE_TYPE_FROM_ULP: /* used by ulp which owns the index */
prod = q->buf->producer_index;
prod = (prod + 1) & q->index_mask; /* release so rxe can read it safely */
smp_store_release(&q->buf->producer_index, prod); break; case QUEUE_TYPE_TO_ULP: /* used by ulp, rxe owns the index */ if (WARN_ON(1))
pr_warn("%s: attempt to advance driver index\n",
__func__); break;
}
}
switch (type) { case QUEUE_TYPE_FROM_CLIENT: /* used by rxe which owns the index */
cons = (q->index + 1) & q->index_mask;
q->index = cons; /* release so client can read it safely */
smp_store_release(&q->buf->consumer_index, cons); break; case QUEUE_TYPE_TO_CLIENT: /* used by rxe, client owns the index */ if (WARN_ON(1))
pr_warn("%s: attempt to advance client index\n",
__func__); break; case QUEUE_TYPE_FROM_ULP: /* used by ulp, rxe owns the index */ if (WARN_ON(1))
pr_warn("%s: attempt to advance driver index\n",
__func__); break; case QUEUE_TYPE_TO_ULP: /* used by ulp which owns the index */
cons = q->buf->consumer_index;
cons = (cons + 1) & q->index_mask; /* release so rxe can read it safely */
smp_store_release(&q->buf->consumer_index, cons); break;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.