Commit f12738b6 authored by Cristian Dumitrescu's avatar Cristian Dumitrescu Committed by Tony Nguyen

i40e: remove unnecessary cleaned_count updates

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: default avatarCristian Dumitrescu <cristian.dumitrescu@intel.com>
Tested-by: default avatarKiran Bhandare <kiranx.bhandare@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent c8a8ca34
...@@ -300,7 +300,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) ...@@ -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); bi = i40e_rx_bi(rx_ring, next_to_clean);
xsk_buff_free(*bi); xsk_buff_free(*bi);
*bi = NULL; *bi = NULL;
cleaned_count++;
next_to_clean = (next_to_clean + 1) & count_mask; next_to_clean = (next_to_clean + 1) & count_mask;
continue; continue;
} }
...@@ -325,7 +324,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) ...@@ -325,7 +324,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
total_rx_bytes += size; total_rx_bytes += size;
total_rx_packets++; total_rx_packets++;
cleaned_count++;
next_to_clean = (next_to_clean + 1) & count_mask; next_to_clean = (next_to_clean + 1) & count_mask;
continue; continue;
} }
...@@ -344,7 +342,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) ...@@ -344,7 +342,6 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
} }
*bi = NULL; *bi = NULL;
cleaned_count++;
next_to_clean = (next_to_clean + 1) & count_mask; next_to_clean = (next_to_clean + 1) & count_mask;
if (eth_skb_pad(skb)) if (eth_skb_pad(skb))
...@@ -358,6 +355,7 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget) ...@@ -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; 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) if (cleaned_count >= I40E_RX_BUFFER_WRITE)
failure = !i40e_alloc_rx_buffers_zc(rx_ring, cleaned_count); failure = !i40e_alloc_rx_buffers_zc(rx_ring, cleaned_count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment