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 E58E5374 for ; Tue, 24 Apr 2018 12:25:37 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 58800219BA; Tue, 24 Apr 2018 06:25:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 24 Apr 2018 06:25:37 -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=H9xlTWybaYAnb/k2lsyFyWLd30 /Q8iiReha1b/wCkYw=; b=K9iswIpQVqSc0oLg7OxkmUxiu0tN1CidVde4x7i7jX d1Savzy3AIeAKSzANG7Bw98uI+DF8wcyd4589XVjaTr8Mdf4efBfReWotVsCD34g xMyHu7/mrONOlaQ+p9KAmCCZT5jqE79WIM7qaH1KQT0/UE8B8IWs+BGaRmP1z/4Q k= 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=H9xlTW ybaYAnb/k2lsyFyWLd30/Q8iiReha1b/wCkYw=; b=O6nGAv2bGZWqXOS+NqjTOD igpfAVjkIS9cJjn1uuSbbZ6vXVf3Wtddco+ehBl00+mZDW5TcyD27zYdWSJQaN7j qocXwcC/9anneOtIWIN4EOYaU3Hv5X+v6IsLJ6amjwS6zXCYhm7JK8CCMb+zZucq ZuV9RvL8gYrYfD+o2xtUAfeXY9z+oxFkkNwBMFFSqyu3vd5YSSqskq9d77ohX0qH TO2Jh7aqrc8V37WRRW4GWfgE3fMh6jkqticugxO1UH8cPRPyVDei2YBuLrhf4MBH nZZUce5KPhFCLdGJo8poYyPGHwi+1oYfy3TevX9q36rRJgaQacBEDmfy1/zr+OYA == 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 3CE9BE4921; Tue, 24 Apr 2018 06:25:36 -0400 (EDT) From: Thomas Monjalon To: Zijie Pan Cc: dev@dpdk.org, remy.horton@intel.com, ferruh.yigit@intel.com, john.mcnamara@intel.com, marko.kovacevic@intel.com Date: Tue, 24 Apr 2018 12:25:35 +0200 Message-ID: <2623487.7NZ038SaYX@xps> In-Reply-To: <1524565044-8583-2-git-send-email-zijie.pan@6wind.com> References: <1521630379-9554-1-git-send-email-zijie.pan@6wind.com> <1524565044-8583-1-git-send-email-zijie.pan@6wind.com> <1524565044-8583-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 v4 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: Tue, 24 Apr 2018 10:25:38 -0000 24/04/2018 12:17, Zijie Pan: > +/** > + * Placeholder for accessing plugin module eeprom > + */ > +struct rte_dev_module_info { > + uint32_t type; /**< Type of plugin module eeprom */ > + uint32_t eeprom_len; /**< Length of plugin module eeprom */ > +}; I am not sure "plugin module" is descriptive enough. And I think the structure name should be rte_eth_dev_module_info to make clear that we are talking about NIC modules. Any better idea? > + > +/* EEPROM Standards for plug in modules */ > +#define RTE_ETH_MODULE_SFF_8079 0x1 > +#define RTE_ETH_MODULE_SFF_8079_LEN 256 > +#define RTE_ETH_MODULE_SFF_8472 0x2 > +#define RTE_ETH_MODULE_SFF_8472_LEN 512 > +#define RTE_ETH_MODULE_SFF_8636 0x3 > +#define RTE_ETH_MODULE_SFF_8636_LEN 256 > +#define RTE_ETH_MODULE_SFF_8436 0x4 > +#define RTE_ETH_MODULE_SFF_8436_LEN 256 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -3947,6 +3947,32 @@ int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx, > return eth_err(port_id, (*dev->dev_ops->set_eeprom)(dev, info)); > } > > +int __rte_experimental > +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_experimental > +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 this code after other EEPROM related functions. > --- a/lib/librte_ether/rte_ethdev_version.map > +++ b/lib/librte_ether/rte_ethdev_version.map > @@ -229,5 +229,7 @@ EXPERIMENTAL { > rte_mtr_policer_actions_update; > rte_mtr_stats_read; > rte_mtr_stats_update; > + rte_eth_dev_get_module_info; > + rte_eth_dev_get_module_eeprom; This must be inserted in alphabetical order. Thanks