From patchwork Mon Mar 27 06:17:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xing, Beilei" X-Patchwork-Id: 22423 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 389E0FA33; Mon, 27 Mar 2017 08:19:47 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CF593F969 for ; Mon, 27 Mar 2017 08:19:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1490595572; x=1522131572; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=MQI6/kJ10hEetna7DDzlEl7KSiS0/RdsYM+eStumz30=; b=XCeCbwdiQpibKvWkBvCPgt+JBRRUDLy6ABMYmFVv1T1EYgI0h2NHWYHJ 6y7MGw/TFvMhIftfZcHqfiWJ0hMwow==; Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2017 23:19:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.36,229,1486454400"; d="scan'208"; a="1147302493" Received: from unknown (HELO dpdk9.sh.intel.com) ([10.239.129.31]) by fmsmga002.fm.intel.com with ESMTP; 26 Mar 2017 23:19:30 -0700 From: Beilei Xing To: jingjing.wu@intel.com Cc: helin.zhang@intel.com, dev@dpdk.org Date: Mon, 27 Mar 2017 14:17:53 +0800 Message-Id: <1490595475-139869-4-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1490595475-139869-1-git-send-email-beilei.xing@intel.com> References: <1490350768-65006-1-git-send-email-beilei.xing@intel.com> <1490595475-139869-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH v5 3/5] net/i40e: add get all loaded profiles X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch is to add get all loaded profiles function. Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_ethdev.c | 28 ++++++++++++++++++++++++++++ drivers/net/i40e/rte_pmd_i40e.h | 12 ++++++++++++ drivers/net/i40e/rte_pmd_i40e_version.map | 1 + 3 files changed, 41 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 4589e98..50a4e01 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -11260,6 +11260,9 @@ rte_pmd_i40e_reset_vf_stats(uint8_t port, return 0; } +#define I40E_PROFILE_INFO_SIZE 48 +#define I40E_MAX_PROFILE_NUM 16 + static void i40e_generate_profile_info_sec(char *name, struct i40e_ppp_version *version, uint32_t track_id, uint8_t *profile_info_sec, @@ -11458,3 +11461,28 @@ rte_pmd_i40e_process_ppp_package(uint8_t port, uint8_t *buff, rte_free(profile_info_sec); return status; } + +int +rte_pmd_i40e_get_ppp_list(uint8_t port, uint8_t *buff, uint32_t size) +{ + struct rte_eth_dev *dev; + struct i40e_hw *hw; + enum i40e_status_code status = I40E_SUCCESS; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + + dev = &rte_eth_devices[port]; + + if (!is_device_supported(dev, &rte_i40e_pmd)) + return -ENOTSUP; + + if (size < (I40E_PROFILE_INFO_SIZE * I40E_MAX_PROFILE_NUM + 4)) + return -EINVAL; + + hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + status = i40e_aq_get_ppp_list(hw, (void *)buff, + size, 0, NULL); + + return status; +} diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index ac7a0e1..969d465 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -390,4 +390,16 @@ int rte_pmd_i40e_process_ppp_package(uint8_t port, uint8_t *buff, uint32_t size, enum rte_pmd_i40e_package_op op); +/** + * rte_pmd_i40e_get_ppp_list - Get loaded profile list + * @port: port id + * @buff: buffer for response + * @size: buffer size + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-EINVAL) if bad parameter. + */ +int rte_pmd_i40e_get_ppp_list(uint8_t port, uint8_t *buff, uint32_t size); + #endif /* _PMD_I40E_H_ */ diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map index 01c4a90..9808893 100644 --- a/drivers/net/i40e/rte_pmd_i40e_version.map +++ b/drivers/net/i40e/rte_pmd_i40e_version.map @@ -27,4 +27,5 @@ DPDK_17.05 { global: rte_pmd_i40e_process_ppp_package; + rte_pmd_i40e_get_ppp_list; };