From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 620052C37 for ; Wed, 4 Jan 2017 13:09:36 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 04 Jan 2017 04:09:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,459,1477983600"; d="scan'208";a="209520016" Received: from dpdk7.bj.intel.com ([172.16.182.76]) by fmsmga004.fm.intel.com with ESMTP; 04 Jan 2017 04:09:34 -0800 From: Qiming Yang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, helin.zhang@intel.com, remy.horton@intel.com, Qiming Yang Date: Wed, 4 Jan 2017 20:03:44 +0800 Message-Id: <1483531428-14481-2-git-send-email-qiming.yang@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483531428-14481-1-git-send-email-qiming.yang@intel.com> References: <1482841816-54143-1-git-send-email-qiming.yang@intel.com> <1483531428-14481-1-git-send-email-qiming.yang@intel.com> Subject: [dpdk-dev] [PATCH v4 1/5] ethdev: add firmware version get 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: Wed, 04 Jan 2017 12:09:36 -0000 This patch adds a new API 'rte_eth_dev_fw_version_get' for fetching firmware version related information by a given device. Signed-off-by: Qiming Yang Acked-by: Remy Horton --- v2 changes: * modified some comment statements. v3 changes: * change API, use rte_eth_dev_fw_info_get(uint8_t port_id, uint32_t *fw_major, uint32_t *fw_minor, uint32_t *fw_patch, uint32_t *etrack_id) instead of rte_eth_dev_fwver_get(uint8_t port_id, char *fw_version, int fw_length). Add statusment in /doc/guides/nics/features/default.ini and release_17_02.rst. v4 changes: * remove deprecation notice, rename API as rte_eth_dev_fw_version_get --- --- doc/guides/nics/features/default.ini | 1 + doc/guides/rel_notes/deprecation.rst | 4 ---- doc/guides/rel_notes/release_17_02.rst | 3 +++ lib/librte_ether/rte_ethdev.c | 14 ++++++++++++++ lib/librte_ether/rte_ethdev.h | 23 +++++++++++++++++++++++ lib/librte_ether/rte_ether_version.map | 1 + 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini index f1bf9bf..ae40d57 100644 --- a/doc/guides/nics/features/default.ini +++ b/doc/guides/nics/features/default.ini @@ -50,6 +50,7 @@ Timesync = Basic stats = Extended stats = Stats per queue = +FW version = EEPROM dump = Registers dump = Multiprocess aware = diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 1438c77..291e03d 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -30,10 +30,6 @@ Deprecation Notices ``nb_seg_max`` and ``nb_mtu_seg_max`` providing information about number of segments limit to be transmitted by device for TSO/non-TSO packets. -* In 17.02 ABI change is planned: the ``rte_eth_dev_info`` structure - will be extended with a new member ``fw_version`` in order to store - the NIC firmware version. - * ethdev: an API change is planned for 17.02 for the function ``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int`` instead of ``void`` and a fourth parameter ``void *ret_param`` will be added. diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst index 180af82..d6958d4 100644 --- a/doc/guides/rel_notes/release_17_02.rst +++ b/doc/guides/rel_notes/release_17_02.rst @@ -52,6 +52,9 @@ New Features See the :ref:`Generic flow API ` documentation for more information. +* **Added firmware version get API.** + Added a new function ``rte_eth_dev_fw_version_get()`` to fetch firmware version + related information by a given device. Resolved Issues --------------- diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 280f0db..a4b20b5 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1586,6 +1586,20 @@ rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id, uint16_t rx_queue_id, } void +rte_eth_dev_fw_version_get(uint8_t port_id, uint32_t *fw_major, + uint32_t *fw_minor, uint32_t *fw_patch, uint32_t *etrack_id) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_RET(port_id); + dev = &rte_eth_devices[port_id]; + + RTE_FUNC_PTR_OR_RET(*dev->dev_ops->fw_version_get); + (*dev->dev_ops->fw_version_get)(dev, fw_major, fw_minor, + fw_patch, etrack_id); +} + +void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info) { struct rte_eth_dev *dev; diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index fb51754..9c7efa1 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1150,6 +1150,11 @@ typedef uint32_t (*eth_rx_queue_count_t)(struct rte_eth_dev *dev, typedef int (*eth_rx_descriptor_done_t)(void *rxq, uint16_t offset); /**< @internal Check DD bit of specific RX descriptor */ +typedef void (*eth_fw_version_get_t)(struct rte_eth_dev *dev, + uint32_t *fw_major, uint32_t *fw_minor, + uint32_t *fw_patch, uint32_t *etrack_id); +/**< @internal Get firmware version information of an Ethernet device. */ + typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo); @@ -1457,6 +1462,7 @@ struct eth_dev_ops { eth_txq_info_get_t txq_info_get; /**< retrieve TX queue information. */ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get; /**< Get packet types supported and identified by device. */ + eth_fw_version_get_t fw_version_get; /**< Get firmware version. */ vlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */ vlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */ @@ -2395,6 +2401,23 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr); void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info); /** + * Retrieve the firmware version of a device. + * + * @param port_id + * The port identifier of the device. + * @param fw_major + * A pointer to store the major firmware version of a device. + * @param fw_minor + * A pointer to store the minor firmware version of a device. + * @param fw_patch + * A pointer to store the firmware patch number of a device. + * @param etrack_id + * A pointer to store the nvm version of a device. + */ +void rte_eth_dev_fw_version_get(uint8_t port_id, uint32_t *fw_major, + uint32_t *fw_minor, uint32_t *fw_patch, uint32_t *etrack_id); + +/** * Retrieve the supported packet types of an Ethernet device. * * When a packet type is announced as supported, it *must* be recognized by diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map index a021781..0cf94ed 100644 --- a/lib/librte_ether/rte_ether_version.map +++ b/lib/librte_ether/rte_ether_version.map @@ -151,6 +151,7 @@ DPDK_17.02 { global: _rte_eth_dev_reset; + rte_eth_dev_fw_version_get; rte_flow_create; rte_flow_destroy; rte_flow_flush; -- 2.7.4