summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/i40e/i40e_adminq.c
diff options
context:
space:
mode:
authorShannon Nelson <shannon.nelson@intel.com>2014-07-10 07:58:20 +0000
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-08-27 00:40:14 -0700
commitf905dd62be8853644357044a455f83e63e8c68ef (patch)
tree8c6f216fbeb85c6b7a66e6b513edb94f5620c7cd /drivers/net/ethernet/intel/i40e/i40e_adminq.c
parent7b592f6168e3091bc0868812b6a4a3126be5b82d (diff)
i40e/i40evf: add max buf len to aq debug print helper
There is at least one case in the Firmware API where the response to a command changes the buffer size field in the AQ descriptor to a larger number than what the request's buffer size started as. This is in addition to setting an error flag and is in order to tell the requester how much larger a buffer is required for the answer. We need to be sure not to use that number when dumping the contents of the data buffer because it can send us into the weeds and generate an invalid pointer exception. This patch adds a max buffer size parameter to the print helper to be sure the code knows when to stop. Change-ID: Ib84f7ed72140fe9d600086d8f2002fc5d8753092 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_adminq.c')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_adminq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
index b29c157b1f57..72f5d25a222f 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c
@@ -840,7 +840,8 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
/* bump the tail */
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n");
- i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff);
+ i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring,
+ buff, buff_size);
(hw->aq.asq.next_to_use)++;
if (hw->aq.asq.next_to_use == hw->aq.asq.count)
hw->aq.asq.next_to_use = 0;
@@ -891,7 +892,7 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
"AQTX: desc and buffer writeback:\n");
- i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff);
+ i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size);
/* update the error if time out occurred */
if ((!cmd_completed) &&
@@ -987,7 +988,8 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
e->msg_size);
i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n");
- i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf);
+ i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf,
+ hw->aq.arq_buf_size);
/* Restore the original datalen and buffer address in the desc,
* FW updates datalen to indicate the event message