]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Fix Adaptive ITR enabling
authorCarolyn Wyborny <carolyn.wyborny@intel.com>
Mon, 12 Dec 2016 23:44:12 +0000 (15:44 -0800)
committerJack Vogel <jack.vogel@oracle.com>
Sat, 10 Jun 2017 01:57:02 +0000 (18:57 -0700)
This patch fixes a bug introduced with the addition of the per queue
ITR feature support in ethtool.  With that addition, there were
functions added which converted the ITR settings to binary values.
The IS_ENABLED macros that run on those values check whether a bit
is set or not and with the value being binary, the bit check always
returned ITR disabled which prevents any updating of the ITR rate.
This patch fixes the problem by changing the functions to return the
current ITR value instead and renaming it to better reflect
its function.  These functions now provide a value which will be
accurately asessed and update the ITR as intended.

Change-ID: I14f1d088d052e27f652aaa3113e186415ddea1fc
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Orabug: 26132523
(cherry picked from commit 3c234c4709529298498b597bcff35f56ac866a99)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>
Reviewed-by: Brian Maly <brian.maly@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40evf/i40e_txrx.c

index 51a175ffa77485a0d0224c976e2a42b16e143450..c760694e97e1bdedcba250c4fe7bb2efd4330e55 100644 (file)
@@ -1860,14 +1860,14 @@ static u32 i40e_buildreg_itr(const int type, const u16 itr)
 
 /* a small macro to shorten up some long lines */
 #define INTREG I40E_PFINT_DYN_CTLN
-static inline int get_rx_itr_enabled(struct i40e_vsi *vsi, int idx)
+static inline int get_rx_itr(struct i40e_vsi *vsi, int idx)
 {
-       return !!(vsi->rx_rings[idx]->rx_itr_setting);
+       return vsi->rx_rings[idx]->rx_itr_setting;
 }
 
-static inline int get_tx_itr_enabled(struct i40e_vsi *vsi, int idx)
+static inline int get_tx_itr(struct i40e_vsi *vsi, int idx)
 {
-       return !!(vsi->tx_rings[idx]->tx_itr_setting);
+       return vsi->tx_rings[idx]->tx_itr_setting;
 }
 
 /**
@@ -1893,8 +1893,8 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
         */
        rxval = txval = i40e_buildreg_itr(I40E_ITR_NONE, 0);
 
-       rx_itr_setting = get_rx_itr_enabled(vsi, idx);
-       tx_itr_setting = get_tx_itr_enabled(vsi, idx);
+       rx_itr_setting = get_rx_itr(vsi, idx);
+       tx_itr_setting = get_tx_itr(vsi, idx);
 
        if (q_vector->itr_countdown > 0 ||
            (!ITR_IS_DYNAMIC(rx_itr_setting) &&
index dad75de6244ffcc9344e286e5d8754ca20236c22..aafceb11a28e838aee0c5464c584c8317198d07a 100644 (file)
@@ -1320,18 +1320,18 @@ static u32 i40e_buildreg_itr(const int type, const u16 itr)
 
 /* a small macro to shorten up some long lines */
 #define INTREG I40E_VFINT_DYN_CTLN1
-static inline int get_rx_itr_enabled(struct i40e_vsi *vsi, int idx)
+static inline int get_rx_itr(struct i40e_vsi *vsi, int idx)
 {
        struct i40evf_adapter *adapter = vsi->back;
 
-       return !!(adapter->rx_rings[idx].rx_itr_setting);
+       return adapter->rx_rings[idx].rx_itr_setting;
 }
 
-static inline int get_tx_itr_enabled(struct i40e_vsi *vsi, int idx)
+static inline int get_tx_itr(struct i40e_vsi *vsi, int idx)
 {
        struct i40evf_adapter *adapter = vsi->back;
 
-       return !!(adapter->tx_rings[idx].tx_itr_setting);
+       return adapter->tx_rings[idx].tx_itr_setting;
 }
 
 /**
@@ -1357,8 +1357,8 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,
         */
        rxval = txval = i40e_buildreg_itr(I40E_ITR_NONE, 0);
 
-       rx_itr_setting = get_rx_itr_enabled(vsi, idx);
-       tx_itr_setting = get_tx_itr_enabled(vsi, idx);
+       rx_itr_setting = get_rx_itr(vsi, idx);
+       tx_itr_setting = get_tx_itr(vsi, idx);
 
        if (q_vector->itr_countdown > 0 ||
            (!ITR_IS_DYNAMIC(rx_itr_setting) &&