From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 202FBA04A2; Tue, 5 Nov 2019 16:51:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E7A341C022; Tue, 5 Nov 2019 16:51:42 +0100 (CET) Received: from qrelay248.mxroute.com (qrelay248.mxroute.com [172.82.139.248]) by dpdk.org (Postfix) with ESMTP id C3F5E1BED7 for ; Tue, 5 Nov 2019 16:51:40 +0100 (CET) Received: from filter004.mxroute.com (unknown [116.203.155.46]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by qrelay248.mxroute.com (Postfix) with ESMTPS id F4042321932; Tue, 5 Nov 2019 10:51:39 -0500 (EST) Received: from galaxy.mxroute.com (unknown [23.92.70.113]) by filter004.mxroute.com (Postfix) with ESMTPS id 73F183E9F8; Tue, 5 Nov 2019 15:51:37 +0000 (UTC) Received: from [192.198.151.44] by galaxy.mxroute.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.91) (envelope-from ) id 1iS0vD-0004w2-Gr; Tue, 05 Nov 2019 10:39:07 -0500 To: Haiyue Wang , dev@dpdk.org, thomas@monjalon.net, jerinjacobk@gmail.com, ferruh.yigit@intel.com, arybchenko@solarflare.com, viacheslavo@mellanox.com, damarion@cisco.com, xiaolong.ye@intel.com, chenmin.sun@intel.com, ray.kinsella@intel.com, yu.y.liu@intel.com References: <20191104103920.64907-1-haiyue.wang@intel.com> From: Ray Kinsella Openpgp: preference=signencrypt Autocrypt: addr=mdr@ashroe.eu; keydata= mQINBFv8B3wBEAC+5ImcgbIvadt3axrTnt7Sxch3FsmWTTomXfB8YiuHT8KL8L/bFRQSL1f6 ASCHu3M89EjYazlY+vJUWLr0BhK5t/YI7bQzrOuYrl9K94vlLwzD19s/zB/g5YGGR5plJr0s JtJsF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 CWYBgAAKCRB0l1of+wIKm3KlD/9w/LOG5rtgtCUWPl4B3pZvGpNym6XdK8cop9saOnE85zWf u+sKWCrxNgYkYP7aZrYMPwqDvilxhbTsIJl5HhPgpTO1b0i+c0n1Tij3EElj5UCg3q8mEc17 c+5jRrY3oz77g7E3oPftAjaq1ybbXjY4K32o3JHFR6I8wX3m9wJZJe1+Y+UVrrjY65gZFxcA thNVnWKErarVQGjeNgHV4N1uF3pIx3kT1N4GSnxhoz4Bki91kvkbBhUgYfNflGURfZT3wIKK +d50jd7kqRouXUCzTdzmDh7jnYrcEFM4nvyaYu0JjSS5R672d9SK5LVIfWmoUGzqD4AVmUW8 pcv461+PXchuS8+zpltR9zajl72Q3ymlT4BTAQOlCWkD0snBoKNUB5d2EXPNV13nA0qlm4U2 GpROfJMQXjV6fyYRvttKYfM5xYKgRgtP0z5lTAbsjg9WFKq0Fndh7kUlmHjuAIwKIV4Tzo75 QO2zC0/NTaTjmrtiXhP+vkC4pcrOGNsbHuaqvsc/ZZ0siXyYsqbctj/sCd8ka2r94u+c7o4l BGaAm+FtwAfEAkXHu4y5Phuv2IRR+x1wTey1U1RaEPgN8xq0LQ1OitX4t2mQwjdPihZQBCnZ wzOrkbzlJMNrMKJpEgulmxAHmYJKgvZHXZXtLJSejFjR0GdHJcL5rwVOMWB8cg== Message-ID: <2e748288-88f3-59f9-8617-45b3358de9a0@ashroe.eu> Date: Tue, 5 Nov 2019 15:51:33 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191104103920.64907-1-haiyue.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH v2] ethdev: enhance the API for getting burst mode information X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 04/11/2019 10:39, Haiyue Wang wrote: > Change the type of burst mode information from bit field to free string > data, so that each PMD can describe the Rx/Tx busrt functions flexibly. > > Signed-off-by: Haiyue Wang > --- > > v2: - Drop the bit field for burst mode information handling. > > v1: - http://patchwork.dpdk.org/patch/62289/ > - http://patchwork.dpdk.org/patch/62290/ > - http://patchwork.dpdk.org/patch/62291/ > > app/test-pmd/config.c | 33 ++----- > doc/guides/nics/features.rst | 3 +- > doc/guides/rel_notes/release_19_11.rst | 2 - > drivers/net/i40e/i40e_rxtx.c | 121 ++++++++++++----------- > drivers/net/ice/ice_rxtx.c | 89 +++++++++-------- > lib/librte_ethdev/rte_ethdev.c | 35 ------- > lib/librte_ethdev/rte_ethdev.h | 43 ++------ > lib/librte_ethdev/rte_ethdev_version.map | 1 - > 8 files changed, 131 insertions(+), 196 deletions(-) > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index efe2812a8..b6039749c 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -350,21 +350,6 @@ nic_stats_mapping_display(portid_t port_id) > nic_stats_mapping_border, nic_stats_mapping_border); > } > > -static void > -burst_mode_options_display(uint64_t options) > -{ > - int offset; > - > - while (options != 0) { > - offset = rte_bsf64(options); > - > - printf(" %s", > - rte_eth_burst_mode_option_name(1ULL << offset)); > - > - options &= ~(1ULL << offset); > - } > -} > - > void > rx_queue_infos_display(portid_t port_id, uint16_t queue_id) > { > @@ -397,10 +382,11 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id) > (qinfo.scattered_rx != 0) ? "on" : "off"); > printf("\nNumber of RXDs: %hu", qinfo.nb_desc); > > - if (rte_eth_rx_burst_mode_get(port_id, queue_id, &mode) == 0) { > - printf("\nBurst mode:"); > - burst_mode_options_display(mode.options); > - } > + if (rte_eth_rx_burst_mode_get(port_id, queue_id, &mode) == 0) > + printf("\nBurst mode: %s%s", > + mode.info, > + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? > + " (per queue)" : ""); > > printf("\n"); > } > @@ -433,10 +419,11 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id) > (qinfo.conf.tx_deferred_start != 0) ? "on" : "off"); > printf("\nNumber of TXDs: %hu", qinfo.nb_desc); > > - if (rte_eth_tx_burst_mode_get(port_id, queue_id, &mode) == 0) { > - printf("\nBurst mode:"); > - burst_mode_options_display(mode.options); > - } > + if (rte_eth_tx_burst_mode_get(port_id, queue_id, &mode) == 0) > + printf("\nBurst mode: %s%s", > + mode.info, > + mode.flags & RTE_ETH_BURST_FLAG_PER_QUEUE ? > + " (per queue)" : ""); > > printf("\n"); > } > diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst > index d96696801..7a31cf7c8 100644 > --- a/doc/guides/nics/features.rst > +++ b/doc/guides/nics/features.rst > @@ -879,8 +879,7 @@ Burst mode info > Supports to get Rx/Tx packet burst mode information. > > * **[implements] eth_dev_ops**: ``rx_burst_mode_get``, ``tx_burst_mode_get``. > -* **[related] API**: ``rte_eth_rx_burst_mode_get()``, ``rte_eth_tx_burst_mode_get()``, > - ``rte_eth_burst_mode_option_name()``. > +* **[related] API**: ``rte_eth_rx_burst_mode_get()``, ``rte_eth_tx_burst_mode_get()``. > > .. _nic_features_other: > > diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst > index ae8e7b2f0..8fd1e7e62 100644 > --- a/doc/guides/rel_notes/release_19_11.rst > +++ b/doc/guides/rel_notes/release_19_11.rst > @@ -114,8 +114,6 @@ New Features > ``rte_eth_tx_burst_mode_get`` that allow an application > to retrieve the mode information about RX/TX packet burst > such as Scalar or Vector, and Vector technology like AVX2. > - Another new function ``rte_eth_burst_mode_option_name`` is > - provided for burst mode options stringification. > > * **Updated the Intel ice driver.** > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 6a66cec20..17dc8c78f 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -3017,49 +3017,45 @@ i40e_set_rx_function(struct rte_eth_dev *dev) > } > } > > -int > -i40e_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > - struct rte_eth_burst_mode *mode) > -{ > - eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; > - uint64_t options; > - > - if (pkt_burst == i40e_recv_scattered_pkts) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == i40e_recv_pkts_bulk_alloc) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_BULK_ALLOC; > - else if (pkt_burst == i40e_recv_pkts) > - options = RTE_ETH_BURST_SCALAR; > +static const struct { > + eth_rx_burst_t pkt_burst; > + const char *info; > +} i40e_rx_burst_infos[] = { > + { i40e_recv_scattered_pkts, "Scalar Scattered" }, > + { i40e_recv_pkts_bulk_alloc, "Scalar Bulk Alloc" }, > + { i40e_recv_pkts, "Scalar" }, > #ifdef RTE_ARCH_X86 > - else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2 | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == i40e_recv_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2; > - else if (pkt_burst == i40e_recv_scattered_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == i40e_recv_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE; > + { i40e_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" }, > + { i40e_recv_pkts_vec_avx2, "Vector AVX2" }, > + { i40e_recv_scattered_pkts_vec, "Vector SSE Scattered" }, > + { i40e_recv_pkts_vec, "Vector SSE" }, > #elif defined(RTE_ARCH_ARM64) > - else if (pkt_burst == i40e_recv_scattered_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == i40e_recv_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON; > + { i40e_recv_scattered_pkts_vec, "Vector Neon Scattered" }, > + { i40e_recv_pkts_vec, "Vector Neon" }, > #elif defined(RTE_ARCH_PPC_64) > - else if (pkt_burst == i40e_recv_scattered_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == i40e_recv_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC; > + { i40e_recv_scattered_pkts_vec, "Vector AltiVec Scattered" }, > + { i40e_recv_pkts_vec, "Vector AltiVec" }, > #endif > - else > - options = 0; > +}; > > - mode->options = options; > +int > +i40e_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > + struct rte_eth_burst_mode *mode) > +{ > + eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; > + int ret = -EINVAL; > + unsigned int i; > + > + for (i = 0; i < RTE_DIM(i40e_rx_burst_infos); ++i) { > + if (pkt_burst == i40e_rx_burst_infos[i].pkt_burst) { > + snprintf(mode->info, sizeof(mode->info), "%s", > + i40e_rx_burst_infos[i].info); > + ret = 0; > + break; > + } > + } > > - return options != 0 ? 0 : -EINVAL; > + return ret; > } > > void __attribute__((cold)) > @@ -3155,35 +3151,40 @@ i40e_set_tx_function(struct rte_eth_dev *dev) > } > } > > -int > -i40e_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > - struct rte_eth_burst_mode *mode) > -{ > - eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; > - uint64_t options; > - > - if (pkt_burst == i40e_xmit_pkts_simple) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SIMPLE; > - else if (pkt_burst == i40e_xmit_pkts) > - options = RTE_ETH_BURST_SCALAR; > +static const struct { > + eth_tx_burst_t pkt_burst; > + const char *info; > +} i40e_tx_burst_infos[] = { > + { i40e_xmit_pkts_simple, "Scalar Simple" }, > + { i40e_xmit_pkts, "Scalar" }, > #ifdef RTE_ARCH_X86 > - else if (pkt_burst == i40e_xmit_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2; > - else if (pkt_burst == i40e_xmit_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE; > + { i40e_xmit_pkts_vec_avx2, "Vector AVX2" }, > + { i40e_xmit_pkts_vec, "Vector SSE" }, > #elif defined(RTE_ARCH_ARM64) > - else if (pkt_burst == i40e_xmit_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON; > + { i40e_xmit_pkts_vec, "Vector Neon" }, > #elif defined(RTE_ARCH_PPC_64) > - else if (pkt_burst == i40e_xmit_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC; > + { i40e_xmit_pkts_vec, "Vector AltiVec" }, > #endif > - else > - options = 0; > +}; > > - mode->options = options; > +int > +i40e_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > + struct rte_eth_burst_mode *mode) > +{ > + eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; > + int ret = -EINVAL; > + unsigned int i; > + > + for (i = 0; i < RTE_DIM(i40e_tx_burst_infos); ++i) { > + if (pkt_burst == i40e_tx_burst_infos[i].pkt_burst) { > + snprintf(mode->info, sizeof(mode->info), "%s", > + i40e_tx_burst_infos[i].info); > + ret = 0; > + break; > + } > + } > > - return options != 0 ? 0 : -EINVAL; > + return ret; > } > > void __attribute__((cold)) > diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c > index 8d4820d3c..bf14d337d 100644 > --- a/drivers/net/ice/ice_rxtx.c > +++ b/drivers/net/ice/ice_rxtx.c > @@ -2793,37 +2793,39 @@ ice_set_rx_function(struct rte_eth_dev *dev) > } > } > > +static const struct { > + eth_rx_burst_t pkt_burst; > + const char *info; > +} ice_rx_burst_infos[] = { > + { ice_recv_scattered_pkts, "Scalar Scattered" }, > + { ice_recv_pkts_bulk_alloc, "Scalar Bulk Alloc" }, > + { ice_recv_pkts, "Scalar" }, > +#ifdef RTE_ARCH_X86 > + { ice_recv_scattered_pkts_vec_avx2, "Vector AVX2 Scattered" }, > + { ice_recv_pkts_vec_avx2, "Vector AVX2" }, > + { ice_recv_scattered_pkts_vec, "Vector SSE Scattered" }, > + { ice_recv_pkts_vec, "Vector SSE" }, > +#endif > +}; > + > int > ice_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > struct rte_eth_burst_mode *mode) > { > eth_rx_burst_t pkt_burst = dev->rx_pkt_burst; > - uint64_t options; > - > - if (pkt_burst == ice_recv_scattered_pkts) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == ice_recv_pkts_bulk_alloc) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_BULK_ALLOC; > - else if (pkt_burst == ice_recv_pkts) > - options = RTE_ETH_BURST_SCALAR; > -#ifdef RTE_ARCH_X86 > - else if (pkt_burst == ice_recv_scattered_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2 | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == ice_recv_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2; > - else if (pkt_burst == ice_recv_scattered_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE | > - RTE_ETH_BURST_SCATTERED; > - else if (pkt_burst == ice_recv_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE; > -#endif > - else > - options = 0; > + int ret = -EINVAL; > + unsigned int i; > > - mode->options = options; > + for (i = 0; i < RTE_DIM(ice_rx_burst_infos); ++i) { > + if (pkt_burst == ice_rx_burst_infos[i].pkt_burst) { > + snprintf(mode->info, sizeof(mode->info), "%s", > + ice_rx_burst_infos[i].info); > + ret = 0; > + break; > + } > + } > > - return options != 0 ? 0 : -EINVAL; > + return ret; > } > > void __attribute__((cold)) > @@ -2949,29 +2951,36 @@ ice_set_tx_function(struct rte_eth_dev *dev) > } > } > > +static const struct { > + eth_tx_burst_t pkt_burst; > + const char *info; > +} ice_tx_burst_infos[] = { > + { ice_xmit_pkts_simple, "Scalar Simple" }, > + { ice_xmit_pkts, "Scalar" }, > +#ifdef RTE_ARCH_X86 > + { ice_xmit_pkts_vec_avx2, "Vector AVX2" }, > + { ice_xmit_pkts_vec, "Vector SSE" }, > +#endif > +}; > + > int > ice_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id, > struct rte_eth_burst_mode *mode) > { > eth_tx_burst_t pkt_burst = dev->tx_pkt_burst; > - uint64_t options; > - > - if (pkt_burst == ice_xmit_pkts_simple) > - options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SIMPLE; > - else if (pkt_burst == ice_xmit_pkts) > - options = RTE_ETH_BURST_SCALAR; > -#ifdef RTE_ARCH_X86 > - else if (pkt_burst == ice_xmit_pkts_vec_avx2) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2; > - else if (pkt_burst == ice_xmit_pkts_vec) > - options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE; > -#endif > - else > - options = 0; > + int ret = -EINVAL; > + unsigned int i; > > - mode->options = options; > + for (i = 0; i < RTE_DIM(ice_tx_burst_infos); ++i) { > + if (pkt_burst == ice_tx_burst_infos[i].pkt_burst) { > + snprintf(mode->info, sizeof(mode->info), "%s", > + ice_tx_burst_infos[i].info); > + ret = 0; > + break; > + } > + } > > - return options != 0 ? 0 : -EINVAL; > + return ret; > } > > /* For each value it means, datasheet of hardware can tell more details > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index 7743205d3..208362971 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -166,25 +166,6 @@ static const struct { > > #undef RTE_TX_OFFLOAD_BIT2STR > > -static const struct { > - uint64_t option; > - const char *name; > -} rte_burst_option_names[] = { > - { RTE_ETH_BURST_SCALAR, "Scalar" }, > - { RTE_ETH_BURST_VECTOR, "Vector" }, > - > - { RTE_ETH_BURST_ALTIVEC, "AltiVec" }, > - { RTE_ETH_BURST_NEON, "Neon" }, > - { RTE_ETH_BURST_SSE, "SSE" }, > - { RTE_ETH_BURST_AVX2, "AVX2" }, > - { RTE_ETH_BURST_AVX512, "AVX512" }, > - > - { RTE_ETH_BURST_SCATTERED, "Scattered" }, > - { RTE_ETH_BURST_BULK_ALLOC, "Bulk Alloc" }, > - { RTE_ETH_BURST_SIMPLE, "Simple" }, > - { RTE_ETH_BURST_PER_QUEUE, "Per Queue" }, > -}; > - > /** > * The user application callback description. > * > @@ -4284,22 +4265,6 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, > dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode)); > } > > -const char * > -rte_eth_burst_mode_option_name(uint64_t option) > -{ > - const char *name = ""; > - unsigned int i; > - > - for (i = 0; i < RTE_DIM(rte_burst_option_names); ++i) { > - if (option == rte_burst_option_names[i].option) { > - name = rte_burst_option_names[i].name; > - break; > - } > - } > - > - return name; > -} > - > int > rte_eth_dev_set_mc_addr_list(uint16_t port_id, > struct rte_ether_addr *mc_addr_set, > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h > index c36c1b631..88c83c7aa 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -1248,32 +1248,23 @@ struct rte_eth_txq_info { > } __rte_cache_min_aligned; > > /** > - * Burst mode types, values can be ORed to define the burst mode of a driver. > + * Generic Burst mode flag definition, values can be ORed. > + */ > +#define RTE_ETH_BURST_FLAG_PER_QUEUE (1ULL << 0) > +/**< If the queues have different burst mode description, this bit will be set > + * by PMD, then the application can iterate to retrieve burst description for > + * all other queues. > */ > -enum rte_eth_burst_mode_option { > - RTE_ETH_BURST_SCALAR = (1 << 0), > - RTE_ETH_BURST_VECTOR = (1 << 1), > - > - /**< bits[15:2] are reserved for each vector type */ > - RTE_ETH_BURST_ALTIVEC = (1 << 2), > - RTE_ETH_BURST_NEON = (1 << 3), > - RTE_ETH_BURST_SSE = (1 << 4), > - RTE_ETH_BURST_AVX2 = (1 << 5), > - RTE_ETH_BURST_AVX512 = (1 << 6), > - > - RTE_ETH_BURST_SCATTERED = (1 << 16), /**< Support scattered packets */ > - RTE_ETH_BURST_BULK_ALLOC = (1 << 17), /**< Support mbuf bulk alloc */ > - RTE_ETH_BURST_SIMPLE = (1 << 18), > - > - RTE_ETH_BURST_PER_QUEUE = (1 << 19), /**< Support per queue burst */ > -}; > > /** > * Ethernet device RX/TX queue packet burst mode information structure. > * Used to retrieve information about packet burst mode setting. > */ > struct rte_eth_burst_mode { > - uint64_t options; > + uint64_t flags; /**< The ORed values of RTE_ETH_BURST_FLAG_xxx */ > + > +#define RTE_ETH_BURST_MODE_INFO_SIZE 1024 /**< Maximum size for information */ > + char info[RTE_ETH_BURST_MODE_INFO_SIZE]; /**< burst mode information */ > }; > > /** Maximum name length for extended statistics counters */ > @@ -3706,20 +3697,6 @@ __rte_experimental > int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id, > struct rte_eth_burst_mode *mode); > > -/** > - * Retrieve name about burst mode option. > - * > - * @param option > - * The burst mode option of type *rte_eth_burst_mode_option*. > - * > - * @return > - * - "": Not found > - * - "xxx": name of the mode option. > - */ > -__rte_experimental > -const char * > -rte_eth_burst_mode_option_name(uint64_t option); > - > /** > * Retrieve device registers and register attributes (number of registers and > * register size) > diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map > index e59d51648..5b00b9a40 100644 > --- a/lib/librte_ethdev/rte_ethdev_version.map > +++ b/lib/librte_ethdev/rte_ethdev_version.map > @@ -287,5 +287,4 @@ EXPERIMENTAL { > # added in 19.11 > rte_eth_rx_burst_mode_get; > rte_eth_tx_burst_mode_get; > - rte_eth_burst_mode_option_name; > }; > Acked-by: Ray Kinsella