From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2A0CFB399 for ; Tue, 9 Sep 2014 09:17:21 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 09 Sep 2014 00:22:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,491,1406617200"; d="scan'208";a="588396348" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 09 Sep 2014 00:22:24 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s897MMql008898; Tue, 9 Sep 2014 15:22:22 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s897MKbn004543; Tue, 9 Sep 2014 15:22:22 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s897MK9Q004539; Tue, 9 Sep 2014 15:22:20 +0800 From: Helin Zhang To: dev@dpdk.org Date: Tue, 9 Sep 2014 15:21:39 +0800 Message-Id: <1410247299-4365-16-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1410247299-4365-1-git-send-email-helin.zhang@intel.com> References: <1410247299-4365-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH 15/15] i40e: support redefined struct of 'i40e_arq_event_info' X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Sep 2014 07:17:22 -0000 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 Reviewed-by: Chen Jing --- 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