From patchwork Tue Feb 9 02:23:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 12077029 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 E766DC433DB for ; Tue, 9 Feb 2021 02:24:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A63E064E76 for ; Tue, 9 Feb 2021 02:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbhBICX4 (ORCPT ); Mon, 8 Feb 2021 21:23:56 -0500 Received: from mga09.intel.com ([134.134.136.24]:15909 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230326AbhBICXo (ORCPT ); Mon, 8 Feb 2021 21:23:44 -0500 IronPort-SDR: WZzYQATZ8dpDpTKsjyX4/9lZRPObsoxUl2LC4OvyglH09S4ygjZkbPTbDwqX/8pbFr4kfP2XYn fstIdZdKR9jA== X-IronPort-AV: E=McAfee;i="6000,8403,9889"; a="181960301" X-IronPort-AV: E=Sophos;i="5.81,163,1610438400"; d="scan'208";a="181960301" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 18:22:48 -0800 IronPort-SDR: I4NpIcdbmlFxwrkCwDaOSTdGYQCgsQZgMxRF09DMUcYNVcGSMTS9moty05FFvfA4zQfShgM8Xv QyeNf5Xdrqlg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,163,1610438400"; d="scan'208";a="359003694" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga003.jf.intel.com with ESMTP; 08 Feb 2021 18:22:45 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Cristian Dumitrescu , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, bjorn.topel@intel.com, maciej.fijalkowski@intel.com, magnus.karlsson@intel.com, Kiran Bhandare Subject: [PATCH net-next v2 2/5] i40e: remove unnecessary cleaned_count updates Date: Mon, 8 Feb 2021 18:23:20 -0800 Message-Id: <20210209022323.2440775-3-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210209022323.2440775-1-anthony.l.nguyen@intel.com> References: <20210209022323.2440775-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Cristian Dumitrescu For performance reasons, remove the redundant updates of the cleaned_count variable, as its value can be computed based on the ring next-to-clean variable, which is consistently updated. Signed-off-by: Cristian Dumitrescu Tested-by: Kiran Bhandare Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index 87d43407653c..99082abd3000 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c @@ -300,7 +300,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) bi = i40e_rx_bi(rx_ring, next_to_clean); xsk_buff_free(*bi); *bi = NULL; - cleaned_count++; next_to_clean = (next_to_clean + 1) & count_mask; continue; } @@ -325,7 +324,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) total_rx_bytes += size; total_rx_packets++; - cleaned_count++; next_to_clean = (next_to_clean + 1) & count_mask; continue; } @@ -344,7 +342,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) } *bi = NULL; - cleaned_count++; next_to_clean = (next_to_clean + 1) & count_mask; if (eth_skb_pad(skb)) @@ -358,6 +355,7 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) } rx_ring->next_to_clean = next_to_clean; + cleaned_count = (next_to_clean - rx_ring->next_to_use - 1) & count_mask; if (cleaned_count >= I40E_RX_BUFFER_WRITE) failure = !i40e_alloc_rx_buffers_zc(rx_ring, cleaned_count);