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 C4DBC4554D; Tue, 2 Jul 2024 16:47:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FD7740DDB; Tue, 2 Jul 2024 16:46:48 +0200 (CEST) Received: from smtp-fw-9105.amazon.com (smtp-fw-9105.amazon.com [207.171.188.204]) by mails.dpdk.org (Postfix) with ESMTP id 1C44F40B97 for ; Tue, 2 Jul 2024 16:46:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1719931607; x=1751467607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=+KcYm1gC3pAhid9uZBuu9D0p2j3HB43BcmC/aapMBfQ=; b=HxCjtaVGny7wzRQ7uSeTWVaUc3dZkBetlZjb25Gn9RAjph+GAG/A2e0L t9B5Hd0s+IMkBa5epczJZMBZK1tTbYXgQODl3BtiwOHcBjjernd8K9oT7 Xuk4ErgUwBhTzyp9cM9Pw6V5BwOmoJsq2EH6TcSlXUjCPoTFhsmmibfb1 c=; X-IronPort-AV: E=Sophos;i="6.09,178,1716249600"; d="scan'208";a="737955911" 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-9105.sea19.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2024 14:46:40 +0000 Received: from EX19MTAEUA001.ant.amazon.com [10.0.43.254:16310] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.29.5:2525] with esmtp (Farcaster) id 78b4aa1e-74c0-42c8-954d-2576a8e27cd8; Tue, 2 Jul 2024 14:46:38 +0000 (UTC) X-Farcaster-Flow-ID: 78b4aa1e-74c0-42c8-954d-2576a8e27cd8 Received: from EX19D007EUB004.ant.amazon.com (10.252.51.85) by EX19MTAEUA001.ant.amazon.com (10.252.50.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Tue, 2 Jul 2024 14:46:38 +0000 Received: from EX19MTAUWB001.ant.amazon.com (10.250.64.248) by EX19D007EUB004.ant.amazon.com (10.252.51.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.34; Tue, 2 Jul 2024 14:46:37 +0000 Received: from HFA15-CG15235BS.amazon.com (10.85.143.173) by mail-relay.amazon.com (10.250.64.254) with Microsoft SMTP Server id 15.2.1258.34 via Frontend Transport; Tue, 2 Jul 2024 14:46:36 +0000 From: To: CC: , Shai Brandes Subject: [PATCH 03/15] net/ena/base: remove redundant assert checks Date: Tue, 2 Jul 2024 17:46:14 +0300 Message-ID: <20240702144626.14545-4-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240702144626.14545-1-shaibran@amazon.com> References: <20240702144626.14545-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 Remove ENA_WARN checks from ena_com_wait_and_process_admin_cq_polling since once the execution flow reaches the check, it must be ENA_CMD_COMPLETED because it can't be either of the other options: 1. ENA_CMD_ABORTED - in such case it will perform "goto err" in the "if" block above, thus skipping the ENA_WARN check. 2. ENA_CMD_SUBMITTED - in such case it will timeout inside the while(1) loop above and perform "goto err", thus skipping the ENA_WARN check. Remove ENA_WARN check from ena_com_wait_and_process_admin_cq_interrupts since once the execution flow reaches the check, it must be ENA_CMD_COMPLETED because it can't be either of the other options: 1. ENA_CMD_ABORTED - same as above, i will perform "goto err" in the "if" block above, thus skipping the ENA_WARN check. 2. ENA_CMD_SUBMITTED - in such case it will perform "goto err" in the nested if block above, since "admin_queue->polling" is false (because of the interrupt mode execution of admin commands) Signed-off-by: Shai Brandes --- drivers/net/ena/base/ena_com.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c index 9e1fa40c0c..f9dd086484 100644 --- a/drivers/net/ena/base/ena_com.c +++ b/drivers/net/ena/base/ena_com.c @@ -598,10 +598,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c 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); @@ -828,10 +824,6 @@ static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com 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