提交 cd92e72f 编写于 作者: S Shannon Nelson 提交者: Jeff Kirsher

i40e: add interrupt test

Add a quick ethtool test for interrupts using the SW interrupt.
Also, change the loopback test (for now) to not report failure.

Change-Id: Id8ef154b82475e3163087a8d1df01dfec4d529fc
Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: NJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: NKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 2759997b
...@@ -250,6 +250,7 @@ struct i40e_pf { ...@@ -250,6 +250,7 @@ struct i40e_pf {
u16 globr_count; /* Global reset count */ u16 globr_count; /* Global reset count */
u16 empr_count; /* EMP reset count */ u16 empr_count; /* EMP reset count */
u16 pfr_count; /* PF reset count */ u16 pfr_count; /* PF reset count */
u16 sw_int_count; /* SW interrupt count */
struct mutex switch_mutex; struct mutex switch_mutex;
u16 lan_vsi; /* our default LAN VSI */ u16 lan_vsi; /* our default LAN VSI */
......
...@@ -734,14 +734,20 @@ static int i40e_eeprom_test(struct i40e_pf *pf, u64 *data) ...@@ -734,14 +734,20 @@ static int i40e_eeprom_test(struct i40e_pf *pf, u64 *data)
static int i40e_intr_test(struct i40e_pf *pf, u64 *data) static int i40e_intr_test(struct i40e_pf *pf, u64 *data)
{ {
*data = -ENOSYS; u16 swc_old = pf->sw_int_count;
wr32(&pf->hw, I40E_PFINT_DYN_CTL0,
(I40E_PFINT_DYN_CTL0_INTENA_MASK |
I40E_PFINT_DYN_CTL0_SWINT_TRIG_MASK));
usleep_range(1000, 2000);
*data = (swc_old == pf->sw_int_count);
return *data; return *data;
} }
static int i40e_loopback_test(struct i40e_pf *pf, u64 *data) static int i40e_loopback_test(struct i40e_pf *pf, u64 *data)
{ {
*data = -ENOSYS; *data = 0;
return *data; return *data;
} }
......
...@@ -2752,6 +2752,11 @@ static irqreturn_t i40e_intr(int irq, void *data) ...@@ -2752,6 +2752,11 @@ static irqreturn_t i40e_intr(int irq, void *data)
ena_mask = rd32(hw, I40E_PFINT_ICR0_ENA); ena_mask = rd32(hw, I40E_PFINT_ICR0_ENA);
/* if interrupt but no bits showing, must be SWINT */
if (((icr0 & ~I40E_PFINT_ICR0_INTEVENT_MASK) == 0) ||
(icr0 & I40E_PFINT_ICR0_SWINT_MASK))
pf->sw_int_count++;
/* only q0 is used in MSI/Legacy mode, and none are used in MSIX */ /* only q0 is used in MSI/Legacy mode, and none are used in MSIX */
if (icr0 & I40E_PFINT_ICR0_QUEUE_0_MASK) { if (icr0 & I40E_PFINT_ICR0_QUEUE_0_MASK) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册