From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next 3/8] i40e: adjust i40e_is_non_eop
Date: Fri, 11 Dec 2020 17:49:51 +0100 [thread overview]
Message-ID: <20201211164956.59628-4-maciej.fijalkowski@intel.com> (raw)
In-Reply-To: <20201211164956.59628-1-maciej.fijalkowski@intel.com>
i40e_is_non_eop had a leftover comment and unused skb argument which was
used for placing the skb onto rx_buf in case when current buffer was
non-eop one. This is not relevant anymore as commit e72e56597ba1
("i40e/i40evf: Moves skb from i40e_rx_buffer to i40e_ring") pulled the
non-complete skb handling out of rx_bufs up to rx_ring. Therefore,
let's adjust the function arguments that i40e_is_non_eop takes.
Furthermore, since there is already a function responsible for bumping
the ntc, make use of that and drop that logic from i40e_is_non_eop so
that the scope of this function is limited to what the name actually
states.
Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 23 ++++++---------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 1dbb8efa50ad..205dc2124e96 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2118,25 +2118,13 @@ static void i40e_put_rx_buffer(struct i40e_ring *rx_ring,
* i40e_is_non_eop - process handling of non-EOP buffers
* @rx_ring: Rx ring being processed
* @rx_desc: Rx descriptor for current buffer
- * @skb: Current socket buffer containing buffer in progress
*
- * This function updates next to clean. If the buffer is an EOP buffer
- * this function exits returning false, otherwise it will place the
- * sk_buff in the next buffer to be chained and return true indicating
- * that this is in fact a non-EOP buffer.
- **/
+ * If the buffer is an EOP buffer, this function exits returning false,
+ * otherwise return true indicating that this is in fact a non-EOP buffer.
+ */
static bool i40e_is_non_eop(struct i40e_ring *rx_ring,
- union i40e_rx_desc *rx_desc,
- struct sk_buff *skb)
+ union i40e_rx_desc *rx_desc)
{
- u32 ntc = rx_ring->next_to_clean + 1;
-
- /* fetch, update, and store next to clean */
- ntc = (ntc < rx_ring->count) ? ntc : 0;
- rx_ring->next_to_clean = ntc;
-
- prefetch(I40E_RX_DESC(rx_ring, ntc));
-
/* if we are the last buffer then there is nothing else to do */
#define I40E_RXD_EOF BIT(I40E_RX_DESC_STATUS_EOF_SHIFT)
if (likely(i40e_test_staterr(rx_desc, I40E_RXD_EOF)))
@@ -2414,7 +2402,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
i40e_put_rx_buffer(rx_ring, rx_buffer);
cleaned_count++;
- if (i40e_is_non_eop(rx_ring, rx_desc, skb))
+ i40e_inc_ntc(rx_ring);
+ if (i40e_is_non_eop(rx_ring, rx_desc))
continue;
if (i40e_cleanup_headers(rx_ring, skb, rx_desc)) {
--
2.20.1
next prev parent reply other threads:[~2020-12-11 16:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 16:49 [Intel-wired-lan] [PATCH net-next 0/8] i40e/ice cleanups Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 1/8] i40e: drop redundant check when setting xdp prog Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 2/8] i40e: drop misleading function comments Maciej Fijalkowski
2020-12-11 16:49 ` Maciej Fijalkowski [this message]
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 4/8] ice: simplify ice_run_xdp Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 5/8] ice: move skb pointer from rx_buf to rx_ring Maciej Fijalkowski
2020-12-12 4:23 ` Jakub Kicinski
2020-12-14 15:07 ` Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 6/8] ice: remove redundant checks in ice_change_mtu Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 7/8] ice: skip NULL check against XDP prog in ZC path Maciej Fijalkowski
2020-12-11 16:49 ` [Intel-wired-lan] [PATCH net-next 8/8] i40e, xsk: Simplify the do-while allocation loop Maciej Fijalkowski
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=20201211164956.59628-4-maciej.fijalkowski@intel.com \
--to=maciej.fijalkowski@intel.com \
--cc=intel-wired-lan@osuosl.org \
/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