]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e/i40evf: Add a stat to track how many times we have to do a force WB
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Wed, 21 Oct 2015 23:47:08 +0000 (19:47 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:33:19 +0000 (08:33 -0800)
Orabug: 22342532

When in NAPI with interrupts disabled, the HW needs to be forced to do a
write back on TX if the number of descriptors pending are less than a
cache line.

This stat helps keep track of how many times we get into this situation.

Change-ID: I76c1bcc7ebccd6bffcc5aa33bfe05f2fa1c9a984
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
(cherry picked from commit 164c9f54631beca4d174f306acdcaec2bdeef52e)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_txrx.h
drivers/net/ethernet/intel/i40evf/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.h

index 001612ded33efff4966fff108d8d5b2101709b9a..e8a80dd7dcc3ad5e90ed64baa21f2dff9935e464 100644 (file)
@@ -486,6 +486,7 @@ struct i40e_vsi {
        u32 tx_restart;
        u32 tx_busy;
        u64 tx_linearize;
+       u64 tx_force_wb;
        u32 rx_buf_failed;
        u32 rx_page_failed;
 
index 2dd25939e6849a08f9e472a36485734eb3e69c63..9d1e240fd52493401e4516da05418fc4c93684a0 100644 (file)
@@ -88,6 +88,7 @@ static const struct i40e_stats i40e_gstrings_misc_stats[] = {
        I40E_VSI_STAT("tx_broadcast", eth_stats.tx_broadcast),
        I40E_VSI_STAT("rx_unknown_protocol", eth_stats.rx_unknown_protocol),
        I40E_VSI_STAT("tx_linearize", tx_linearize),
+       I40E_VSI_STAT("tx_force_wb", tx_force_wb),
 };
 
 /* These PF_STATs might look like duplicates of some NETDEV_STATs,
index 02fe332d584d377a26d0e6a5433f27d8f09bb699..125b728821bede64205176f5052bad2e627db832 100644 (file)
@@ -881,6 +881,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
        u64 bytes, packets;
        unsigned int start;
        u64 tx_linearize;
+       u64 tx_force_wb;
        u64 rx_p, rx_b;
        u64 tx_p, tx_b;
        u16 q;
@@ -899,7 +900,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
         */
        rx_b = rx_p = 0;
        tx_b = tx_p = 0;
-       tx_restart = tx_busy = tx_linearize = 0;
+       tx_restart = tx_busy = tx_linearize = tx_force_wb = 0;
        rx_page = 0;
        rx_buf = 0;
        rcu_read_lock();
@@ -917,6 +918,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
                tx_restart += p->tx_stats.restart_queue;
                tx_busy += p->tx_stats.tx_busy;
                tx_linearize += p->tx_stats.tx_linearize;
+               tx_force_wb += p->tx_stats.tx_force_wb;
 
                /* Rx queue is part of the same block as Tx queue */
                p = &p[1];
@@ -934,6 +936,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)
        vsi->tx_restart = tx_restart;
        vsi->tx_busy = tx_busy;
        vsi->tx_linearize = tx_linearize;
+       vsi->tx_force_wb = tx_force_wb;
        vsi->rx_page_failed = rx_page;
        vsi->rx_buf_failed = rx_buf;
 
index f578c7e37fdd62995b0e87efbc7e6c627adb434f..957a6f03f7ad57801e7ea0ce5a96f7112f7e95bd 100644 (file)
@@ -1924,8 +1924,10 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)
        /* If work not completed, return budget and polling will return */
        if (!clean_complete) {
 tx_only:
-               if (arm_wb)
+               if (arm_wb) {
+                       q_vector->tx.ring[0].tx_stats.tx_force_wb++;
                        i40e_force_wb(vsi, q_vector);
+               }
                return budget;
        }
 
index 6779fb771d6af9b9c8fcf46fd56ccb498c2951e3..dccc1eb576f251060376e6eb09bca71c3a4f807f 100644 (file)
@@ -202,6 +202,7 @@ struct i40e_tx_queue_stats {
        u64 tx_busy;
        u64 tx_done_old;
        u64 tx_linearize;
+       u64 tx_force_wb;
 };
 
 struct i40e_rx_queue_stats {
index cce0231e152816747b93881c7152f1a002b77cee..6097a208e50db8977edbe9d346a087e7b842e23a 100644 (file)
@@ -1362,8 +1362,10 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)
        /* If work not completed, return budget and polling will return */
        if (!clean_complete) {
 tx_only:
-               if (arm_wb)
+               if (arm_wb) {
+                       q_vector->tx.ring[0].tx_stats.tx_force_wb++;
                        i40evf_force_wb(vsi, q_vector);
+               }
                return budget;
        }
 
index ebc1bf77f03606fb05312b2a5c84e788b92435cb..997b374e86af8612819bfe9eb060aefb215219b8 100644 (file)
@@ -201,6 +201,7 @@ struct i40e_tx_queue_stats {
        u64 tx_busy;
        u64 tx_done_old;
        u64 tx_linearize;
+       u64 tx_force_wb;
 };
 
 struct i40e_rx_queue_stats {