]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ice: small efficiency fixes
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Thu, 8 Aug 2019 14:39:37 +0000 (07:39 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 5 Sep 2019 15:13:40 +0000 (08:13 -0700)
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 <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_txrx.c

index ec581b1f0fcbb74cf1823ca5ea05e042481e00c1..33dd103035dcd4d8c5d18a9f5c5148755c7027f8 100644 (file)
@@ -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 */