i40evf: Use smp_rmb rather than read_barrier_depends
[sfrench/cifs-2.6.git] / drivers / net / ethernet / intel / i40evf / i40e_txrx.c
index c32c62462c844a3cfe7f4449d886f084aa86dcf9..50864f99446d3a9f22c83c984eaec4f25caa6015 100644 (file)
@@ -179,7 +179,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,
                        break;
 
                /* prevent any other reads prior to eop_desc */
-               read_barrier_depends();
+               smp_rmb();
 
                i40e_trace(clean_tx_irq, tx_ring, tx_desc, tx_buf);
                /* if the descriptor isn't done, no work yet to do */
@@ -358,14 +358,14 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
 {
        enum i40e_latency_range new_latency_range = rc->latency_range;
        u32 new_itr = rc->itr;
-       int bytes_per_int;
+       int bytes_per_usec;
        unsigned int usecs, estimated_usecs;
 
        if (rc->total_packets == 0 || !rc->itr)
                return false;
 
        usecs = (rc->itr << 1) * ITR_COUNTDOWN_START;
-       bytes_per_int = rc->total_bytes / usecs;
+       bytes_per_usec = rc->total_bytes / usecs;
 
        /* The calculations in this algorithm depend on interrupts actually
         * firing at the ITR rate. This may not happen if the packet rate is
@@ -391,18 +391,18 @@ static bool i40e_set_new_dynamic_itr(struct i40e_ring_container *rc)
         */
        switch (new_latency_range) {
        case I40E_LOWEST_LATENCY:
-               if (bytes_per_int > 10)
+               if (bytes_per_usec > 10)
                        new_latency_range = I40E_LOW_LATENCY;
                break;
        case I40E_LOW_LATENCY:
-               if (bytes_per_int > 20)
+               if (bytes_per_usec > 20)
                        new_latency_range = I40E_BULK_LATENCY;
-               else if (bytes_per_int <= 10)
+               else if (bytes_per_usec <= 10)
                        new_latency_range = I40E_LOWEST_LATENCY;
                break;
        case I40E_BULK_LATENCY:
        default:
-               if (bytes_per_int <= 20)
+               if (bytes_per_usec <= 20)
                        new_latency_range = I40E_LOW_LATENCY;
                break;
        }
@@ -1409,9 +1409,7 @@ static u32 i40e_buildreg_itr(const int type, const u16 itr)
        u32 val;
 
        val = I40E_VFINT_DYN_CTLN1_INTENA_MASK |
-             /* Don't clear PBA because that can cause lost interrupts that
-              * came in while we were cleaning/polling
-              */
+             I40E_VFINT_DYN_CTLN1_CLEARPBA_MASK |
              (type << I40E_VFINT_DYN_CTLN1_ITR_INDX_SHIFT) |
              (itr << I40E_VFINT_DYN_CTLN1_INTERVAL_SHIFT);