DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 15/15] i40e: support redefined struct of 'i40e_arq_event_info'
Date: Tue,  9 Sep 2014 15:21:39 +0800	[thread overview]
Message-ID: <1410247299-4365-16-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1410247299-4365-1-git-send-email-helin.zhang@intel.com>

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(-)

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;
 
-- 
1.8.1.4

  parent reply	other threads:[~2014-09-09  7:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  7:21 [dpdk-dev] [PATCH 00/15] i40e base driver udpate Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 01/15] i40e: make the indentation more consistent in share code Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 02/15] i40e: support nvmupdate by default Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 03/15] i40e: remove useless code which was written for Solaris Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 04/15] i40e: remove test code for 'ethtool' Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 05/15] i40e: force a shifted '1' to be 'unsigned' Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 06/15] i40e: remove useless code for pre-boot support Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 07/15] i40e: Get rid of sparse warnings, and remove unreachable code Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 08/15] i40e: remove code which is for software validation only Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 09/15] i40e: remove code for TPH (TLP Processing Hints) Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 10/15] i40e: support of 10G base T Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 11/15] i40e: expose debug_write_register request Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 12/15] i40e: workaround of get_firmware_version, and enhancements Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 13/15] i40e: Use get_link_status to report FC settings Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 14/15] i40e: fix and enhancement in arq_event_info struct Helin Zhang
2014-09-09  7:21 ` Helin Zhang [this message]
2014-09-29  2:59 ` [dpdk-dev] [PATCH 00/15] i40e base driver update Xu, HuilongX
2014-10-07 16:31 ` [dpdk-dev] [PATCH 00/15] i40e base driver udpate Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410247299-4365-16-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).