i40evf: properly handle multiple AQ messages
authorMitch Williams <mitch.a.williams@intel.com>
Fri, 17 Oct 2014 03:14:42 +0000 (03:14 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 3 Nov 2014 09:23:24 +0000 (01:23 -0800)
When we receive an admin queue message, the msg_size field in the event
struct gets overwritten. Because of this, we need to reinit the field
each time we go through the loop. Without this we may receive truncated
messages due to the firmware thinking we have insufficient buffer size.

Change-ID: I21dcca5114d91365d731169965ce3ffec0e4a190
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Patrick Lu <patrick.lu@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40evf/i40evf_main.c

index dabe6a4220c62ec59fd898e233c74350498ff2f3..b2f01eb2f9e5442bc77557c2da366da86ab47c4d 100644 (file)
@@ -1647,10 +1647,8 @@ static void i40evf_adminq_task(struct work_struct *work)
                                           v_msg->v_retval, event.msg_buf,
                                           event.msg_size);
                if (pending != 0) {
-                       dev_info(&adapter->pdev->dev,
-                                "%s: ARQ: Pending events %d\n",
-                                __func__, pending);
                        memset(event.msg_buf, 0, I40EVF_MAX_AQ_BUF_SIZE);
+                       event.msg_size = I40EVF_MAX_AQ_BUF_SIZE;
                }
        } while (pending);