From patchwork Thu May 27 04:35:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 449368 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F6EFC47089 for ; Thu, 27 May 2021 04:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2041A61003 for ; Thu, 27 May 2021 04:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234744AbhE0EiS (ORCPT ); Thu, 27 May 2021 00:38:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:40478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbhE0EiH (ORCPT ); Thu, 27 May 2021 00:38:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D49E5613CC; Thu, 27 May 2021 04:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622090194; bh=47XmjZ9lIAGJGFHkUS4jO8otskT8KMwjqhqghWzDZSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=duOEW47C3Pk9zuPDT3a4jSWgzvh/P1q7xWgnzV8pozKoRQLut63+qI04kVpGF1gsP UBTz0NhvcV3c3wkmuCs+Gkg0yDBc96ddQJXMmAXcG+ILnxUc4cyXfOdvkShH3SchqC Xdan2180A9wpBAkTzseCAsXR8YkWRasjSQeaGwttyC3t5U8f9+xynr86mt0j2cazEQ q9erFZThf0DWV3Co/vgJv7XvUZzCoDA5RLhecO6dPoM9CYpxn7GEr5yreTTs6cB0Jm uwW7Tbo2/wBObzPGlSJ9QMw9jf55N0l3qaODu/DyuG/1HftRlO0mOwVSa9SgbK6/Pd uHEKKJopWUpqQ== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Saeed Mahameed Subject: [net-next 06/17] net/mlx5e: RX, Remove unnecessary check in RX CQE compression handling Date: Wed, 26 May 2021 21:35:58 -0700 Message-Id: <20210527043609.654854-7-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527043609.654854-1-saeed@kernel.org> References: <20210527043609.654854-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tariq Toukan There are two reasons for exiting mlx5e_decompress_cqes_cont(): 1. The compression session is completed (cqd.left == 0). 2. The budget is exhausted (work_done == budget). If after calling mlx5e_decompress_cqes_cont() we have cqd.left > 0, it necessarily implies that budget is exhausted. The first part of the complex condition is covered by the second, hence we remove it here. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 5346271974f5..e88429356018 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1560,7 +1560,7 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget) if (rq->cqd.left) { work_done += mlx5e_decompress_cqes_cont(rq, cqwq, 0, budget); - if (rq->cqd.left || work_done >= budget) + if (work_done >= budget) goto out; }