From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6FAD843C94; Tue, 12 Mar 2024 19:09:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39E7B42E1A; Tue, 12 Mar 2024 19:08:22 +0100 (CET) Received: from smtp-fw-80007.amazon.com (smtp-fw-80007.amazon.com [99.78.197.218]) by mails.dpdk.org (Postfix) with ESMTP id 4729D42E61 for ; Tue, 12 Mar 2024 19:08:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1710266896; x=1741802896; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=V3uQWF6PQDFOJODcK0oOYiiiJZRazooBFTlP+e5/xv8=; b=s+cwsMlSVsGwiE8Z/t+6LWGIUs+XL7UnRSSqVqk7wSzdXRX4q83Y2ZFP CnQLgZ0UXLi1BX8aMTMLHTj7nZgY2zNdsVvdjC1zzRBTW9IgKdaRlAtiP JBCtHJOYyUqYKGwVDqHYOuGYOCXE/GPa3xZoswG5KifP3P4EcsXbaUh1q I=; X-IronPort-AV: E=Sophos;i="6.07,119,1708387200"; d="scan'208";a="280481711" Received: from pdx4-co-svc-p1-lb2-vlan2.amazon.com (HELO smtpout.prod.us-east-1.prod.farcaster.email.amazon.dev) ([10.25.36.210]) by smtp-border-fw-80007.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Mar 2024 18:08:14 +0000 Received: from EX19MTAEUC001.ant.amazon.com [10.0.10.100:1570] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.24.76:2525] with esmtp (Farcaster) id efb86f2f-500f-456c-ba23-4891f48bf478; Tue, 12 Mar 2024 18:08:12 +0000 (UTC) X-Farcaster-Flow-ID: efb86f2f-500f-456c-ba23-4891f48bf478 Received: from EX19D007EUB002.ant.amazon.com (10.252.51.117) by EX19MTAEUC001.ant.amazon.com (10.252.51.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:08:12 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUB002.ant.amazon.com (10.252.51.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 12 Mar 2024 18:08:12 +0000 Received: from HFA15-CG15235BS.amazon.com (10.85.143.174) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Tue, 12 Mar 2024 18:08:10 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v4 22/31] net/ena/base: handle command abort Date: Tue, 12 Mar 2024 20:07:07 +0200 Message-ID: <20240312180716.8515-23-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240312180716.8515-1-shaibran@amazon.com> References: <20240312180716.8515-1-shaibran@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Shai Brandes 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. Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- drivers/net/ena/base/ena_com.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index 053e095585..b98540ba63 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -824,8 +824,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); -- 2.17.1