diff options
| author | Osama Abboud <osamaabb@amazon.com> | 2024-08-07 06:24:17 +0000 |
|---|---|---|
| committer | Osama Abboud <osamaabb@FreeBSD.org> | 2024-10-15 16:54:28 +0000 |
| commit | 3f2906c2257ad2f1266ce3cb9512ef681928d342 (patch) | |
| tree | 1632a0efc6c466681ead5ba8f0bb59b9be2f5c6a | |
| parent | 577d2864c117f3acf34220d2d7fed15a889b533c (diff) | |
ena: Handle ENA_CMD_ABORTED case on admin queue interrupt mode
Currently admin_queue->stats.aborted_cmd counter is incremented if an
admin command status is ENA_CMD_ABORTED and only if the admin queue is
in polling mode.
This commit fixes handling the case of incrementing
admin_queue->stats.aborted_cmd if the admin queue is in interrupt
mode as well.
Also added a verification that the command status is a valid
completion status which is currently verified only if the admin queue
is in polling mode.
Approved by: cperciva (mentor)
MFC after: 2 weeks
Sponsored by: Amazon, Inc.
| -rw-r--r-- | ena_com.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ena_com.c b/ena_com.c index 198302965318..ae952c4e4435 100644 --- a/ena_com.c +++ b/ena_com.c @@ -860,8 +860,19 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com ret = ENA_COM_TIMER_EXPIRED; goto err; } + } else if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { + ena_trc_err(admin_queue->ena_dev, "Command was aborted\n"); + ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); + admin_queue->stats.aborted_cmd++; + ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); + ret = ENA_COM_NO_DEVICE; + goto err; } + ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED, + admin_queue->ena_dev, "Invalid comp status %d\n", + comp_ctx->status); + ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status); err: comp_ctxt_release(admin_queue, comp_ctx); |
