Skip to content

Commit

Permalink
i40e: Fix ethtool offline diagnostic with netqueues
Browse files Browse the repository at this point in the history
Treat netqueues the same way we do virtual functions when someone wants to
run the ethtool offline diagnostic test.

Change-ID: Id48d2b933f1fd0db7be06305a93c6ebe3dc821f5
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Greg Rose authored and Jeff Kirsher committed Aug 26, 2015
1 parent 26cdc44 commit 510efb2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions drivers/net/ethernet/intel/i40e/i40e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,21 @@ static inline bool i40e_active_vfs(struct i40e_pf *pf)
return false;
}

static inline bool i40e_active_vmdqs(struct i40e_pf *pf)
{
struct i40e_vsi **vsi = pf->vsi;
int i;

for (i = 0; i < pf->num_alloc_vsi; i++) {
if (!vsi[i])
continue;
if (vsi[i]->type == I40E_VSI_VMDQ2)
return true;
}

return false;
}

static void i40e_diag_test(struct net_device *netdev,
struct ethtool_test *eth_test, u64 *data)
{
Expand All @@ -1572,9 +1587,9 @@ static void i40e_diag_test(struct net_device *netdev,

set_bit(__I40E_TESTING, &pf->state);

if (i40e_active_vfs(pf)) {
if (i40e_active_vfs(pf) || i40e_active_vmdqs(pf)) {
dev_warn(&pf->pdev->dev,
"Please take active VFS offline and restart the adapter before running NIC diagnostics\n");
"Please take active VFs and Netqueues offline and restart the adapter before running NIC diagnostics\n");
data[I40E_ETH_TEST_REG] = 1;
data[I40E_ETH_TEST_EEPROM] = 1;
data[I40E_ETH_TEST_INTR] = 1;
Expand Down

0 comments on commit 510efb2

Please sign in to comment.