aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Brandeburg <[email protected]>2019-08-08 07:39:37 -0700
committerJeff Kirsher <[email protected]>2019-09-05 08:13:40 -0700
commitd27525ec1fdd01740edb7d4f3dc801256d543393 (patch)
tree1f8b617df7d9f6c32a1fd3a3de3c1bf8269b373e
parent6503b659302893af700d9e9b82d3210d09a3aefb (diff)
ice: small efficiency fixes
Add a small bit of efficiency to the code by adding a prefetch of the port_info structure in order to help avoid a cache miss a little later on in execution. Also add an unlikely statement to a branch which generally will never happen in normal operation. Signed-off-by: Jesse Brandeburg <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
-rw-r--r--drivers/net/ethernet/intel/ice/ice_txrx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index ec581b1f0fcb..33dd103035dc 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1226,6 +1226,8 @@ ice_update_itr(struct ice_q_vector *q_vector, struct ice_ring_container *rc)
if (time_after(next_update, rc->next_update))
goto clear_counts;
+ prefetch(q_vector->vsi->port_info);
+
packets = rc->total_pkts;
bytes = rc->total_bytes;
@@ -1486,7 +1488,7 @@ int ice_napi_poll(struct napi_struct *napi, int budget)
clean_complete = false;
/* Handle case where we are called by netpoll with a budget of 0 */
- if (budget <= 0)
+ if (unlikely(budget <= 0))
return budget;
/* normally we have 1 Rx ring per q_vector */