On 7/21/2023 6:42 PM, Ivan Malov wrote: > Hi Ferruh, > > PSB > > Thank you. > > On Fri, 21 Jul 2023, Ferruh Yigit wrote: > >> Drivers start/stop device queues on port start/stop, but not all drivers >> update queue state accordingly. >> >> This becomes more visible if a specific queue stopped explicitly and >> port stopped/started later, in this case although all queues are >> started, the state of that specific queue is stopped and it is >> misleading. >> >> Misrepresentation of queue state became a defect with commit [1] that >> does forwarding decision based on queue state and commit [2] that gets >> up to date queue state from ethdev/device before forwarding. >> >> This patch documents that status of all queues of a device should be >> `RTE_ETH_QUEUE_STATE_STOPPED` after port stop and their status should >> be`RTE_ETH_QUEUE_STATE_STARTED` after port start. >> >> Also an unit test added to verify drivers. >> >> Signed-off-by: Ferruh Yigit <ferruh.yi...@amd.com> >> --- >> Cc: Jie Hai <haij...@huawei.com> >> Cc: Song Jiale <songx.ji...@intel.com> >> Cc: Yuan Peng <yuan.p...@intel.com> >> Cc: Raslan Darawsheh <rasl...@nvidia.com> >> Cc: Qiming Yang <qiming.y...@intel.com> >> --- >> app/test/meson.build | 2 + >> app/test/test_ethdev_api.c | 169 +++++++++++++++++++++++++++++++++++++ >> lib/ethdev/rte_ethdev.h | 5 ++ >> 3 files changed, 176 insertions(+) >> create mode 100644 app/test/test_ethdev_api.c >> >> diff --git a/app/test/meson.build b/app/test/meson.build >> index b89cf0368fb5..8e409cf59c35 100644 >> --- a/app/test/meson.build >> +++ b/app/test/meson.build >> @@ -49,6 +49,7 @@ test_sources = files( >> 'test_efd_perf.c', >> 'test_errno.c', >> 'test_ethdev_link.c', >> + 'test_ethdev_api.c', >> 'test_event_crypto_adapter.c', >> 'test_event_eth_rx_adapter.c', >> 'test_event_ring.c', >> @@ -187,6 +188,7 @@ fast_tests = [ >> ['eal_fs_autotest', true, true], >> ['errno_autotest', true, true], >> ['ethdev_link_status', true, true], >> + ['ethdev_api', true, true], >> ['event_ring_autotest', true, true], >> ['fib_autotest', true, true], >> ['fib6_autotest', true, true], >> diff --git a/app/test/test_ethdev_api.c b/app/test/test_ethdev_api.c >> new file mode 100644 >> index 000000000000..1b4569396dda >> --- /dev/null >> +++ b/app/test/test_ethdev_api.c >> @@ -0,0 +1,169 @@ >> +/* SPDX-License-Identifier: BSD-3-Clause >> + * Copyright (C) 2023, Advanced Micro Devices, Inc. >> + */ >> + >> +#include <rte_log.h> >> +#include <rte_ethdev.h> >> + >> +#include <rte_test.h> >> +#include "test.h" >> + >> +#define NUM_RXQ 2 >> +#define NUM_TXQ 2 >> +#define NUM_RXD 512 >> +#define NUM_TXD 512 >> +#define NUM_MBUF 1024 >> +#define MBUF_CACHE_SIZE 256 >> + >> +static int32_t >> +ethdev_api_queue_status(void) >> +{ >> + struct rte_eth_dev_info dev_info; >> + struct rte_eth_rxq_info rx_qinfo; >> + struct rte_eth_txq_info tx_qinfo; >> + struct rte_mempool *mbuf_pool; >> + /*struct rte_eth_rxconf rx_conf;*/ >> + /*struct rte_eth_txconf tx_conf;*/ >> + struct rte_eth_conf eth_conf; >> + uint16_t port_id; >> + int ret; >> + >> + mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NUM_MBUF, >> MBUF_CACHE_SIZE, 0, >> + RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); >> + >> + RTE_ETH_FOREACH_DEV(port_id) { >> + memset(ð_conf, 0, sizeof(dev_info)); > This clears "eth_conf", but the sizeof is "dev_info". Why? >
Will fix in next version, thx.