From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id BDF4F2C39 for ; Wed, 25 Apr 2018 12:02:14 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id v15-v6so34605425wrm.10 for ; Wed, 25 Apr 2018 03:02:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a0XG3DMysn7urM2mgKss9E+oDRurwUeDaiO7pMeG1v8=; b=WI+ndHXZl0W+Mr4m0/5I51QWzxLg8S8FNGaregZaXTcH7QQhqboL0wXRHAEBUjLaev l6FXjMnENc/lLvTe2Oyfm/amUMt7fA5qv7Vf1tR2ZZszLxnU5lTsqfglswhdtqjutmxu lMYJkq8JwxYiAsvvwmX9ujetcMWKQj8CGRqXlY2Tqk05w6IrHhVbO4pELcsjWZreIv/0 Dz8UCW36BSRzrLktsNcMOhtu1chOzpz4nQU5oj+2J7H4cFwoaFhUN5QJj0uy6Lqy33DE EMoL4mf7Er2umQDNkEoS2TzKErzw5cudc2gx1y73l6a0R8AVx3J0clvPfgweB/woVJYF e77A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a0XG3DMysn7urM2mgKss9E+oDRurwUeDaiO7pMeG1v8=; b=NwdMiCfoiwVt5c3+smi8/kEVSU9viRzb7lBuDoG572bwTZIwynWAQqbNYGfyWUihR+ hT5jyQlK0BagxmsXatJBEd6BKNtcQJyXZ5VFZtjjyxUUckKQ+cj7+Zqew9R8xmYsTHl5 ylzH6L05Hqrd90RIJyHtc8SYW8bO1Er+rF/vNzDrddmGOVau1kEsEFsLU+ut85Dmjbej P7Iw4qmSCUwHqKlU/r4ibBtf3goGagNNieKmLGM0vuvlvmPspHutwdALrhN9lFyTDtq/ 8WATKed9BNLpPviFa7DPjx5jt75bpljH36Je4gBiFVQcA4xLWCFUQM6GGTHjM2ovEhi+ EW4g== X-Gm-Message-State: ALQs6tDJrQ6Rb5+7IzcFkQH6+5kxFiOKX5olSYNEnmqmYWwiMqXNfljH ki2wDMbyA8PnReb1PQb5coOkvFEhEMc= X-Google-Smtp-Source: AB8JxZrDYMFpZLwq+2atbUBj60kYfH6SJDWnujO+qok2+yadT+Ci/B9yE2YvFXSR5cvdlqXnyvOVRA== X-Received: by 2002:adf:a00d:: with SMTP id k13-v6mr4356067wrk.39.1524650534159; Wed, 25 Apr 2018 03:02:14 -0700 (PDT) Received: from cougar.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id n143sm14100363wmd.29.2018.04.25.03.02.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Apr 2018 03:02:13 -0700 (PDT) From: Zijie Pan To: dev@dpdk.org Cc: remy.horton@intel.com, ferruh.yigit@intel.com, thomas@monjalon.net Date: Wed, 25 Apr 2018 12:01:50 +0200 Message-Id: <1524650515-26659-1-git-send-email-zijie.pan@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1524647624-23005-1-git-send-email-zijie.pan@6wind.com> References: <1524647624-23005-1-git-send-email-zijie.pan@6wind.com> Subject: [dpdk-dev] [PATCH v6 0/5] get the information and data of 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: Wed, 25 Apr 2018 10:02:14 -0000 Add APIs to read information from the DPDK applictions. It can be used to dump the EEPROM of plugin modules (SFP+, QSFP, etc.). Two APIs are introduced to access eeprom: - rte_eth_dev_get_module_info - rte_eth_dev_get_module_eeprom Applications based on DPDK can dump eeprom by calling those two APIs. Then, each PMD has to implement these callbacks for e1000, ixgbe, i40e, etc. Patch for example/ethtool is used to test this function. It can get the raw data of eeprom. See below how both DPDK applications (ethtool) and Linux kernel are dumping the same eeprom of a same NIC. - Start example/ethtool: ./examples/ethtool/ethtool-app/x86_64-native-linuxapp-gcc/ethtool -c 0xf -n 4 --socket-mem 1024,0 -- -i EthApp> drvinfo Port 0 driver: net_ixgbe (ver: DPDK 18.05.0-rc0) firmware-version: 0x18b30001 bus-info: 0000:04:00.0 EthApp> module-eeprom [UINT16]: module-eeprom Dump plug-in module EEPROM to file EthApp> module-eeprom 0 my-module-eeprom.bin Total plug-in module EEPROM length: 512 bytes EthApp> quit - HexDump of this eeprom file: # xxd my-module-eeprom.bin 0000000: 0304 0710 0000 0100 0000 0006 6702 0000 ............g... 0000010: 0803 001e 4f45 4d20 2020 2020 2020 2020 ....OEM 0000020: 2020 2020 0000 1b21 5346 502d 3130 472d ...!SFP-10G- 0000030: 5352 2d49 5420 2020 4120 2020 0352 0024 SR-IT A .R.$ 0000040: 003a 0000 5751 3136 3034 3132 4131 3135 .:..WQ160412A115 0000050: 2020 2020 3135 3136 3130 2020 68fa 033b 151610 h..; 0000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000080: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000090: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000a0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000b0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000c0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000d0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000e0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000f0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000100: 5000 fb00 4b00 0000 8ca0 7530 88b8 7918 P...K.....u0..y. 0000110: 1d4c 01f4 1b58 03e8 3de9 03e8 2710 04eb .L...X..=...'... 0000120: 2710 0064 1f07 007e 0000 0000 0000 0000 '..d...~........ 0000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000140: 0000 0000 3f80 0000 0000 0000 0100 0000 ....?........... 0000150: 0100 0000 0100 0000 0100 0000 0000 002d ...............- 0000160: 2c59 810a 13c7 1752 0001 0000 0000 0200 ,Y.....R........ 0000170: 0040 0000 0040 0000 0000 0000 0000 0000 .@...@.......... 0000180: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000190: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001a0: ffff faff ffff ffff ffff ffff ffff ffff ................ 00001b0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001c0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001d0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001e0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001f0: ffff ffff ffff ffff 0003 0100 0000 0000 ................ - Rerun same dump using Linux's kernel ethtool. # ./install/sbin/dpdk-devbind --bind=ixgbe 04:00.0 # ethtool -m p2p1 raw on > meeprom-kernel.bin # xxd meeprom-kernel.bin 0000000: 0304 0710 0000 0100 0000 0006 6702 0000 ............g... 0000010: 0803 001e 4f45 4d20 2020 2020 2020 2020 ....OEM 0000020: 2020 2020 0000 1b21 5346 502d 3130 472d ...!SFP-10G- 0000030: 5352 2d49 5420 2020 4120 2020 0352 0024 SR-IT A .R.$ 0000040: 003a 0000 5751 3136 3034 3132 4131 3135 .:..WQ160412A115 0000050: 2020 2020 3135 3136 3130 2020 68fa 033b 151610 h..; 0000060: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000070: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000080: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000090: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000a0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000b0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000c0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000d0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000e0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00000f0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000100: 5000 fb00 4b00 0000 8ca0 7530 88b8 7918 P...K.....u0..y. 0000110: 1d4c 01f4 1b58 03e8 3de9 03e8 2710 04eb .L...X..=...'... 0000120: 2710 0064 1f07 007e 0000 0000 0000 0000 '..d...~........ 0000130: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0000140: 0000 0000 3f80 0000 0000 0000 0100 0000 ....?........... 0000150: 0100 0000 0100 0000 0100 0000 0000 002d ...............- 0000160: 2899 8146 0058 0001 0001 0000 0000 8200 (..F.X.......... 0000170: 0540 0000 0540 0000 0000 0000 0000 0000 .@...@.......... 0000180: ffff ffff ffff ffff ffff ffff ffff ffff ................ 0000190: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001a0: ffff faff ffff ffff ffff ffff ffff ffff ................ 00001b0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001c0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001d0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001e0: ffff ffff ffff ffff ffff ffff ffff ffff ................ 00001f0: ffff ffff ffff ffff 0003 0100 0000 0000 ................ Both DPDK's my-module-eeprom.bin and Kernel's meeprom-kernel.bin are the same. v2 changes: - Fix typo in features.rst. - Fix checkpatch warnings regarding long lines. - Update function pcmd_module_eeprom_callback(). v3 changes: - fix compilation when dpdk is compiled with shared libs. v4 changes: - add RTE_ prefix for the macros defined in rte_dev_info.h. - mark the new APIs as experimental. - some other minor fixes. v5 changes: - insert the new APIs in alphabetical order in rte_ethdev_version.map. v6 changes: - rename rte_dev_module_info as rte_eth_dev_module_info. Zijie Pan (5): ethdev: add access to eeprom examples/ethtool: add a new command module-eeprom net/ixgbe: add module EEPROM callbacks for ixgbe net/e1000: add module EEPROM callbacks for e1000 net/i40e: add module EEPROM callbacks for i40e doc/guides/nics/features.rst | 11 +++ doc/guides/sample_app_ug/ethtool.rst | 3 + drivers/net/e1000/base/e1000_phy.h | 8 ++ drivers/net/e1000/igb_ethdev.c | 86 ++++++++++++++++++ drivers/net/i40e/i40e_ethdev.c | 147 +++++++++++++++++++++++++++++++ drivers/net/ixgbe/ixgbe_ethdev.c | 79 +++++++++++++++++ examples/ethtool/ethtool-app/ethapp.c | 64 ++++++++++++++ examples/ethtool/lib/Makefile | 1 + examples/ethtool/lib/rte_ethtool.c | 30 +++++++ examples/ethtool/lib/rte_ethtool.h | 34 +++++++ lib/librte_ether/rte_dev_info.h | 18 ++++ lib/librte_ether/rte_ethdev.c | 26 ++++++ lib/librte_ether/rte_ethdev.h | 43 +++++++++ lib/librte_ether/rte_ethdev_core.h | 12 +++ lib/librte_ether/rte_ethdev_version.map | 2 + 15 files changed, 564 insertions(+) -- 1.7.10.4