event/cnxk: add checks in release operation

Add additional checks while performing RTE_EVENT_OP_RELEASE to
ensure that there are no pending SWTAGs and FLUSHEs in flight.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
This commit is contained in:
Pavan Nikhilesh 2022-04-27 16:28:27 +05:30 committed by Jerin Jacob
parent 791dfec24d
commit c8b1008d33
6 changed files with 35 additions and 17 deletions

View File

@ -137,9 +137,7 @@ cn10k_sso_hws_flush_events(void *hws, uint8_t queue_id, uintptr_t base,
if (fn != NULL && ev.u64 != 0)
fn(arg, ev);
if (ev.sched_type != SSO_TT_EMPTY)
cnxk_sso_hws_swtag_flush(
ws->base + SSOW_LF_GWS_WQE0,
ws->base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
cnxk_sso_hws_swtag_flush(ws->base);
do {
val = plt_read64(ws->base + SSOW_LF_GWS_PENDSTATE);
} while (val & BIT_ULL(56));

View File

@ -18,8 +18,12 @@ cn10k_sso_hws_enq(void *port, const struct rte_event *ev)
cn10k_sso_hws_forward_event(ws, ev);
break;
case RTE_EVENT_OP_RELEASE:
cnxk_sso_hws_swtag_flush(ws->base + SSOW_LF_GWS_WQE0,
ws->base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
if (ws->swtag_req) {
cnxk_sso_hws_desched(ev->u64, ws->base);
ws->swtag_req = 0;
break;
}
cnxk_sso_hws_swtag_flush(ws->base);
break;
default:
return 0;

View File

@ -156,9 +156,7 @@ cn9k_sso_hws_flush_events(void *hws, uint8_t queue_id, uintptr_t base,
if (fn != NULL && ev.u64 != 0)
fn(arg, ev);
if (ev.sched_type != SSO_TT_EMPTY)
cnxk_sso_hws_swtag_flush(
ws_base + SSOW_LF_GWS_TAG,
ws_base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
cnxk_sso_hws_swtag_flush(ws_base);
do {
val = plt_read64(ws_base + SSOW_LF_GWS_PENDSTATE);
} while (val & BIT_ULL(56));

View File

@ -19,8 +19,12 @@ cn9k_sso_hws_enq(void *port, const struct rte_event *ev)
cn9k_sso_hws_forward_event(ws, ev);
break;
case RTE_EVENT_OP_RELEASE:
cnxk_sso_hws_swtag_flush(ws->base + SSOW_LF_GWS_TAG,
ws->base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
if (ws->swtag_req) {
cnxk_sso_hws_desched(ev->u64, ws->base);
ws->swtag_req = 0;
break;
}
cnxk_sso_hws_swtag_flush(ws->base);
break;
default:
return 0;
@ -78,8 +82,12 @@ cn9k_sso_hws_dual_enq(void *port, const struct rte_event *ev)
cn9k_sso_hws_dual_forward_event(dws, base, ev);
break;
case RTE_EVENT_OP_RELEASE:
cnxk_sso_hws_swtag_flush(base + SSOW_LF_GWS_TAG,
base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
if (dws->swtag_req) {
cnxk_sso_hws_desched(ev->u64, base);
dws->swtag_req = 0;
break;
}
cnxk_sso_hws_swtag_flush(base);
break;
default:
return 0;

View File

@ -841,8 +841,7 @@ cn9k_sso_hws_event_tx(uint64_t base, struct rte_event *ev, uint64_t *cmd,
return 1;
}
cnxk_sso_hws_swtag_flush(base + SSOW_LF_GWS_TAG,
base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
cnxk_sso_hws_swtag_flush(base);
return 1;
}

View File

@ -45,11 +45,15 @@ cnxk_sso_hws_swtag_untag(uintptr_t swtag_untag_op)
}
static __rte_always_inline void
cnxk_sso_hws_swtag_flush(uint64_t tag_op, uint64_t flush_op)
cnxk_sso_hws_swtag_flush(uint64_t base)
{
if (CNXK_TT_FROM_TAG(plt_read64(tag_op)) == SSO_TT_EMPTY)
/* Ensure that there is no previous flush is pending. */
while (plt_read64(base + SSOW_LF_GWS_PENDSTATE) & BIT_ULL(56))
;
if (CNXK_TT_FROM_TAG(plt_read64(base + SSOW_LF_GWS_TAG)) ==
SSO_TT_EMPTY)
return;
plt_write64(0, flush_op);
plt_write64(0, base + SSOW_LF_GWS_OP_SWTAG_FLUSH);
}
static __rte_always_inline uint64_t
@ -78,4 +82,11 @@ cnxk_sso_hws_swtag_wait(uintptr_t tag_op)
return swtp;
}
static __rte_always_inline void
cnxk_sso_hws_desched(uint64_t u64, uint64_t base)
{
plt_write64(u64, base + SSOW_LF_GWS_OP_UPD_WQP_GRP1);
plt_write64(0, base + SSOW_LF_GWS_OP_DESCHED);
}
#endif