From: Mitch Williams Date: Thu, 28 Nov 2013 06:39:33 +0000 (+0000) Subject: i40e: reinit buffer size each time X-Git-Tag: next-20140107~61^2~15^2~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2f0191238d1d82c3cf0de350ac84e6e8d14aaf08;p=karo-tx-linux.git i40e: reinit buffer size each time When cleaning the ARQ, we must reinitialize the buffer size each time we go through the loop, because i40e_clean_arq_element returns the message length in the same field. Without this change, subsequent messages can be truncated to the length of the previous message. Change-Id: Ic9c32ff843faf0fc3196d21351a1c3a60c6158eb Signed-off-by: Mitch Williams Signed-off-by: Jesse Brandeburg Tested-by: Kavindya Deegala Tested-by: Sibai Li Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 94d0e4551765..719427755436 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -4493,12 +4493,12 @@ static void i40e_clean_adminq_subtask(struct i40e_pf *pf) if (!test_bit(__I40E_ADMINQ_EVENT_PENDING, &pf->state)) return; - event.msg_size = I40E_MAX_AQ_BUF_SIZE; event.msg_buf = kzalloc(event.msg_size, GFP_KERNEL); if (!event.msg_buf) return; do { + event.msg_size = I40E_MAX_AQ_BUF_SIZE; /* reinit each time */ ret = i40e_clean_arq_element(hw, &event, &pending); if (ret == I40E_ERR_ADMIN_QUEUE_NO_WORK) { dev_info(&pf->pdev->dev, "No ARQ event found\n");