rtio: Release sqe before submitting cqe
When an application is waiting on a completion it may be expecting, rightfully so, that a new submissions slot is available. Frees the submission queue event prior to enqueuing the completion queue event in the simple executor. Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This commit is contained in:
parent
f6e2cb9b84
commit
8b6ede6047
1 changed files with 8 additions and 5 deletions
|
@ -41,8 +41,10 @@ int rtio_simple_submit(struct rtio *r)
|
||||||
*/
|
*/
|
||||||
void rtio_simple_ok(struct rtio *r, const struct rtio_sqe *sqe, int result)
|
void rtio_simple_ok(struct rtio *r, const struct rtio_sqe *sqe, int result)
|
||||||
{
|
{
|
||||||
rtio_cqe_submit(r, result, sqe->userdata);
|
void *userdata = sqe->userdata;
|
||||||
|
|
||||||
rtio_spsc_release(r->sq);
|
rtio_spsc_release(r->sq);
|
||||||
|
rtio_cqe_submit(r, result, userdata);
|
||||||
rtio_simple_submit(r);
|
rtio_simple_submit(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,18 +54,19 @@ void rtio_simple_ok(struct rtio *r, const struct rtio_sqe *sqe, int result)
|
||||||
void rtio_simple_err(struct rtio *r, const struct rtio_sqe *sqe, int result)
|
void rtio_simple_err(struct rtio *r, const struct rtio_sqe *sqe, int result)
|
||||||
{
|
{
|
||||||
struct rtio_sqe *nsqe;
|
struct rtio_sqe *nsqe;
|
||||||
bool chained;
|
void *userdata = sqe->userdata;
|
||||||
|
bool chained = sqe->flags & RTIO_SQE_CHAINED;
|
||||||
|
|
||||||
rtio_cqe_submit(r, result, sqe->userdata);
|
|
||||||
chained = sqe->flags & RTIO_SQE_CHAINED;
|
|
||||||
rtio_spsc_release(r->sq);
|
rtio_spsc_release(r->sq);
|
||||||
|
rtio_cqe_submit(r, result, sqe->userdata);
|
||||||
|
|
||||||
if (chained) {
|
if (chained) {
|
||||||
|
|
||||||
nsqe = rtio_spsc_consume(r->sq);
|
nsqe = rtio_spsc_consume(r->sq);
|
||||||
while (nsqe != NULL && nsqe->flags & RTIO_SQE_CHAINED) {
|
while (nsqe != NULL && nsqe->flags & RTIO_SQE_CHAINED) {
|
||||||
rtio_cqe_submit(r, -ECANCELED, nsqe->userdata);
|
userdata = nsqe->userdata;
|
||||||
rtio_spsc_release(r->sq);
|
rtio_spsc_release(r->sq);
|
||||||
|
rtio_cqe_submit(r, -ECANCELED, userdata);
|
||||||
nsqe = rtio_spsc_consume(r->sq);
|
nsqe = rtio_spsc_consume(r->sq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue