show the Rx/Tx burst description field
v2 cover show the Rx/Tx burst description field
v1: ABI breaking
http://mails.dpdk.org/archives/dev/2019-August/140916.html
https://patchwork.dpdk.org/patch/57624/ https://patchwork.dpdk.org/patch/57625/ https://patchwork.dpdk.org/patch/57626/
v2: add a simple trace API to export string type information, if the return value > 0, then valid information is generated.
testpmd> show rxq info 0 0
********************* Infos for port 0 , RX queue 0 *********************
Mempool: mbuf_pool_socket_0
RX prefetch threshold: 0
RX host threshold: 0
RX writeback threshold: 0
RX free threshold: 32
RX drop packets: off
RX deferred start: off
RX scattered packets: on
Number of RXDs: 1024
Burst description: AVX2 Vector Scattered Rx
testpmd> show txq info 0 0
********************* Infos for port 0 , TX queue 0 ********************* TX prefetch threshold: 32
TX host threshold: 0
TX writeback threshold: 0
TX RS threshold: 32
TX free threshold: 32
TX deferred start: off
Number of TXDs: 1024
Burst description: AVX2 Vector Tx
Haiyue Wang (3):
ethdev: add the API for getting trace information
testpmd: show the Rx/Tx burst description net/ice: support the Rx/Tx burst description trace
app/test-pmd/config.c | 12 +++++++++ drivers/net/ice/ice_ethdev.c | 26 +++++++++++++++++++ drivers/net/ice/ice_rxtx.c | 52 +++++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_rxtx.h | 4 +++ lib/librte_ethdev/rte_ethdev.c | 18 +++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 +++ 7 files changed, 125 insertions(+)
Signature · 1 line
2.7.4
RFC v2 1/3 ethdev: add the API for getting trace information
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)
lib/librte_ethdev/rte_ethdev.c +18 -0
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz); +} + +int rte_eth_dev_set_mc_addr_list (uint16_t port_id,struct rte_ether_addr *mc_addr_set,uint32_t nb_mc_addr)
lib/librte_ethdev/rte_ethdev.h +9 -0
@@ -404,6 +404,11 @@ struct rte_eth_rxmode {uint64_t offloads; }; +enum rte_eth_trace { +ETH_TRACE_RX_BURST , +ETH_TRACE_TX_BURST , +}; +/** * VLAN types to indicate if it is for single VLAN, inner VLAN or outer VLAN. * Note that single VLAN is treated the same as inner VLAN.
@@ -3556,6 +3561,10 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +/** * Retrieve device registers and register attributes (number of registers and * register size)
lib/librte_ethdev/rte_ethdev_core.h +4 -0
@@ -170,6 +170,9 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,typedef void (*eth_txq_info_get_t )(struct rte_eth_dev *dev,uint16_t tx_queue_id,struct rte_eth_txq_info *qinfo); +typedef int (*eth_trace_info_get_t )(struct rte_eth_dev *dev, +uint16_t queue_id,enum rte_eth_trace type,char *buf,int sz); +typedef int (*mtu_set_t )(struct rte_eth_dev *dev,uint16_t mtu);/**< @internal Set MTU. */
@@ -418,6 +421,7 @@ struct eth_dev_ops {eth_dev_infos_get_t dev_infos_get;/**< Get device info. */ eth_rxq_info_get_t rxq_info_get;/**< retrieve RX queue information. */ eth_txq_info_get_t txq_info_get;/**< retrieve TX queue information. */ +eth_trace_info_get_t trace_info_get;/**< Get trace. */ eth_fw_version_get_t fw_version_get;/**< Get firmware version. */ eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;/**< Get packet types supported and identified by device. */
Signature · 1 line
2.7.4
RFC v2 2/3 testpmd: show the Rx/Tx burst description
In reply to Haiyue WangAdd the 'Burst description' section into command 'show rxq|txq info <port_id> <queue_id>' to show the Rx/Tx burst description by new trace API.
--- app/test-pmd/config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
app/test-pmd/config.c +12 -0
@@ -330,6 +330,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id)struct rte_eth_rxq_info qinfo;int32_t rc;static const char *info_border ="*********************" ; +char burst_info[128 ]; rc =rte_eth_rx_queue_info_get (port_id, queue_id, &qinfo);if (rc !=0 ) {
@@ -354,6 +355,11 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id)printf ("\nRX scattered packets: %s" , (qinfo.scattered_rx !=0 ) ?"on" :"off" );printf ("\nNumber of RXDs: %hu" , qinfo.nb_desc); + +if (rte_eth_trace_info_get (port_id, queue_id,ETH_TRACE_RX_BURST , + burst_info,sizeof (burst_info)) >0 ) +printf ("\nBurst description: %s\n" , burst_info); +printf ("\n" ); }
@@ -363,6 +369,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id)struct rte_eth_txq_info qinfo;int32_t rc;static const char *info_border ="*********************" ; +char burst_info[128 ]; rc =rte_eth_tx_queue_info_get (port_id, queue_id, &qinfo);if (rc !=0 ) {
@@ -383,6 +390,11 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id)printf ("\nTX deferred start: %s" , (qinfo.conf.tx_deferred_start !=0 ) ?"on" :"off" );printf ("\nNumber of TXDs: %hu" , qinfo.nb_desc); + +if (rte_eth_trace_info_get (port_id, queue_id,ETH_TRACE_TX_BURST , + burst_info,sizeof (burst_info)) >0 ) +printf ("\nBurst description: %s\n" , burst_info); +printf ("\n" ); }
Signature · 1 line
2.7.4
RFC v2 3/3 net/ice: support the Rx/Tx burst description trace
In reply to Haiyue WangAccording to the Rx/Tx burst function that's selected currently, format the distinct burst description information for apps to query.
--- drivers/net/ice/ice_ethdev.c | 26 ++++++++++++++++++++++ drivers/net/ice/ice_rxtx.c | 52 ++++++++++++++++++++++++++++++++++++++++++++ drivers/net/ice/ice_rxtx.h | 4 ++++ 3 files changed, 82 insertions(+)
drivers/net/ice/ice_ethdev.c +26 -0
@@ -99,6 +99,8 @@ static int ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev, struct rte_eth_udp_tunnel *udp_tunnel);static int ice_dev_udp_tunnel_port_del (struct rte_eth_dev *dev,struct rte_eth_udp_tunnel *udp_tunnel); +static int ice_trace_info_get (struct rte_eth_dev *dev,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz);static const struct rte_pci_id pci_id_ice_map[] = { {RTE_PCI_DEVICE (ICE_INTEL_VENDOR_ID ,ICE_DEV_ID_E810C_BACKPLANE ) },
@@ -147,6 +149,7 @@ static const struct eth_dev_ops ice_eth_dev_ops = { .vlan_pvid_set = ice_vlan_pvid_set, .rxq_info_get = ice_rxq_info_get, .txq_info_get = ice_txq_info_get, + .trace_info_get = ice_trace_info_get, .get_eeprom_length = ice_get_eeprom_length, .get_eeprom = ice_get_eeprom, .rx_queue_count = ice_rx_queue_count,
@@ -3765,6 +3768,29 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, }static int +ice_trace_info_get (struct rte_eth_dev *dev,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +int ret; + +switch (type) { +case ETH_TRACE_RX_BURST : + ret =ice_rx_burst_info_get (dev, queue_id, buf, sz); +break ; + +case ETH_TRACE_TX_BURST : + ret =ice_tx_burst_info_get (dev, queue_id, buf, sz); +break ; + +default : + ret = -ENOTSUP ; +break ; + } + +return ret; +} + +static int ice_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,struct rte_pci_device *pci_dev) {
drivers/net/ice/ice_rxtx.c +52 -0
64 lines not on this page · raw message
drivers/net/ice/ice_rxtx.h +4 -0
@@ -188,4 +188,8 @@ uint16_t ice_recv_scattered_pkts_vec_avx2(void *rx_queue, uint16_t nb_pkts);uint16_t ice_xmit_pkts_vec_avx2 (void *tx_queue,struct rte_mbuf **tx_pkts,uint16_t nb_pkts); +int ice_rx_burst_info_get (struct rte_eth_dev *dev,uint16_t queue_id, +char *buf,int sz); +int ice_tx_burst_info_get (struct rte_eth_dev *dev,uint16_t queue_id, +char *buf,int sz);#endif /* _ICE_RXTX_H_ */
Signature · 1 line
2.7.4
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Haiyue WangQuoted 23 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +5
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +struct rte_eth_dev *dev; +
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 10 lines
lib/librte_ethdev/rte_ethdev.c +10
-0+RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);
What if queueid is out of bounds?
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
Why not just keep it in the log like it is now?
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +
You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 37 lines
-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Tuesday, August 13, 2019 11:25
To: Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 27 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +9
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ;
Quoted 8 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 6 lines
lib/librte_ethdev/rte_ethdev.c +6
-0+ + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Some trace may not need queueid, so skip it check here, make it a little flexible.
Quoted 5 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
Why not just keep it in the log like it is now?
Yes, log is good now (but need run with extra options). This patch works like run time debug tool, it identify the code running status. Not for automation now. But if we want this kind of things, hook the code point, define a rule to format the message.
Quoted 4 lines
Quoted 4 lines
lib/librte_ethdev/rte_ethdev.c +0
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo);
Quoted 8 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 4 lines
lib/librte_ethdev/rte_ethdev.c +4
-0+int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
./devtools/checkpatches.sh ?
3/3 valid patches
Quoted 5 lines
Also the API would have to be in the map file as well.
Docbook comments are also missing.
This is rough draft, so show the code firstly. ;-)
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Stephen HemmingerQuoted 7 lines · Stephen Hemminger
Quoted 3 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
int rte_eth_tx_queue_info_get(uint16_t
port_id,uint16_tqueue_id,struct rte_eth_txq_info *qinfo);
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.h int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 3567
Quoted 4 lines
lib/librte_ethdev/rte_ethdev.h +4
-0+int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
The checks in checkpatches.sh won't catch this. But trying to build dpdk as a shared library will.
Example: https://travis-ci.com/david-marchand/dpdk/jobs/224737320
Signature · 1 line
David Marchand
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 24 lines
-----Original Message-----
From: David Marchand [mailto:[email protected]]
Sent: Tuesday, August 13, 2019 17:58
To: Stephen Hemminger <[email protected]>; Wang, Haiyue <[email protected]>
Cc: dev <[email protected]>; Neil Horman <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Stephen Hemminger
Quoted 3 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
int rte_eth_tx_queue_info_get(uint16_t
port_id,uint16_tqueue_id,struct rte_eth_txq_info *qinfo);Quoted 7 lines
lib/librte_ethdev/rte_ethdev.h int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 3567
Quoted 4 lines
lib/librte_ethdev/rte_ethdev.h +4
-0+int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Quoted 6 lines
The checks in
checkpatches.shwon't catch this. But trying to build dpdk as a shared library will.Example: https://travis-ci.com/david-marchand/dpdk/jobs/224737320
Got it, thanks for sharing, just for a quick RFC, missed something in detail for making an API.
Quoted 2 lines
--
David Marchand
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Stephen HemmingerQuoted 39 lines · Stephen Hemminger
Quoted 23 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +5
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +struct rte_eth_dev *dev; +lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 10 lines
lib/librte_ethdev/rte_ethdev.c +10
-0+RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
Quoted 21 lines
Why not just keep it in the log like it is now?
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Stephen HemmingerQuoted 39 lines · Stephen Hemminger
Quoted 23 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +5
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz) +{ +struct rte_eth_dev *dev; +lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 10 lines
lib/librte_ethdev/rte_ethdev.c +10
-0+RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 4 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
Why not just keep it in the log like it is now?
I agree that strings are not the way to capture this kind of information.
The reason for doing this work, is that consuming software like FD.io VPP find it useful to provide the user the ability to display debug information (show hardware) - including what PMD is actually doing the work under the covers, as different PMD configurations can yield dramatically different performance.
Quoted 19 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 8 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ray KinsellaQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }
Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)
Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?
Quoted 22 lines
Quoted 22 lines
Why not just keep it in the log like it is now?
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?
#define RX_SCALAR (1ULL < 0)
#define RX_VECTOR_AVX2 ...
...
#define RX_SCATTER ...
#define RX_BULK_ALLOC
#define TX_SCALAR
#define TX_VECTOR_AVX2 ..
...
#define TX_SIMPLE
struct rte_pkt_burst_info {
bool per_queue_support; /* Per queue has each rx/tx burst setting */
uint64_t burst_infos;
};int
rte_eth_pkt_burst_info_get(uint16_t port_id, bool is_rx, uint16_t queue_id,
struct rte_pkt_burst_info *pbinfo)
Rx/Tx shares the 64 bits definition, but return according to 'is_rx'. Application can call with 'queue_id = 0' firstly, if the Rx/Tx queue support queue level burst setting, then 'per_queue_support = true', then it can iterate to get the burst info with different 'queue_id', of course, the 'per_queue_support = true' will be returned always.
How about this ?
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Why not just keep it in the log like it is now?
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.
Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...
What about having RX_VECTOR value, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVEC
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Quoted 7 lines
...
#defineRX_SCATTER...
#defineRX_BULK_ALLOC
#defineTX_SCALAR
#defineTX_VECTOR_AVX2..
...
#defineTX_SIMPLE
And what about implementing these as 'enum' instead of defines?
Quoted 4 lines
struct rte_pkt_burst_info {
bool per_queue_support; /* Per queue has each rx/tx burst setting */
uint64_t burst_infos;'infos' can be wrong linguistically, I think better to stick to 'info'
Quoted 5 lines
};
int
rte_eth_pkt_burst_info_get(uint16_tport_id, boolis_rx,uint16_tqueue_id,
structrte_pkt_burst_info*pbinfo)
Naming is the hard ;) I am not sure about 'burst_info' as well, I think they are exactly "burst mode function types" that recv/send burst of packets. It feels like it will provide information about all the burst mode related things like burst size etc.. but this is only for the function type. And suggestion is welcome :)
Quoted 2 lines
Rx/Tx shares the 64 bits definition, but return according to '
is_rx'.
Why 'is_rx' required, is it because 'per_queue_support' field? If so I think better to add Rx and Tx version of it and drop the 'is_rx' from the API.
Quoted 4 lines
Application can call with '
queue_id= 0' firstly, if the Rx/Tx queue support queue level burst setting, then 'per_queue_support= true', then it can iterate to get the burst info with different 'queue_id', of course, the 'per_queue_support= true' will be returned always.
I am not sure if that is what you meant but there shouldn't be any special behavior for "queue_id = 0", for the devices that doesn't support queue level, they can send same value for each queue with "per_queue_support = false"
An application iterating the over queues can use same API without worrying the 'per_queue_support' value, for the application that assumes the burst mode function should be same for the port may want to verify this in advance by checking the 'per_queue_support' value.
Quoted 27 lines
How about this ?
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Why not just keep it in the log like it is now?
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
Quoted 7 lines
lib/librte_ethdev/rte_ethdev.c +4
-0int rte_eth_tx_queue_info_get (uint16_t port_id,uint16_t queue_id,struct rte_eth_txq_info *qinfo); +int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz); +You didn't run checkpatch, otherwise you would have seen complaints about not listing API as experimental.
Also the API would have to be in the map file as well.
Docbook comments are also missing.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVEC
Quoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 87 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVEC
Quoted 8 lines
Quoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 97 lines · Ferruh Yigit
Quoted 87 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 8 lines
Quoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the RX_VECTOR and TX_VECTOR together, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?
I renamed the definitions to try to make things clear.
enum rte_eth_burst_mode_option {
BURST_SCALAR = (1 << 0),
BURST_VECTOR = (1 << 1),
BURST_VECTOR_MODE_MASK = (0x3F << 2),
BURST_ALTIVEC = (1 << 2),
BURST_NEON = (2 << 2),
BURST_SSE = (3 << 2),
BURST_AVX2 = (4 << 2),
BURST_AVX512 = (5 << 2),
BURST_SCATTERED = (1 << 8),
BURST_BULK_ALLOC = (1 << 9),
BURST_NORMAL = (1 << 10),
BURST_SIMPLE = (1 << 11),
};/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */
struct rte_eth_burst_mode {
uint32_t per_queue_support:1; /**< Support to set per queue burst */
uint64_t options;
};And three APIs:
1.__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
struct rte_eth_burst_mode *mode);
2.__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
struct rte_eth_burst_mode *mode);
3.__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
uint16_t queue_id, struct rte_eth_burst_mode *mode);
struct eth_dev_ops {
...
eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */
eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */
...
};Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 120 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option {
BURST_SCALAR = (1 << 0),
BURST_VECTOR = (1 << 1),
BURST_VECTOR_MODE_MASK = (0x3F << 2),
BURST_ALTIVEC = (1 << 2),
BURST_NEON = (2 << 2),
BURST_SSE = (3 << 2),
BURST_AVX2 = (4 << 2),
BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX = 2 BURST_VECTOR_MODE_SIZE = 4 BURST_VECTOR_MODE_MASK =
((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode = (options & BURST_VECTOR_MODE_MASK) >> BURST_VECTOR_MODE_IDX
if (vector_mode == 0) // BURST_SSE if (vector_mode == 1) // BURST_AVX2 if (vector_mode == 2) // BURST_AVX512 if (vector_mode == 3) // BURST_NEON
....
Can any vector mode be combination of above, if not why use bitfields?
Quoted 4 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),
Not sure about this one, what is the difference between scalar?
Quoted 24 lines
BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };And three APIs:
1.
__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);2.
__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,
Quoted 6 lines
struct rte_eth_burst_mode *mode);3.
__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);
What about 'rte_eth_burst_mode_name()' ?
Quoted 14 lines
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct
rte_eth_dev*dev,uint16_t queue_id, struct rte_eth_burst_mode *mode);struct eth_dev_ops { ... eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ ... };
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 149 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 120 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDX
Quoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;
Then *get* like this, since we reserve the bit group.
static voidburst_mode_options_display(uint64_t options)
{
uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK;
uint64_t opt;
options &= ~BURST_VECTOR_MODE_MASK;
for (opt = 1; options != 0; opt <<= 1, options >>= 1) {
if (!(options & 1))
continue;
printf(" %s", rte_eth_burst_mode_option_name(opt));
if (opt == BURST_VECTOR)
printf("(%s)",
rte_eth_burst_mode_option_name(vec_mode));
}
}Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;
Quoted 26 lines
Quoted 26 lines
BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };And three APIs:
1.
__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);2.
__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);
Quoted 7 lines
Quoted 4 lines
3.
__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);What about '
rte_eth_burst_mode_name()' ?
The "mode" scope is bigger than "mode_option", so I defined it as "_mode_option_name()".
struct rte_eth_burst_mode {
uint32_t per_queue_support:1; /**< Support to set per queue burst */
uint64_t options;
};Quoted 14 lines
Quoted 14 lines
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct
rte_eth_dev*dev,uint16_t queue_id, struct rte_eth_burst_mode *mode);struct eth_dev_ops { ... eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ ... };
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 183 lines · Haiyue
Quoted 149 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 120 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;
Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt));
if (opt == BURST_VECTOR)
printf("(%s)",
rte_eth_burst_mode_option_name(vec_mode));
}
}I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Quoted 8 lines
Extract it from the function name and the debug message.
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;
What is the difference between 'BURST_SCALAR' & "BURST_SCALAR | BURST_NORMAL" ?
btw, for actual implementation please add 'RTE_ETH_' prefix.
Quoted 35 lines
Quoted 27 lines
Quoted 27 lines
BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };And three APIs:
1.
__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);2.
__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);Quoted 7 lines
Quoted 4 lines
3.
__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);What about '
rte_eth_burst_mode_name()' ?
Quoted 7 lines
The "mode" scope is bigger than "
mode_option", so I defined it as "_mode_option_name()".struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };
Agreed the scope is bigger in implementation, but "burst mode option name" is same as "burst mode name" for user, so removing it may make easier for user. But since the API is generating name from 'options' variable, instead of directly from the port, OK to keep API name as you suggested.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct
rte_eth_dev*dev,uint16_t queue_id, struct rte_eth_burst_mode *mode);struct eth_dev_ops { ... eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ ... };
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 201 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 168 lines
Quoted 134 lines
Quoted 113 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
Quoted 13 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt)); if (opt == BURST_VECTOR) printf("(%s)", rte_eth_burst_mode_option_name(vec_mode)); } }
Quoted 4 lines
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.
"BURST_VECTOR_MODE_MASK = (0x3F << 2)" has reserved 63 non-zero bits on position 2 ~ 7. Then from bit 8, a new definition: BURST_SCATTERED = (1 << 8).
"using with value saves bits" -- Sorry, I didn't get the point. :-( vector_mode = (options & BURST_VECTOR_MODE_MASK) >> BURST_VECTOR_MODE_IDX
From above, 'vector_mode's bits are from 'options' bits stream, how to save bits ? In my understanding, this is some kind of more-bit-field, not each-bit-field.
I defined them together, so can quick check the vector type, like (options & BURST_VECTOR_MODE_MASK) == BURST_NEON.
Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
Quoted 8 lines
Quoted 6 lines
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;What is the difference between '
BURST_SCALAR' & "BURST_SCALAR|BURST_NORMAL" ?
IMO, "SCALAR" should be "non-Vector" ? Like "BURST_VECTOR" will append with "SSE/AVX2" etc, "SCALAR" will append with other option bits. "Normal" is just handing the Descriptor one by one as *normal*. As I said, I got this name idea from the original log to try cover the right burst behaviors. :)
Quoted 3 lines
btw, for actual implementation please add '
RTE_ETH_' prefix.
Got it, will add them.
Quoted 64 lines
Quoted 35 lines
Quoted 27 lines
Quoted 27 lines
BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };And three APIs:
1.
__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);2.
__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);Quoted 7 lines
Quoted 4 lines
3.
__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);What about '
rte_eth_burst_mode_name()' ?Quoted 7 lines
The "mode" scope is bigger than "
mode_option", so I defined it as "_mode_option_name()".struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };Agreed the scope is bigger in implementation, but "burst mode option name" is same as "burst mode name" for user, so removing it may make easier for user. But since the API is generating name from 'options' variable, instead of directly from the port, OK to keep API name as you suggested.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct
rte_eth_dev*dev,uint16_t queue_id, struct rte_eth_burst_mode *mode);struct eth_dev_ops { ... eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ ... };
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 151 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 127 lines
Quoted 127 lines
Quoted 102 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
Quoted 13 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXif (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
Quoted 7 lines
Quoted 2 lines
}
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.
I think I understand your 'value saves bits' concern now:
What you mentioned value such as 1, 2, 3 has been *shifted* as new options: (1 << 2), (2 << 2), (3 << 2). The *shifted* value seems be easily for using, like, you don't need to re-define another enum like enum ...vector_mode { SSE, AVX2 } for accessing. And we can extract the vector mode easy: options & BURST_VECTOR_MODE_MASK, no need to shift right again for getting the pure number. And for displaying name, it also should be consistent:
... case RTE_ETH_BURST_VECTOR: return "Vector"; case RTE_ETH_BURST_ALTIVEC: return "AltiVec"; case RTE_ETH_BURST_NEON: return "Neon";
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 236 lines · Haiyue
Quoted 201 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 168 lines
Quoted 134 lines
Quoted 113 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}Quoted 3 lines
Quoted 3 lines
int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt)); if (opt == BURST_VECTOR) printf("(%s)", rte_eth_burst_mode_option_name(vec_mode)); } }Quoted 4 lines
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes."
BURST_VECTOR_MODE_MASK= (0x3F<< 2)" has reserved 63 non-zero bits on position 2 ~ 7. Then from bit 8, a new definition:BURST_SCATTERED= (1 << 8)."using with value saves bits" -- Sorry, I didn't get the point. :-(
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXFrom above, 'vector_mode's bits are from 'options' bits stream, how to save bits ? In my understanding, this is some kind of more-bit-field, not each-bit-field.
I defined them together, so can quick check the vector type, like (options &
BURST_VECTOR_MODE_MASK) ==BURST_NEON.Quoted 18 lines
Quoted 17 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;
Quoted 6 lines
Quoted 1 line
What is the difference between '
BURST_SCALAR' & "BURST_SCALAR|BURST_NORMAL" ?IMO, "SCALAR" should be "non-Vector" ? Like "
BURST_VECTOR" will append with "SSE/AVX2" etc, "SCALAR" will append with other option bits. "Normal" is just handing the Descriptor one by one as *normal*. As I said, I got this name idea from the original log to try cover the right burst behaviors. :)
Why using an additional flag to say there is not additional feature. If mbuf bulk alloc supported it is: SCALAR | BULK_ALLOC if scattered packets supported it is: SCALAR | SCATTERED If no additional feature supported, why not just SCALAR ?
Quoted 71 lines
Quoted 4 lines
btw, for actual implementation please add '
RTE_ETH_' prefix.Got it, will add them.
Quoted 64 lines
Quoted 35 lines
Quoted 27 lines
Quoted 27 lines
BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };And three APIs:
1.
__rte_experimental
int rte_eth_rx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);2.
__rte_experimental
int rte_eth_tx_burst_mode_get(uint16_tport_id,uint16_tqueue_id,struct rte_eth_burst_mode *mode);Quoted 7 lines
Quoted 4 lines
3.
__rte_experimental
const char *rte_eth_burst_mode_option_name(uint64_t option);What about '
rte_eth_burst_mode_name()' ?Quoted 7 lines
The "mode" scope is bigger than "
mode_option", so I defined it as "_mode_option_name()".struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options; };Agreed the scope is bigger in implementation, but "burst mode option name" is same as "burst mode name" for user, so removing it may make easier for user. But since the API is generating name from 'options' variable, instead of directly from the port, OK to keep API name as you suggested.
Quoted 16 lines
Quoted 15 lines
Quoted 15 lines
PMD two ops:
typedef void (*eth_burst_mode_get_t)(struct
rte_eth_dev*dev,uint16_t queue_id, struct rte_eth_burst_mode *mode);struct eth_dev_ops { ... eth_burst_mode_get_t rx_burst_mode_get; /**< Get RX burst mode */ eth_burst_mode_get_t tx_burst_mode_get; /**< Get TX burst mode */ ... };
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 167 lines · Haiyue
Quoted 151 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 127 lines
Quoted 127 lines
Quoted 102 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}Quoted 3 lines
Quoted 3 lines
int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXif (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEONQuoted 7 lines
Quoted 2 lines
}
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.I think I understand your 'value saves bits' concern now:
What you mentioned value such as 1, 2, 3 has been *shifted* as new options: (1 << 2), (2 << 2), (3 << 2). The *shifted* value seems be easily for using, like, you don't need to re-define another enum like enum ...vector_mode { SSE, AVX2 } for accessing. And we can extract the vector mode easy: options &
BURST_VECTOR_MODE_MASK, no need to shift right again for getting the pure number. And for displaying name, it also should be consistent:
Quoted 5 lines
... case RTE_ETH_BURST_VECTOR: return "Vector"; case RTE_ETH_BURST_ALTIVEC: return "AltiVec"; case RTE_ETH_BURST_NEON: return "Neon";
Yep, this is what I was suggesting, agree that bitwise is a little easier, and specially after having separate Rx/Tx APIs there are enough room in the variable, so ok with your suggestion.
But please reserve some additional room future vectorisation modes, I would say overall 14 would be good, so first word can be for modes.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 137 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2), BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10), BURST_SIMPLE = (1 << 11), };
Quoted 8 lines
/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */struct rte_eth_burst_mode { uint32_t per_queue_support:1; /**< Support to set per queue burst */ uint64_t options;
We are using first 32bits just to detect the queue level support, what do you think converting this into a field in 'rte_eth_burst_mode_option' and use 'options' fields, so we will fit into 64 bit.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 251 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:00
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 236 lines · Haiyue
Quoted 201 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 168 lines
Quoted 134 lines
Quoted 113 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 26 lines · Ray Kinsella
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 21 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt)); if (opt == BURST_VECTOR) printf("(%s)", rte_eth_burst_mode_option_name(vec_mode)); } }Quoted 4 lines
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes."
BURST_VECTOR_MODE_MASK= (0x3F<< 2)" has reserved 63 non-zero bits on position 2 ~ 7. Then from bit 8, a new definition:BURST_SCATTERED= (1 << 8)."using with value saves bits" -- Sorry, I didn't get the point. :-(
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXFrom above, 'vector_mode's bits are from 'options' bits stream, how to save bits ? In my understanding, this is some kind of more-bit-field, not each-bit-field.
I defined them together, so can quick check the vector type, like (options &
BURST_VECTOR_MODE_MASK) ==BURST_NEON.Quoted 18 lines
Quoted 17 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;Quoted 6 lines
Quoted 1 line
What is the difference between '
BURST_SCALAR' & "BURST_SCALAR|BURST_NORMAL" ?IMO, "SCALAR" should be "non-Vector" ? Like "
BURST_VECTOR" will append with "SSE/AVX2" etc, "SCALAR" will append with other option bits. "Normal" is just handing the Descriptor one by one as *normal*. As I said, I got this name idea from the original log to try cover the right burst behaviors. :)
Quoted 5 lines
Why using an additional flag to say there is not additional feature. If mbuf bulk alloc supported it is: SCALAR |
BULK_ALLOCif scattered packets supported it is: SCALAR | SCATTERED If no additional feature supported, why not just SCALAR ?
If I understand correctly, removed the unnecessary 'BURST_NORMAL' ?
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 181 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:03
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 167 lines · Haiyue
Quoted 151 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 127 lines
Quoted 127 lines
Quoted 102 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 26 lines · Ray Kinsella
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 21 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXif (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEONQuoted 7 lines
Quoted 2 lines
}
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.I think I understand your 'value saves bits' concern now:
What you mentioned value such as 1, 2, 3 has been *shifted* as new options: (1 << 2), (2 << 2), (3 << 2). The *shifted* value seems be easily for using, like, you don't need to re-define another enum like enum ...vector_mode { SSE, AVX2 } for accessing. And we can extract the vector mode easy: options &
BURST_VECTOR_MODE_MASK, no need to shift right again for getting the pure number. And for displaying name, it also should be consistent:Quoted 5 lines
... case RTE_ETH_BURST_VECTOR: return "Vector"; case RTE_ETH_BURST_ALTIVEC: return "AltiVec"; case RTE_ETH_BURST_NEON: return "Neon";
Quoted 5 lines
Yep, this is what I was suggesting, agree that bitwise is a little easier, and specially after having separate Rx/Tx APIs there are enough room in the variable, so ok with your suggestion.
But please reserve some additional room future vectorisation modes, I would say overall 14 would be good, so first word can be for modes.
Got it, will change 4 bits for vector mode for saving the bit space.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 152 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 144 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2), BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10), BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */
structrte_eth_burst_mode{
uint32_tper_queue_support:1; /**< Support to set per queue burst */
Quoted 5 lines
Quoted 1 line
uint64_t options;We are using first 32bits just to detect the queue level support, what do you think converting this into a field in '
rte_eth_burst_mode_option' and use 'options' fields, so we will fit into 64 bit.
Yes, it's clear.
Then do we still use 'struct rte_eth_burst_mode' to hold one member "uint64_t options" ?
struct rte_eth_burst_mode {
uint64_t options;
};Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 251 lines · Haiyue
Quoted 251 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:00
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 242 lines · Haiyue
Quoted 201 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 168 lines
Quoted 134 lines
Quoted 113 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationOn 8/13/2019 1:51 PM, Ray Kinsella wrote:
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is
easier to extend the struct later if needed.+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find
something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration,
for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think
having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the
output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt)); if (opt == BURST_VECTOR) printf("(%s)", rte_eth_burst_mode_option_name(vec_mode)); } }Quoted 4 lines
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes."
BURST_VECTOR_MODE_MASK= (0x3F<< 2)" has reserved 63 non-zero bits on position 2 ~ 7. Then from bit 8, a new definition:BURST_SCATTERED= (1 << 8)."using with value saves bits" -- Sorry, I didn't get the point. :-(
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXFrom above, 'vector_mode's bits are from 'options' bits stream, how to save bits ? In my understanding, this is some kind of more-bit-field, not each-bit-field.
I defined them together, so can quick check the vector type, like (options &
BURST_VECTOR_MODE_MASK) ==BURST_NEON.Quoted 11 lines
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
Quoted 8 lines
Quoted 6 lines
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;What is the difference between '
BURST_SCALAR' & "BURST_SCALAR|BURST_NORMAL" ?IMO, "SCALAR" should be "non-Vector" ? Like "
BURST_VECTOR" will append with "SSE/AVX2" etc, "SCALAR" will append with other option bits. "Normal" is just handing the Descriptor one by one as *normal*. As I said, I got this name idea from the original log to try cover the right burst behaviors. :)
Quoted 8 lines
Quoted 5 lines
Why using an additional flag to say there is not additional feature. If mbuf bulk alloc supported it is: SCALAR |
BULK_ALLOCif scattered packets supported it is: SCALAR | SCATTERED If no additional feature supported, why not just SCALAR ?If I understand correctly, removed the unnecessary '
BURST_NORMAL' ?
Yes, that is what I suggest.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 158 lines · Haiyue
Quoted 152 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 144 lines · Haiyue
Thanks Ferruh, Bruce.
Quoted 106 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>--- lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++ lib/librte_ethdev/rte_ethdev.h | 9 +++++++++ lib/librte_ethdev/rte_ethdev_core.h | 4 ++++ 3 files changed, 31 insertions(+)lib/librte_ethdev/rte_ethdev.c +0
-0@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, }Quoted 3 lines
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4087
Quoted 3 lines
lib/librte_ethdev/rte_ethdev.c +2
-0int +rte_eth_trace_info_get (uint16_t port_id,uint16_t queue_id, +enum rte_eth_trace type,char *buf,int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
lib/librte_ethdev/rte_ethdev.c rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, · line 4100
Quoted 13 lines
lib/librte_ethdev/rte_ethdev.c +13
-0+{ +struct rte_eth_dev *dev; + +RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); + +if (buf ==NULL ) +return -EINVAL ; + + dev = &rte_eth_devices[port_id]; + +RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->trace_info_get, -ENOTSUP ); + +return dev->dev_ops->trace_info_get (dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2), BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10), BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */
structrte_eth_burst_mode{
uint32_tper_queue_support:1; /**< Support to set per queue burst */Quoted 5 lines
Quoted 1 line
uint64_t options;We are using first 32bits just to detect the queue level support, what do you think converting this into a field in '
rte_eth_burst_mode_option' and use 'options' fields, so we will fit into 64 bit.
Quoted 7 lines
Yes, it's clear.
Then do we still use 'structrte_eth_burst_mode' to hold one member "uint64_toptions" ?struct rte_eth_burst_mode { uint64_t options; };
I suggest keeping the struct, for the possibility of future changes.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 265 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:34
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 257 lines · Haiyue
Quoted 256 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:00
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 236 lines · Haiyue
Quoted 201 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 168 lines
Quoted 134 lines
Quoted 113 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 76 lines · Haiyue
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationOn 8/13/2019 1:51 PM, Ray Kinsella wrote:
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is
easier to extend the struct later if needed.+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find
something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration,
for clarity of the API don't return capability or not datapath related config.Also this information not always supported in queue level, what do you think
having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the
output is for queue or port, or this can be another bitfield, what do you think?#define RX_SCALAR (1ULL < 0)
#define RX_VECTOR_AVX2 ...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXQuoted 8 lines
if (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEON
....Can any vector mode be combination of above, if not why use bitfields?
I use it as this to *set* ...
else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2 | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec_avx2) options = BURST_VECTOR | BURST_AVX2; else if (pkt_burst == i40e_recv_scattered_pkts_vec) options = BURST_VECTOR | BURST_SSE | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_vec) options = BURST_VECTOR | BURST_SSE;Then *get* like this, since we reserve the bit group.
static void
burst_mode_options_display(uint64_t options){ uint64_t vec_mode = options & BURST_VECTOR_MODE_MASK; uint64_t opt; options &= ~BURST_VECTOR_MODE_MASK; for (opt = 1; options != 0; opt <<= 1, options >>= 1) { if (!(options & 1)) continue;Quoted 8 lines
printf(" %s", rte_eth_burst_mode_option_name(opt)); if (opt == BURST_VECTOR) printf("(%s)", rte_eth_burst_mode_option_name(vec_mode)); } }Quoted 4 lines
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes."
BURST_VECTOR_MODE_MASK= (0x3F<< 2)" has reserved 63 non-zero bits on position 2 ~ 7. Then from bit 8, a new definition:BURST_SCATTERED= (1 << 8)."using with value saves bits" -- Sorry, I didn't get the point. :-(
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXFrom above, 'vector_mode's bits are from 'options' bits stream, how to save bits ? In my understanding, this is some kind of more-bit-field, not each-bit-field.
I defined them together, so can quick check the vector type, like (options &
BURST_VECTOR_MODE_MASK) ==BURST_NEON.Quoted 18 lines
Quoted 17 lines
Quoted 8 lines
Quoted 5 lines
BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10),Not sure about this one, what is the difference between scalar?
Extract it from the function name and the debug message.
if (pkt_burst == i40e_recv_scattered_pkts) options = BURST_SCALAR | BURST_SCATTERED; else if (pkt_burst == i40e_recv_pkts_bulk_alloc) options = BURST_SCALAR | BURST_BULK_ALLOC; else if (pkt_burst == i40e_recv_pkts) options = BURST_SCALAR | BURST_NORMAL;Quoted 6 lines
Quoted 1 line
What is the difference between '
BURST_SCALAR' & "BURST_SCALAR|BURST_NORMAL" ?IMO, "SCALAR" should be "non-Vector" ? Like "
BURST_VECTOR" will append with "SSE/AVX2" etc, "SCALAR" will append with other option bits. "Normal" is just handing the Descriptor one by one as *normal*. As I said, I got this name idea from the original log to try cover the right burst behaviors. :)Why using an additional flag to say there is not additional feature. If mbuf bulk alloc supported it is: SCALAR |
BULK_ALLOCif scattered packets supported it is: SCALAR | SCATTERED If no additional feature supported, why not just SCALAR ?
Quoted 4 lines
Quoted 2 lines
If I understand correctly, removed the unnecessary '
BURST_NORMAL' ?Yes, that is what I suggest.
Got it, the code is clean now.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Wang, HaiyueQuoted 181 lines · Haiyue
Quoted 181 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:03
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 172 lines · Haiyue
Quoted 151 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 127 lines
Quoted 127 lines
Quoted 102 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationOn 8/13/2019 1:51 PM, Ray Kinsella wrote:
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is
easier to extend the struct later if needed.+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find
something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration,
for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think
having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the
output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXif (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEONQuoted 7 lines
Quoted 2 lines
}
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.I think I understand your 'value saves bits' concern now:
What you mentioned value such as 1, 2, 3 has been *shifted* as new options: (1 << 2), (2 << 2), (3 << 2). The *shifted* value seems be easily for using, like, you don't need to re-define another enum like enum ...vector_mode { SSE, AVX2 } for accessing. And we can extract the vector mode easy: options &
BURST_VECTOR_MODE_MASK, no need to shift right again for getting the pure number. And for displaying name, it also should be consistent:... case RTE_ETH_BURST_VECTOR: return "Vector"; case RTE_ETH_BURST_ALTIVEC: return "AltiVec"; case RTE_ETH_BURST_NEON: return "Neon";
Quoted 8 lines
Quoted 5 lines
Yep, this is what I was suggesting, agree that bitwise is a little easier, and specially after having separate Rx/Tx APIs there are enough room in the variable, so ok with your suggestion.
But please reserve some additional room future vectorisation modes, I would say overall 14 would be good, so first word can be for modes.Got it, will change 4 bits for vector mode for saving the bit space.
Please keep as you suggested, as bitfiled for simplicity, it looks like there is already enough space.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 170 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:35
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 146 lines
Quoted 137 lines
Quoted 137 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 68 lines · Haiyue
Quoted 68 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 23 lines · Ray Kinsella
Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is easier to extend the struct later if needed.
Quoted 16 lines
Quoted 16 lines
Quoted 13 lines
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration, for clarity of the API don't return capability or not datapath related config.Quoted 8 lines
Quoted 5 lines
Also this information not always supported in queue level, what do you think having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the output is for queue or port, or this can be another bitfield, what do you think?#define
RX_SCALAR(1ULL < 0)
#defineRX_VECTOR_AVX2...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 6 lines
Quoted 4 lines
vector width can be an option too, no objection there. But this is only for current configuration, so it can be a combination, we have now 5 types and allocating space for 16.
correction: it can *not* be a combination
I think we can merge the
RX_VECTORandTX_VECTORtogether, use 6 bits for vector mode detail. And for vector width, the SSE, NEON name should indicates it ?I renamed the definitions to try to make things clear.
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2), BURST_SCATTERED = (1 << 8), BURST_BULK_ALLOC = (1 << 9), BURST_NORMAL = (1 << 10), BURST_SIMPLE = (1 << 11), };/**
* Ethernet device RX/TX queue packet burst mode information structure.
* Used to retrieve information about packet burst mode setting. */
structrte_eth_burst_mode{
uint32_tper_queue_support:1; /**< Support to set per queue burst */Quoted 5 lines
Quoted 1 line
uint64_t options;We are using first 32bits just to detect the queue level support, what do you think converting this into a field in '
rte_eth_burst_mode_option' and use 'options' fields, so we will fit into 64 bit.Yes, it's clear.
Then do we still use 'structrte_eth_burst_mode' to hold one member "uint64_toptions" ?
Quoted 6 lines
Quoted 4 lines
struct rte_eth_burst_mode { uint64_t options; };I suggest keeping the struct, for the possibility of future changes.
OK.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ferruh YigitQuoted 195 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:36
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 187 lines · Haiyue
Quoted 186 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 23:03
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 167 lines · Haiyue
Quoted 151 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 17:15
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 7 lines · Haiyue
Quoted 7 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, September 10, 2019 16:07
To: Wang, Haiyue <[email protected]>; Richardson, Bruce <[email protected]>
Cc: Ray Kinsella <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 8 lines
Quoted 8 lines · Haiyue
Quoted 7 lines
Thanks Ferruh, Bruce.
Quoted 5 lines
-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, September 9, 2019 21:18
To: Richardson, Bruce <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Ray Kinsella <[email protected]>; [email protected]; Sun,Chenmin
Quoted 127 lines
Quoted 127 lines
Quoted 102 lines
Quoted 101 lines
<[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationQuoted 97 lines · Ferruh Yigit
Quoted 95 lines · Bruce Richardson
Quoted 86 lines · Ferruh Yigit
Quoted 76 lines · Haiyue
-----Original Message-----
From: Yigit, Ferruh
Sent: Friday, September 6, 2019 22:22
To: Ray Kinsella <[email protected]>; Wang, Haiyue <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace informationOn 8/13/2019 1:51 PM, Ray Kinsella wrote:
On 13/08/2019 04:24, Stephen Hemminger wrote:
On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <[email protected]> wrote:Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.Signed-off-by: Haiyue Wang <[email protected]>
---
lib/librte_ethdev/rte_ethdev.c | 18 ++++++++++++++++++
lib/librte_ethdev/rte_ethdev.h | 9 +++++++++
lib/librte_ethdev/rte_ethdev_core.h | 4 ++++
3 files changed, 31 insertions(+)diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
}int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+ enum rte_eth_trace type, char *buf, int sz)Better to use struct as argument instead of individual variables because it is
easier to extend the struct later if needed.+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ if (buf == NULL)
+ return -EINVAL;
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+ return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);What if queueid is out of bounds?
The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.IMHO - this is much better implemented as a capability bitfield, that
can be queried.+1 to return the datapath capability as bitfield.
Also +1 to have a new API,
- I am not sure about the API name, 'rte_eth_trace_info_get()', can we find
something better instead of 'trace' there.
- I think we should limit this API only to get current datapath configuration,
for clarity of the API don't return capability or not datapath related config.Also this information not always supported in queue level, what do you think
having ability to get this information in port level,
like this API can return a struct, which may have a field that says if the
output is for queue or port, or this can be another bitfield, what do you think?#define RX_SCALAR (1ULL < 0)
#define RX_VECTOR_AVX2 ...What about having
RX_VECTORvalue, later another bit group for the details of the vectorization:
SSE
AVX2
AVX512
NEON
ALTIVECQuoted 3 lines
Since above options can exist together, what about using values for them instead of bitfields? Reserving 4 bits, 2^4 = 16, can be enough I think for long term.
Rather than having named vector types, we just need to worry about the ones for the current architecture. Therefore I'd suggest just using vector widths, one bit each for 16B, 32B and 64B vector support. For supporting multiple values, 16 combinations is not enough for all the possibilities.
Quoted 10 lines
enum rte_eth_burst_mode_option { BURST_SCALAR = (1 << 0), BURST_VECTOR = (1 << 1), BURST_VECTOR_MODE_MASK = (0x3F << 2), BURST_ALTIVEC = (1 << 2), BURST_NEON = (2 << 2), BURST_SSE = (3 << 2), BURST_AVX2 = (4 << 2), BURST_AVX512 = (5 << 2),Do we need to have bitfields for this, I was suggesting reserve 4 bits, bit 2-5 (inclusive) and use their value:
BURST_VECTOR_MODE_IDX= 2BURST_VECTOR_MODE_SIZE= 4BURST_VECTOR_MODE_MASK=((1 << BURST_VECTOR_MODE_SIZE) - 1) << BURST_VECTOR_MODE_IDX
vector_mode= (options &BURST_VECTOR_MODE_MASK) >>BURST_VECTOR_MODE_IDXif (
vector_mode== 0) //BURST_SSE
if (vector_mode== 1) //BURST_AVX2
if (vector_mode== 2) //BURST_AVX512
if (vector_mode== 3) //BURST_NEONQuoted 7 lines
Quoted 2 lines
}
I can see how you intended use it, only they don't need to be bitfield and using with value saves bits.
Also I think good to reserve some bits for future modes.I think I understand your 'value saves bits' concern now:
What you mentioned value such as 1, 2, 3 has been *shifted* as new options: (1 << 2), (2 << 2), (3 << 2). The *shifted* value seems be easily for using, like, you don't need to re-define another enum like enum ...vector_mode { SSE, AVX2 } for accessing. And we can extract the vector mode easy: options &
BURST_VECTOR_MODE_MASK, no need to shift right again for getting the pure number. And for displaying name, it also should be consistent:Quoted 5 lines
... case RTE_ETH_BURST_VECTOR: return "Vector"; case RTE_ETH_BURST_ALTIVEC: return "AltiVec"; case RTE_ETH_BURST_NEON: return "Neon";Yep, this is what I was suggesting, agree that bitwise is a little easier, and specially after having separate Rx/Tx APIs there are enough room in the variable, so ok with your suggestion.
But please reserve some additional room future vectorisation modes, I would say overall 14 would be good, so first word can be for modes.
Quoted 5 lines
Quoted 2 lines
Got it, will change 4 bits for vector mode for saving the bit space.
Please keep as you suggested, as bitfiled for simplicity, it looks like there is already enough space.
OK, remove the 'BURST_NORMAL' free one more bit.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
In reply to Ray Kinsella13/08/2019 14:51, Ray Kinsella:
Quoted 8 lines · Stephen Hemminger
Quoted 7 lines
Quoted 4 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>
[...]
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
int
lib/librte_ethdev/rte_ethdev.c +2
-0+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, + enum rte_eth_trace type, char *buf, int sz)
[...]
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
Now I see where this idea comes from.
Ray, Stephen, structuring shuch information is really a bad idea. The Rx/Tx functions are not like capabilities, they are full of smart tricks written by brillant engineers. Please do not try to put ideas in some categories. We will have more and more new types of optimization and ideas when the hardware will evolve.
And, more importantly, there is no need of automation or processing with this information.
Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
Quoted 35 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Sunday, October 27, 2019 00:46
To: Ray Kinsella <[email protected]>; [email protected]; Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]; Verplanke, Edwin <[email protected]>
Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information13/08/2019 14:51, Ray Kinsella:
Quoted 8 lines · Stephen Hemminger
Quoted 7 lines
Quoted 4 lines · On Tue, 13 Aug 2019 11:06:10 +0800 Haiyue Wang <[email protected]> wrote:
Enhance the PMD to support retrieving trace information like Rx/Tx burst selection etc.
Signed-off-by Haiyue Wang <[email protected]>[...]
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
int
lib/librte_ethdev/rte_ethdev.c +2
-0+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id, + enum rte_eth_trace type, char *buf, int sz)[...]
Quoted 5 lines
Quoted 2 lines
The bigger problem is that this information is like a log message and unstructured, which makes it device specific and useless for automation.
IMHO - this is much better implemented as a capability bitfield, that can be queried.
Now I see where this idea comes from.
Ray, Stephen, structuring shuch information is really a bad idea. The Rx/Tx functions are not like capabilities, they are full of smart tricks written by brillant engineers. Please do not try to put ideas in some categories. We will have more and more new types of optimization and ideas when the hardware will evolve.
Quoted 3 lines
And, more importantly, there is no need of automation or processing with this information.
The real requirement is from VPP CLI practice in production:
http://www.jimmdenton.com/vpp-1810-mellanox/
tx burst function: xxx
rx burst function: xxx
Their implementation requires *non static* rx/tx burst.
Yes, MLX uses an template compile for extreme performance.
----
* @param olx
* Configured offloads mask, presents the bits of MLX5_TXOFF_CONFIG_xxx * values. Should be static to take compile time static configuration * advantages.
*
* @return
* Number of packets successfully transmitted (<= pkts_n).
*/
static __rte_always_inline uint16_t mlx5_tx_burst_tmpl(struct mlx5_txq_data *restrict txq,
struct rte_mbuf **restrict pkts, uint16_t pkts_n,
unsigned int olx)
----
What we design is from another kind of thinking from CPU's point view:
commit 2e542da709371ee51d61d74c9a1b357ad34ae13e
Author: David Christensen <[email protected]> Date: Fri Aug 16 12:56:04 2019 -0500
net/mlx5: add Altivec Rx
Added mlx5_rxtx_vec_altivec.h which supports vectorized RX using Altivec vector code. Modified associated build files to use the new code.