i40evf: quoth the VF driver, Nevermore
authorMitch Williams <mitch.a.williams@intel.com>
Mon, 26 Oct 2015 23:44:38 +0000 (19:44 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 2 Dec 2015 06:54:53 +0000 (22:54 -0800)
If, upon a midnight dreary, the PF returns ERR_PARAM when the VF is
requesting resources, that's fatal. Either the firmware or NVM is badly,
badly misconfigured, or this VF has been disabled due to a previous VF
driver sending a bunch of bogus messages.

Either way, there is no recovery from this. Don't ponder weak and weary,
just quit.

Change-ID: I09d9f16cc4ee7fec3b57646a289d33838c1c5bf5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index 1cd5d5d1b6603efeab20af633524e13bf868ae4a..8476fc548f0f24ae8fa8a1520b3917658816ff55 100644 (file)
@@ -2435,6 +2435,14 @@ static void i40evf_init_task(struct work_struct *work)
                if (err == I40E_ERR_ADMIN_QUEUE_NO_WORK) {
                        err = i40evf_send_vf_config_msg(adapter);
                        goto err;
+               } else if (err == I40E_ERR_PARAM) {
+                       /* We only get ERR_PARAM if the device is in a very bad
+                        * state or if we've been disabled for previous bad
+                        * behavior. Either way, we're done now.
+                        */
+                       i40evf_shutdown_adminq(hw);
+                       dev_err(&pdev->dev, "Unable to get VF config due to PF error condition, not retrying\n");
+                       return;
                }
                if (err) {
                        dev_err(&pdev->dev, "Unable to get VF config (%d)\n",