All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Patches to get the information and data of EEPROM
@ 2018-03-12  4:17 Zijie Pan
  2018-03-12  4:17 ` [PATCH 1/5] ethdev: add access to eeprom Zijie Pan
                   ` (6 more replies)
  0 siblings, 7 replies; 39+ messages in thread
From: Zijie Pan @ 2018-03-12  4:17 UTC (permalink / raw)
  To: dev

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 <port_id> <filename>
     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

# 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.

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  |    2 +
 drivers/net/e1000/base/e1000_phy.h    |    8 ++
 drivers/net/e1000/igb_ethdev.c        |   83 +++++++++++++++++++
 drivers/net/i40e/i40e_ethdev.c        |  141 +++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/ixgbe_ethdev.c      |   76 ++++++++++++++++++
 examples/ethtool/ethtool-app/ethapp.c |   61 ++++++++++++++
 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         |   35 ++++++++
 lib/librte_ether/rte_ethdev_core.h    |   12 +++
 13 files changed, 537 insertions(+)

-- 
1.7.10.4

^ permalink raw reply	[flat|nested] 39+ messages in thread
* Re: [PATCH v3 1/5] ethdev: add access to eeprom
@ 2018-04-20  9:06 Zijie Pan
  0 siblings, 0 replies; 39+ messages in thread
From: Zijie Pan @ 2018-04-20  9:06 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: remy.horton, john.mcnamara, marko.kovacevic, thomas

Hi Ferruh,

I will mark the new APIs as experimental, and sent out a v4 patchset.

Thanks & Regards,
Zijie
 
 
------------------ Original ------------------
From:  "Ferruh Yigit"<ferruh.yigit@intel.com>;
Date:  Thu, Apr 19, 2018 09:34 PM
To:  "Zijie Pan"<zijie.pan@6wind.com>; "dev"<dev@dpdk.org>; 
Cc:  "remy.horton"<remy.horton@intel.com>; "john.mcnamara"<john.mcnamara@intel.com>; "marko.kovacevic"<marko.kovacevic@intel.com>; "thomas"<thomas@monjalon.net>; 
Subject:  Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom

 
On 3/21/2018 11:06 AM, Zijie Pan wrote:
> --- 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;
>  
>  } DPDK_17.11;

New APIs needs to be experimental at least first release they are introduces,
can you please mark them as experimental?

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2018-04-25  8:31 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12  4:17 [PATCH 0/5] Patches to get the information and data of EEPROM Zijie Pan
2018-03-12  4:17 ` [PATCH 1/5] ethdev: add access to eeprom Zijie Pan
2018-03-13 14:51   ` Remy Horton
2018-03-16  9:38   ` [PATCH v2 " Zijie Pan
2018-03-16  9:59     ` Remy Horton
2018-03-12  4:17 ` [PATCH 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-03-13 14:46   ` Remy Horton
2018-03-16  9:41   ` [PATCH v2 " Zijie Pan
2018-03-16  9:59     ` Remy Horton
2018-03-12  4:17 ` [PATCH 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-03-13 14:46   ` Remy Horton
2018-03-16  9:42   ` [PATCH v2 " Zijie Pan
2018-03-16 10:08     ` Remy Horton
2018-03-12  4:17 ` [PATCH 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-03-16  9:42   ` [PATCH v2 " Zijie Pan
2018-03-12  4:17 ` [PATCH 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-03-16  9:42   ` [PATCH v2 " Zijie Pan
2018-03-13 15:19 ` [PATCH 0/5] Patches to get the information and data of EEPROM Remy Horton
2018-03-16  9:36 ` [PATCH v2 0/5] " Zijie Pan
2018-03-21 11:06   ` [PATCH v3 " Zijie Pan
2018-03-21 11:06     ` [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan
2018-04-19 13:34       ` Ferruh Yigit
2018-04-22 21:13       ` Thomas Monjalon
2018-03-21 11:06     ` [PATCH v3 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-03-21 11:06     ` [PATCH v3 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-03-21 11:06     ` [PATCH v3 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-03-21 11:06     ` [PATCH v3 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-04-19 13:36     ` [PATCH v3 0/5] get the information and data of EEPROM Ferruh Yigit
2018-04-19 14:17       ` Remy Horton
2018-04-24 10:17     ` [PATCH v4 " Zijie Pan
2018-04-24 10:17       ` [PATCH v4 1/5] ethdev: add access to eeprom Zijie Pan
2018-04-24 10:25         ` Thomas Monjalon
2018-04-25  8:21           ` Zijie Pan
2018-04-25  8:31             ` Thomas Monjalon
2018-04-24 10:17       ` [PATCH v4 2/5] examples/ethtool: add a new command module-eeprom Zijie Pan
2018-04-24 10:17       ` [PATCH v4 3/5] net/ixgbe: add module EEPROM callbacks for ixgbe Zijie Pan
2018-04-24 10:17       ` [PATCH v4 4/5] net/e1000: add module EEPROM callbacks for e1000 Zijie Pan
2018-04-24 10:17       ` [PATCH v4 5/5] net/i40e: add module EEPROM callbacks for i40e Zijie Pan
2018-04-20  9:06 [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.