]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
ixgbe: cleanup IXGBE_DESC_UNUSED
[~andy/linux] / drivers / net / ethernet / intel / ixgbevf / ixgbevf.h
index 85c7560e237b54c16f1b8c7ac992c1d7a0c48232..8971e2d0a984d74055b788742190f9654fb5ac13 100644 (file)
@@ -40,6 +40,7 @@
 
 #ifdef CONFIG_NET_RX_BUSY_POLL
 #include <net/busy_poll.h>
+#define BP_EXTENDED_STATS
 #endif
 
 /* wrapper around a pointer to a socket buffer,
@@ -80,6 +81,11 @@ struct ixgbevf_ring {
        struct u64_stats_sync   syncp;
        u64 hw_csum_rx_error;
        u64 hw_csum_rx_good;
+#ifdef BP_EXTENDED_STATS
+       u64 bp_yields;
+       u64 bp_misses;
+       u64 bp_cleaned;
+#endif
 
        u16 head;
        u16 tail;
@@ -181,6 +187,9 @@ static inline bool ixgbevf_qv_lock_napi(struct ixgbevf_q_vector *q_vector)
                WARN_ON(q_vector->state & IXGBEVF_QV_STATE_NAPI);
                q_vector->state |= IXGBEVF_QV_STATE_NAPI_YIELD;
                rc = false;
+#ifdef BP_EXTENDED_STATS
+               q_vector->tx.ring->bp_yields++;
+#endif
        } else {
                /* we don't care if someone yielded */
                q_vector->state = IXGBEVF_QV_STATE_NAPI;
@@ -213,6 +222,9 @@ static inline bool ixgbevf_qv_lock_poll(struct ixgbevf_q_vector *q_vector)
        if ((q_vector->state & IXGBEVF_QV_LOCKED)) {
                q_vector->state |= IXGBEVF_QV_STATE_POLL_YIELD;
                rc = false;
+#ifdef BP_EXTENDED_STATS
+               q_vector->rx.ring->bp_yields++;
+#endif
        } else {
                /* preserve yield marks */
                q_vector->state |= IXGBEVF_QV_STATE_POLL;
@@ -274,9 +286,13 @@ static inline bool ixgbevf_qv_disable(struct ixgbevf_q_vector *q_vector)
        ((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8)
 #define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG
 
-#define IXGBE_DESC_UNUSED(R) \
-       ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \
-       (R)->next_to_clean - (R)->next_to_use - 1)
+static inline u16 ixgbevf_desc_unused(struct ixgbevf_ring *ring)
+{
+       u16 ntc = ring->next_to_clean;
+       u16 ntu = ring->next_to_use;
+
+       return ((ntc > ntu) ? 0 : ring->count) + ntc - ntu - 1;
+}
 
 #define IXGBEVF_RX_DESC(R, i)      \
        (&(((union ixgbe_adv_rx_desc *)((R)->desc))[i]))
@@ -349,7 +365,6 @@ struct ixgbevf_adapter {
        struct ixgbe_hw hw;
        u16 msg_enable;
        struct ixgbevf_hw_stats stats;
-       u64 zero_base;
        /* Interrupt Throttle Rate */
        u32 eitr_param;
 
@@ -358,6 +373,16 @@ struct ixgbevf_adapter {
        unsigned int tx_ring_count;
        unsigned int rx_ring_count;
 
+#ifdef BP_EXTENDED_STATS
+       u64 bp_rx_yields;
+       u64 bp_rx_cleaned;
+       u64 bp_rx_missed;
+
+       u64 bp_tx_yields;
+       u64 bp_tx_cleaned;
+       u64 bp_tx_missed;
+#endif
+
        u32 link_speed;
        bool link_up;