From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>,
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 <kiranx.bhandare@intel.com>
Subject: [PATCH net-next 2/6] i40e: remove unnecessary cleaned_count updates
Date: Mon, 1 Feb 2021 18:24:16 -0800 [thread overview]
Message-ID: <20210202022420.1328397-3-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20210202022420.1328397-1-anthony.l.nguyen@intel.com>
From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
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 <cristian.dumitrescu@intel.com>
Tested-by: Kiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
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);
--
2.26.2
next prev parent reply other threads:[~2021-02-02 2:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-02 2:24 [PATCH net-next 0/6][pull request] 40GbE Intel Wired LAN Driver Updates 2021-02-01 Tony Nguyen
2021-02-02 2:24 ` [PATCH net-next 1/6] i40e: remove unnecessary memory writes of the next to clean pointer Tony Nguyen
2021-02-02 2:24 ` Tony Nguyen [this message]
2021-02-02 2:24 ` [PATCH net-next 3/6] i40e: remove the redundant buffer info updates Tony Nguyen
2021-02-02 2:24 ` [PATCH net-next 4/6] i40e: consolidate handling of XDP program actions Tony Nguyen
2021-02-02 2:24 ` [PATCH net-next 5/6] i40e: Add info trace at loading XDP program Tony Nguyen
2021-02-03 2:33 ` Jakub Kicinski
2021-02-03 10:00 ` Kubalewski, Arkadiusz
2021-02-03 18:32 ` Jakub Kicinski
2021-02-03 23:26 ` Kubalewski, Arkadiusz
2021-02-02 2:24 ` [PATCH net-next 6/6] i40e: Log error for oversized MTU on device Tony Nguyen
2021-02-03 2:34 ` Jakub Kicinski
2021-02-03 9:14 ` Loktionov, Aleksandr
2021-02-03 18:37 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210202022420.1328397-3-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=bjorn.topel@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=davem@davemloft.net \
--cc=kiranx.bhandare@intel.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).