[dpdk-dev,15/15] i40e: support redefined struct of 'i40e_arq_event_info'
diff mbox

Message ID 1410247299-4365-16-git-send-email-helin.zhang@intel.com
State Accepted, archived
Headers show

Commit Message

Helin Zhang Sept. 9, 2014, 7:21 a.m. UTC
As struct of 'i40e_arq_event_info' in share code has
been redefined, relevant changes in PMD are needed to
support that.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Chen Jing <jing.d.chen@intel.com>
---
 lib/librte_pmd_i40e/i40e_ethdev.c    |  8 +++-----
 lib/librte_pmd_i40e/i40e_ethdev_vf.c | 10 +++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

Patch
diff mbox

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c
index 4e65ca4..ed73389 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -3334,8 +3334,8 @@  i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
 	uint16_t pending, opcode;
 	int ret;
 
-	info.msg_size = I40E_AQ_BUF_SZ;
-	info.msg_buf = rte_zmalloc("msg_buffer", I40E_AQ_BUF_SZ, 0);
+	info.buf_len = I40E_AQ_BUF_SZ;
+	info.msg_buf = rte_zmalloc("msg_buffer", info.buf_len, 0);
 	if (!info.msg_buf) {
 		PMD_DRV_LOG(ERR, "Failed to allocate mem\n");
 		return;
@@ -3360,15 +3360,13 @@  i40e_dev_handle_aq_msg(struct rte_eth_dev *dev)
 					rte_le_to_cpu_32(info.desc.cookie_high),
 					rte_le_to_cpu_32(info.desc.cookie_low),
 					info.msg_buf,
-					info.msg_size);
+					info.msg_len);
 			break;
 		default:
 			PMD_DRV_LOG(ERR, "Request %u is not supported yet\n",
 				opcode);
 			break;
 		}
-		/* Reset the buffer after processing one */
-		info.msg_size = I40E_AQ_BUF_SZ;
 	}
 	rte_free(info.msg_buf);
 }
diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
index d8552ad..b639486 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c
@@ -78,6 +78,7 @@ 
 struct i40evf_arq_msg_info {
 	enum i40e_virtchnl_ops ops;
 	enum i40e_status_code result;
+	uint16_t buf_len;
 	uint16_t msg_len;
 	uint8_t *msg;
 };
@@ -226,8 +227,8 @@  i40evf_parse_pfmsg(struct i40e_vf *vf,
 	} else {
 		/* async reply msg on command issued by vf previously */
 		ret = I40EVF_MSG_CMD;
-		/* Actual buffer length read from PF */
-		data->msg_len = event->msg_size;
+		/* Actual data length read from PF */
+		data->msg_len = event->msg_len;
 	}
 	/* fill the ops and result to notify VF */
 	data->result = retval;
@@ -248,7 +249,7 @@  i40evf_read_pfmsg(struct rte_eth_dev *dev, struct i40evf_arq_msg_info *data)
 	int ret;
 	enum i40evf_aq_result result = I40EVF_MSG_NON;
 
-	event.msg_size = data->msg_len;
+	event.buf_len = data->buf_len;
 	event.msg_buf = data->msg;
 	ret = i40e_clean_arq_element(hw, &event, NULL);
 	/* Can't read any msg from adminQ */
@@ -282,7 +283,6 @@  i40evf_wait_cmd_done(struct rte_eth_dev *dev,
 		/* Delay some time first */
 		rte_delay_ms(ASQ_DELAY_MS);
 		ret = i40evf_read_pfmsg(dev, data);
-
 		if (ret == I40EVF_MSG_CMD)
 			return 0;
 		else if (ret == I40EVF_MSG_ERR)
@@ -332,7 +332,7 @@  i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)
 		return -1;
 
 	info.msg = args->out_buffer;
-	info.msg_len = args->out_size;
+	info.buf_len = args->out_size;
 	info.ops = I40E_VIRTCHNL_OP_UNKNOWN;
 	info.result = I40E_SUCCESS;