From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 4DD551C0B for ; Sun, 22 Apr 2018 23:13:23 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5A89C20A7B; Sun, 22 Apr 2018 17:13:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 22 Apr 2018 17:13:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=O5qahO8lZcVt55RHHI4tm7m1Qr a+idTM5hWSDe09aUE=; b=gg2upHC4oHv2olTvGpih2KyBh0pOqzIXu94mxTcu5w pKtXlQBMD+mvuoUrgBfhJiuzNRSLrBJZc1PlVbf88cKxF2fQfeRP2PATJS6TfqJK lLr6I+D59koVBF7lU3mN+gCmaE9LiD5V8IVzV7LC/sugvT4QZxqEoURXNAIKuF4l s= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=O5qahO 8lZcVt55RHHI4tm7m1Qra+idTM5hWSDe09aUE=; b=dkiRQ3gCCZ2MBRE/Az3LaN OGqy75Y6/tXEwIcS8I5zL+VJ2jB0r3ddGAJv/TllBsysCdu4R+l3hxorNTqnGZE2 ig1ng794BO5cbi8Ori5ZaZQ8YKlG/H4V/zHtDjmMkIocFO5bepIFcBs6E1HCFL0t v9OCcdUoem/JyUTf0eeRYjO161ChJYgJ8Q1MkNiQ19JwhdSf1X8qwAjbpyAsTl/n JgzfBEXukPNyJxtNcbNU5AEakx8VgIpbmnaZe+KuxrOcRv6Db7LcYIfEefGmA1Bz vr+FRg+ABGelRIxtUkhkdj21cAuI1jo7nOiJdvmxXiGul1P1IC3HU7GD1+zrXcgQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id A0ECCE4122; Sun, 22 Apr 2018 17:13:20 -0400 (EDT) From: Thomas Monjalon To: Zijie Pan Cc: dev@dpdk.org, remy.horton@intel.com, john.mcnamara@intel.com, marko.kovacevic@intel.com Date: Sun, 22 Apr 2018 23:13:19 +0200 Message-ID: <1548391.i1eeGyJj9X@xps> In-Reply-To: <1521630379-9554-2-git-send-email-zijie.pan@6wind.com> References: <1521193010-25050-1-git-send-email-zijie.pan@6wind.com> <1521630379-9554-1-git-send-email-zijie.pan@6wind.com> <1521630379-9554-2-git-send-email-zijie.pan@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom 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: , X-List-Received-Date: Sun, 22 Apr 2018 21:13:23 -0000 Hi Zijie, 21/03/2018 12:06, Zijie Pan: > +/* > + * Placeholder for accessing plugin module eeprom > + */ I think you missed a "*" to make it a doxygen comment. > +struct rte_dev_module_info { > + uint32_t type; /**< Type of plugin module eeprom */ > + uint32_t eeprom_len; /**< Length of plugin module eeprom */ > +}; > + > +/* EEPROM Standards for plug in modules */ > +#define ETH_MODULE_SFF_8079 0x1 > +#define ETH_MODULE_SFF_8079_LEN 256 > +#define ETH_MODULE_SFF_8472 0x2 > +#define ETH_MODULE_SFF_8472_LEN 512 > +#define ETH_MODULE_SFF_8636 0x3 > +#define ETH_MODULE_SFF_8636_LEN 256 > +#define ETH_MODULE_SFF_8436 0x4 > +#define ETH_MODULE_SFF_8436_LEN 256 Can you add a RTE_ prefix please? > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -4044,6 +4044,32 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, > } > > int > +rte_eth_dev_get_module_info(uint16_t port_id, > + struct rte_dev_module_info *modinfo) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev = &rte_eth_devices[port_id]; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_info, -ENOTSUP); > + return (*dev->dev_ops->get_module_info)(dev, modinfo); > +} > + > + int > +rte_eth_dev_get_module_eeprom(uint16_t port_id, > + struct rte_dev_eeprom_info *info) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + > + dev = &rte_eth_devices[port_id]; > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_module_eeprom, -ENOTSUP); > + return (*dev->dev_ops->get_module_eeprom)(dev, info); > +} > + > +int > rte_eth_dev_get_dcb_info(uint16_t port_id, Please move these new functions after other eeprom functions. > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > /** > + * Retrieve the type and size of plugin module EEPROM > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param modinfo > + * The type and size of plugin module EEPROM. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EIO) if device is removed. > + * - others depends on the specific operations implementation. > + */ > +int rte_eth_dev_get_module_info(uint16_t port_id, > + struct rte_dev_module_info *modinfo); > + > +/** > + * Retrieve the data of plugin module EEPROM > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param info > + * The template includes the plugin module EEPROM attributes, and the > + * buffer for return plugin module EEPROM data. > + * @return > + * - (0) if successful. > + * - (-ENOTSUP) if hardware doesn't support. > + * - (-ENODEV) if *port_id* invalid. > + * - (-EIO) if device is removed. > + * - others depends on the specific operations implementation. > + */ > +int rte_eth_dev_get_module_eeprom(uint16_t port_id, > + struct rte_dev_eeprom_info *info); Please add the usual EXPERIMENTAL warnings for the new functions. > --- a/lib/librte_ether/rte_ethdev_version.map > +++ b/lib/librte_ether/rte_ethdev_version.map > @@ -201,6 +201,8 @@ DPDK_18.02 { > global: > > rte_eth_dev_filter_ctrl; > + rte_eth_dev_get_module_info; > + rte_eth_dev_get_module_eeprom; As noticed by Ferruh, they should be experimental.