]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
ixgbe: cleanup IXGBE_DESC_UNUSED
[~andy/linux] / drivers / net / ethernet / intel / ixgbevf / ixgbevf_main.c
index bc03a2ec5c0aef221147301ddba591e0b2346b32..038bfc8b76163049bf0f8c2e7b0fc4956ea6bce4 100644 (file)
@@ -251,7 +251,7 @@ static bool ixgbevf_clean_tx_irq(struct ixgbevf_q_vector *q_vector,
 
 #define TX_WAKE_THRESHOLD (DESC_NEEDED * 2)
        if (unlikely(count && netif_carrier_ok(tx_ring->netdev) &&
-                    (IXGBE_DESC_UNUSED(tx_ring) >= TX_WAKE_THRESHOLD))) {
+                    (ixgbevf_desc_unused(tx_ring) >= TX_WAKE_THRESHOLD))) {
                /* Make sure that anybody stopping the queue after this
                 * sees the new next_to_clean.
                 */
@@ -497,15 +497,6 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,
                total_rx_bytes += skb->len;
                total_rx_packets++;
 
-               /*
-                * Work around issue of some types of VM to VM loop back
-                * packets not getting split correctly
-                */
-               if (staterr & IXGBE_RXD_STAT_LB) {
-                       u32 header_fixup_len = skb_headlen(skb);
-                       if (header_fixup_len < 14)
-                               skb_push(skb, header_fixup_len);
-               }
                skb->protocol = eth_type_trans(skb, rx_ring->netdev);
 
                /* Workaround hardware that can't do proper VEPA multicast
@@ -538,7 +529,7 @@ next_desc:
        }
 
        rx_ring->next_to_clean = i;
-       cleaned_count = IXGBE_DESC_UNUSED(rx_ring);
+       cleaned_count = ixgbevf_desc_unused(rx_ring);
 
        if (cleaned_count)
                ixgbevf_alloc_rx_buffers(adapter, rx_ring, cleaned_count);
@@ -648,6 +639,12 @@ static int ixgbevf_busy_poll_recv(struct napi_struct *napi)
 
        ixgbevf_for_each_ring(ring, q_vector->rx) {
                found = ixgbevf_clean_rx_irq(q_vector, ring, 4);
+#ifdef BP_EXTENDED_STATS
+               if (found)
+                       ring->bp_cleaned += found;
+               else
+                       ring->bp_misses++;
+#endif
                if (found)
                        break;
        }
@@ -1383,7 +1380,7 @@ static void ixgbevf_configure(struct ixgbevf_adapter *adapter)
        for (i = 0; i < adapter->num_rx_queues; i++) {
                struct ixgbevf_ring *ring = &adapter->rx_ring[i];
                ixgbevf_alloc_rx_buffers(adapter, ring,
-                                        IXGBE_DESC_UNUSED(ring));
+                                        ixgbevf_desc_unused(ring));
        }
 }
 
@@ -3105,7 +3102,7 @@ static int __ixgbevf_maybe_stop_tx(struct ixgbevf_ring *tx_ring, int size)
 
        /* We need to check again in a case another CPU has just
         * made room available. */
-       if (likely(IXGBE_DESC_UNUSED(tx_ring) < size))
+       if (likely(ixgbevf_desc_unused(tx_ring) < size))
                return -EBUSY;
 
        /* A reprieve! - use start_queue because it doesn't call schedule */
@@ -3116,7 +3113,7 @@ static int __ixgbevf_maybe_stop_tx(struct ixgbevf_ring *tx_ring, int size)
 
 static int ixgbevf_maybe_stop_tx(struct ixgbevf_ring *tx_ring, int size)
 {
-       if (likely(IXGBE_DESC_UNUSED(tx_ring) >= size))
+       if (likely(ixgbevf_desc_unused(tx_ring) >= size))
                return 0;
        return __ixgbevf_maybe_stop_tx(tx_ring, size);
 }