* Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom
@ 2018-04-20 9:06 Zijie Pan
0 siblings, 0 replies; 4+ 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] 4+ messages in thread
* [dpdk-dev] [PATCH v2 0/5] get the information and data of EEPROM
@ 2018-03-16 9:36 Zijie Pan
2018-03-21 11:06 ` [dpdk-dev] [PATCH v3 " Zijie Pan
0 siblings, 1 reply; 4+ messages in thread
From: Zijie Pan @ 2018-03-16 9:36 UTC (permalink / raw)
To: dev; +Cc: remy.horton
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
- 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().
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 | 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/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, 552 insertions(+)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v3 0/5] get the information and data of EEPROM
2018-03-16 9:36 [dpdk-dev] [PATCH v2 0/5] get the information and data of EEPROM Zijie Pan
@ 2018-03-21 11:06 ` Zijie Pan
2018-03-21 11:06 ` [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan
0 siblings, 1 reply; 4+ messages in thread
From: Zijie Pan @ 2018-03-21 11:06 UTC (permalink / raw)
To: dev; +Cc: remy.horton
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
- 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.
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 | 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/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 +++
lib/librte_ether/rte_ethdev_version.map | 2 +
14 files changed, 554 insertions(+)
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom
2018-03-21 11:06 ` [dpdk-dev] [PATCH v3 " Zijie Pan
@ 2018-03-21 11:06 ` Zijie Pan
2018-04-19 13:34 ` Ferruh Yigit
2018-04-22 21:13 ` Thomas Monjalon
0 siblings, 2 replies; 4+ messages in thread
From: Zijie Pan @ 2018-03-21 11:06 UTC (permalink / raw)
To: dev; +Cc: remy.horton, john.mcnamara, marko.kovacevic, thomas
add new APIs:
- rte_eth_dev_get_module_info
- rte_eth_dev_get_module_eeprom
Signed-off-by: Zijie Pan <zijie.pan@6wind.com>
Acked-by: Remy Horton <remy.horton@intel.com>
---
Cc: remy.horton@intel.com
Cc: john.mcnamara@intel.com
Cc: marko.kovacevic@intel.com
Cc: thomas@monjalon.net
doc/guides/nics/features.rst | 11 ++++++++++
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 +++++++++++
lib/librte_ether/rte_ethdev_version.map | 2 ++
6 files changed, 104 insertions(+)
diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 1b4fb97..bb183e2 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -749,6 +749,17 @@ Supports getting/setting device eeprom data.
``rte_eth_dev_set_eeprom()``.
+.. _nic_features_module_eeprom_dump:
+
+Module EEPROM dump
+------------------
+
+Supports getting information and data of plugin module eeprom.
+
+* **[implements] eth_dev_ops**: ``get_module_info``, ``get_module_eeprom``.
+* **[related] API**: ``rte_eth_dev_get_module_info()``, ``rte_eth_dev_get_module_eeprom()``.
+
+
.. _nic_features_register_dump:
Registers dump
diff --git a/lib/librte_ether/rte_dev_info.h b/lib/librte_ether/rte_dev_info.h
index 6b68584..c15a0fa 100644
--- a/lib/librte_ether/rte_dev_info.h
+++ b/lib/librte_ether/rte_dev_info.h
@@ -28,4 +28,22 @@ struct rte_dev_eeprom_info {
uint32_t magic; /**< Device-specific key, such as device-id */
};
+/*
+ * 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 */
+};
+
+/* 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
+
#endif /* _RTE_DEV_INFO_H_ */
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0590f0c..b83643d 100644
--- 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,
struct rte_eth_dcb_info *dcb_info)
{
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 0361533..e8b1d94 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -3262,6 +3262,41 @@ int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
int rte_eth_dev_set_eeprom(uint16_t port_id, struct rte_dev_eeprom_info *info);
/**
+ * 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);
+
+/**
* Set the list of multicast addresses to filter on an Ethernet device.
*
* @param port_id
diff --git a/lib/librte_ether/rte_ethdev_core.h b/lib/librte_ether/rte_ethdev_core.h
index e5681e4..26b5704 100644
--- a/lib/librte_ether/rte_ethdev_core.h
+++ b/lib/librte_ether/rte_ethdev_core.h
@@ -337,6 +337,14 @@ typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
struct rte_dev_eeprom_info *info);
/**< @internal Program eeprom data */
+typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev,
+ struct rte_dev_module_info *modinfo);
+/**< @internal Retrieve type and size of plugin module eeprom */
+
+typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev,
+ struct rte_dev_eeprom_info *info);
+/**< @internal Retrieve plugin module eeprom data */
+
typedef int (*eth_l2_tunnel_eth_type_conf_t)
(struct rte_eth_dev *dev, struct rte_eth_l2_tunnel_conf *l2_tunnel);
/**< @internal config l2 tunnel ether type */
@@ -467,6 +475,10 @@ struct eth_dev_ops {
eth_get_eeprom_t get_eeprom; /**< Get eeprom data. */
eth_set_eeprom_t set_eeprom; /**< Set eeprom. */
+ eth_get_module_info_t get_module_info;
+ /** Get plugin module eeprom attribute. */
+ eth_get_module_eeprom_t get_module_eeprom;
+ /** Get plugin module eeprom data. */
eth_filter_ctrl_t filter_ctrl; /**< common filter control. */
diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map
index 87f02fb..ae4b2ad 100644
--- 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;
--
1.7.10.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom
2018-03-21 11:06 ` [dpdk-dev] [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
1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-04-19 13:34 UTC (permalink / raw)
To: Zijie Pan, dev; +Cc: remy.horton, john.mcnamara, marko.kovacevic, thomas
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] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom
2018-03-21 11:06 ` [dpdk-dev] [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
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-04-22 21:13 UTC (permalink / raw)
To: Zijie Pan; +Cc: dev, remy.horton, john.mcnamara, marko.kovacevic
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-22 21:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 9:06 [dpdk-dev] [PATCH v3 1/5] ethdev: add access to eeprom Zijie Pan
-- strict thread matches above, loose matches on Subject: below --
2018-03-16 9:36 [dpdk-dev] [PATCH v2 0/5] get the information and data of EEPROM Zijie Pan
2018-03-21 11:06 ` [dpdk-dev] [PATCH v3 " Zijie Pan
2018-03-21 11:06 ` [dpdk-dev] [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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).