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 E852143C5B; Wed, 6 Mar 2024 13:28:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D3E2742DF6; Wed, 6 Mar 2024 13:25:47 +0100 (CET) Received: from smtp-fw-80009.amazon.com (smtp-fw-80009.amazon.com [99.78.197.220]) by mails.dpdk.org (Postfix) with ESMTP id A6C6A42DE9 for ; Wed, 6 Mar 2024 13:25:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1709727945; x=1741263945; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=GoS8TERay/ij48nRuXt/uG2U5nXux23ICXr+CMAiw8I=; b=GO/Taawmnhc5S4YLfQXAETxOQJTzH9OgRaQ0EunVk3clWtIo8SGRN59c +H/yugoSHYmrvIQxsHygo9L3mFTdgjpkmfwtDs7jsX7QdqQFHIdjgX1jq XmV4viXjFrGeOQl1jLLsMIu/C9ilxOsJMJkqIjG2Hz/CLBbqLMpQrx3pY c=; X-IronPort-AV: E=Sophos;i="6.06,208,1705363200"; d="scan'208";a="71125416" 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-80009.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 12:25:41 +0000 Received: from EX19MTAEUB001.ant.amazon.com [10.0.10.100:38030] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.16.96:2525] with esmtp (Farcaster) id 00a7a222-e9b1-4f64-acf2-4ee72586733d; Wed, 6 Mar 2024 12:25:40 +0000 (UTC) X-Farcaster-Flow-ID: 00a7a222-e9b1-4f64-acf2-4ee72586733d Received: from EX19D007EUA004.ant.amazon.com (10.252.50.76) by EX19MTAEUB001.ant.amazon.com (10.252.51.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 6 Mar 2024 12:25:39 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUA004.ant.amazon.com (10.252.50.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 6 Mar 2024 12:25:39 +0000 Received: from HFA15-CG15235BS.amazon.com (10.1.213.21) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Wed, 6 Mar 2024 12:25:38 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v3 24/33] net/ena/hal: handle command abort Date: Wed, 6 Mar 2024 14:24:36 +0200 Message-ID: <20240306122445.4350-25-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240306122445.4350-1-shaibran@amazon.com> References: <20240306122445.4350-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/hal/ena_com.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/ena/hal/ena_com.c b/drivers/net/ena/hal/ena_com.c index 053e095585..b98540ba63 100644 --- a/drivers/net/ena/hal/ena_com.c +++ b/drivers/net/ena/hal/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