From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3291742EDE; Sat, 22 Jul 2023 00:57:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD0F0410E9; Sat, 22 Jul 2023 00:57:35 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062.outbound.protection.outlook.com [40.107.243.62]) by mails.dpdk.org (Postfix) with ESMTP id 4A0DB40A7A for ; Sat, 22 Jul 2023 00:57:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cJ6PuFBNgYB+g1VLt4EDWdhyPTIN/ieyK5th31FLmzJVK9qpM8Q/c1nWilrif6rryFrdJhCll1wLD24UjJhcOfs+HGKMmPHYh0nBWGPLvnvetGyqD4BtlBKuMiNgH7JYU2uKo/AdOaOL6RZdiQFomp+BQ75jmEalA40TsOHqVrrH2rHILcPILMtw5mtET3LGV3Ta7z0l+4cz7jcH/PeBuBfLYdQt47EYaROTb17xVV2gbE9+1NCJTQo8Yfs0JB/v4qEzKA1ntJFr+0eTqtVXPKic0WliI4eU/izd2J17R/TDZHN7fZj/JO9za9TQ0LkKtHgTHrAiNqlPO3/ZugwGlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z2CZwSxT58YyEQLE/en8oJyuGqvQx0Cklo5WdLocK/8=; b=nfFdBRemRgvOS5oL2KWN68CUDVZ158E6OGDIRCu+ZT3u8Ih1iJPwrvCrsWS95xn9LOxGUwgJeGQTinIvbARVLEsyFuRzekgMWILHSAQ3cjwgAtW2Im0gqWLv9fh3PRTmHWjVwOtSam6pJKVaoI7NbgSyGrllJ/071bDp2/Xq9JRchQgf1cDCGmdYK3crEHuuPYpXatbWnbbwVyc5itGkEfWFBfC3bR/+XNfMxS0fp6z8p/2bWg7UZlugTvReUUiMviiMh1PD7gvp91xJ7VG+PQv3D4LAf4SIs1KfQm/VFOOg7VDjMyGSLpKJGzvskbmBtas6Vd9xJiHEWhKBc0TASA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z2CZwSxT58YyEQLE/en8oJyuGqvQx0Cklo5WdLocK/8=; b=aTxbepBMWw12QoJvd+hU03MSJxQOFYcpJUwmbzr6Bya1aWc8n32lRk6xhImOpSVykleJ3SJXVcUlDQXD30G+Rw22McLwvKHx1z8xzd/e4v3OmQLd5Ewb8fmhXmq6ZmScaptSS3v4erL3H+ALkXZlzC0r0iSzIiwG4jeAHf/6kqI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by IA1PR12MB8357.namprd12.prod.outlook.com (2603:10b6:208:3ff::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.25; Fri, 21 Jul 2023 22:57:29 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::15a9:4e83:4217:8b49]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::15a9:4e83:4217:8b49%7]) with mapi id 15.20.6609.026; Fri, 21 Jul 2023 22:57:29 +0000 Message-ID: <9cc441fa-df60-3ddf-4a4e-cf685f023843@amd.com> Date: Fri, 21 Jul 2023 23:57:23 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC] ethdev: clarify device queue state after start and stop Content-Language: en-US To: Ivan Malov Cc: Thomas Monjalon , Andrew Rybchenko , dev@dpdk.org, David Marchand , Jie Hai , Song Jiale , Yuan Peng , Raslan Darawsheh , Qiming Yang References: <20230721160422.3848154-1-ferruh.yigit@amd.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0018.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:150::23) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB8357:EE_ X-MS-Office365-Filtering-Correlation-Id: 038a09c2-e235-4446-0fdb-08db8a3ddbf3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VBCMoRqNBE18i+cBFLfV0BMkovGbouW8Tl2VxlNTqEKCoTaKvBts+ogcnmWkmbnSzlKBSY7NoVC+7EKBrw3I0S6N7tM9ytV8s5nOMFOmjovq8HkTiIM6JQ6i419L5SJI/E6b5HyDXB8ixY7TZvbFiAQaJ9/h5EFe5MlGnIpa7VM6Y6Xd2vWpp3QsZIfYgiHvsmYxM4sqibr1mYlyVcHQLW9KzDfBH0WC7XH0fd4C2UK6uadomIGwbhS4FzkReW8/ksbmoSe9Zo29ryxh2WUdMI6gCEV7qQZUJl045pkphBDWxnfsj3RI4v/0Br2lkgBmbmWkj0IQvBoLsFah5fvyw8jOMyr7MEIbvzcmeQ/QZZt7RCPn1n4u/h28zUcONCsPEeSwi/k7IPD0FiLsAL0sUMc/TWP252CiHAdvFlOc27a+QiqU5tmY7Em7GFeOQsC31/tFgkBqHsQ4NNr4nps2p2XbfpoTyKws4/d5Xe/uOPyIr47fCEVCamTOqjQnjf+3V2uCZHxMZi+WZJBjOUHtn+QKpoxe85YHuIaka3SzDZcR+JuXGtrsnIIfNGrGE7FOX/ClWsd7GkvzYTspougff3508dWo2UoVWMabqWKS7mPq4K7aNg72mf9/cZvYRotn17kv7PesY5hbS/CNj7xPjA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(2616005)(83380400001)(2906002)(66946007)(6916009)(66476007)(66556008)(31686004)(6666004)(4326008)(6486002)(6512007)(36756003)(316002)(86362001)(478600001)(31696002)(44832011)(8936002)(8676002)(7416002)(54906003)(186003)(38100700002)(26005)(6506007)(41300700001)(53546011)(5660300002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Vm56WWlscVAwTjVPV1l3MFI3OVNOUFR2NG9kbkRSc0JjVmwwam5VV0dXNWVT?= =?utf-8?B?akRSTis0QjlaUTZKTDYxekZaU2w3WDBvYml3Tm1iQWhmQmx1bUkzRDQvbm9Q?= =?utf-8?B?Ym9wSmtOTTB0Y0Izb3plcHlyK2NmU0krTmV2UUQwaGw3QkExTWZlRDhHanVQ?= =?utf-8?B?OG55V3dXYmszdnZZMDRhSnQ0S0lRc0x0c0xiM0J6WnVzamtIelRGODUwWW52?= =?utf-8?B?eUdVdy9zWHhRdHNoc1VnS0o5TEkyOVZrRzcvY2pFZVNXZHFmZ2doRlFqZms0?= =?utf-8?B?UVphK0gyWHV0bFIxc0FrOXJxaHBxTCsyTHpKWUZJY3lwNysrdnU2OXpiSXNB?= =?utf-8?B?Qk5NN3Ew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MS-Exchange-CrossTenant-Network-Message-Id: 038a09c2-e235-4446-0fdb-08db8a3ddbf3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 22:57:29.3811 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ZhEGw+In9t1sKmEBckeQac348ZYyWnxEv+svQX62Ck3ColJKxYSGIEel1Xzw/bK/ X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8357 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 7/21/2023 6:33 PM, Ivan Malov wrote: > Hi Ferruh, > > The commit log says "commit [1]" and "commit [2]" but > does not seem to provide the URLs for the [1] and [2]. > What are these resources? I'd like to know. > Ahh, I missed to add them to commit log, will add to next version: [1] 3c4426db54fc ("app/testpmd: do not poll stopped queues") [2] 5028f207a4fa ("app/testpmd: fix secondary process packet forwarding") > 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 >> --- >> Cc: Jie Hai >> Cc: Song Jiale >> Cc: Yuan Peng >> Cc: Raslan Darawsheh >> Cc: Qiming Yang >> --- >> 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 >> +#include >> + >> +#include >> +#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)); >> +        ret = rte_eth_dev_configure(port_id, NUM_RXQ, NUM_TXQ, >> ð_conf); >> +        TEST_ASSERT(ret == 0, >> +            "Port(%u) failed to configure.\n", port_id); >> + >> +        /* RxQ setup */ >> +        /*memset(&rx_conf, 0, sizeof(rx_conf));*/ >> +        for (uint16_t queue_id = 0; queue_id < NUM_RXQ; queue_id++) { >> +            ret = rte_eth_rx_queue_setup(port_id, queue_id, NUM_RXD, >> +                rte_socket_id(), NULL,  mbuf_pool); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to setup RxQ.\n", >> +                port_id, queue_id); >> +        } >> + >> +        /* TxQ setup */ >> +        /*memset(&tx_conf, 0, sizeof(tx_conf));*/ >> +        for (uint16_t queue_id = 0; queue_id < NUM_TXQ; queue_id++) { >> +            ret = rte_eth_tx_queue_setup(port_id, queue_id, NUM_TXD, >> +                rte_socket_id(), NULL); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to setup TxQ.\n", >> +                port_id, queue_id); >> +        } >> + >> +        ret = rte_eth_dev_info_get(port_id, &dev_info); >> +        TEST_ASSERT(ret == 0, >> +            "Port(%u) failed to get dev info.\n", port_id); >> + >> +        /* Initial RxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_rx_queues; >> queue_id++) { >> +            ret = rte_eth_rx_queue_info_get(port_id, queue_id, >> &rx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get RxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(rx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STOPPED, >> +                "Wrong initial Rx queue(%u) state(%d)\n", >> +                queue_id, rx_qinfo.queue_state); >> +        } >> + >> +        /* Initial TxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_tx_queues; >> queue_id++) { >> +            ret = rte_eth_tx_queue_info_get(port_id, queue_id, >> &tx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get TxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(tx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STOPPED, >> +                "Wrong initial Tx queue(%u) state(%d)\n", >> +                queue_id, tx_qinfo.queue_state); >> +        } >> + >> + >> +        ret = rte_eth_dev_start(port_id); >> +        TEST_ASSERT(ret == 0, >> +            "Port(%u) failed to start.\n", port_id); >> + >> +        /* Started RxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_rx_queues; >> queue_id++) { >> +            ret = rte_eth_rx_queue_info_get(port_id, queue_id, >> &rx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get RxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(rx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STARTED, >> +                "Wrong started Rx queue(%u) state(%d)\n", >> +                queue_id, rx_qinfo.queue_state); >> +        } >> + >> +        /* Started TxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_tx_queues; >> queue_id++) { >> +            ret = rte_eth_tx_queue_info_get(port_id, queue_id, >> &tx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get TxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(tx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STARTED, >> +                "Wrong started Tx queue(%u) state(%d)\n", >> +                queue_id, tx_qinfo.queue_state); >> +        } >> + >> + >> +        ret = rte_eth_dev_stop(port_id); >> +        TEST_ASSERT(ret == 0, >> +            "Port(%u) failed to stop.\n", port_id); >> + >> +        /* Stopped RxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_rx_queues; >> queue_id++) { >> +            ret = rte_eth_rx_queue_info_get(port_id, queue_id, >> &rx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get RxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(rx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STOPPED, >> +                "Wrong stopped Rx queue(%u) state(%d)\n", >> +                queue_id, rx_qinfo.queue_state); >> +        } >> + >> +        /* Stopped TxQ */ >> +        for (uint16_t queue_id = 0; queue_id < dev_info.nb_tx_queues; >> queue_id++) { >> +            ret = rte_eth_tx_queue_info_get(port_id, queue_id, >> &tx_qinfo); >> +            TEST_ASSERT(ret == 0, >> +                "Port(%u), queue(%u) failed to get TxQ info.\n", >> +                port_id, queue_id); >> + >> +            TEST_ASSERT(tx_qinfo.queue_state == >> RTE_ETH_QUEUE_STATE_STOPPED, >> +                "Wrong stopped Tx queue(%u) state(%d)\n", >> +                queue_id, tx_qinfo.queue_state); >> +        } >> +    } >> + >> +    return TEST_SUCCESS; >> +} >> + >> +static struct unit_test_suite ethdev_api_testsuite = { >> +    .suite_name = "ethdev API tests", >> +    .setup = NULL, >> +    .teardown = NULL, >> +    .unit_test_cases = { >> +        TEST_CASE(ethdev_api_queue_status), >> +        TEST_CASES_END() /**< NULL terminate unit test array */ >> +    } >> +}; >> + >> +static int >> +test_ethdev_api(void) >> +{ >> +    rte_log_set_global_level(RTE_LOG_DEBUG); >> +    rte_log_set_level(RTE_LOGTYPE_EAL, RTE_LOG_DEBUG); >> + >> +    return unit_test_suite_runner(ðdev_api_testsuite); >> +} >> + >> +REGISTER_TEST_COMMAND(ethdev_api, test_ethdev_api); >> diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h >> index 3d44979b44f7..8f2e0f158cc4 100644 >> --- a/lib/ethdev/rte_ethdev.h >> +++ b/lib/ethdev/rte_ethdev.h >> @@ -2788,6 +2788,9 @@ int rte_eth_dev_tx_queue_stop(uint16_t port_id, >> uint16_t tx_queue_id); >>  * Device RTE_ETH_DEV_NOLIVE_MAC_ADDR flag causes MAC address to be >> set before >>  * PMD port start callback function is invoked. >>  * >> + * All device queues (except form deferred queues) status should be >> + * `RTE_ETH_QUEUE_STATE_STARTED` after start. >> + * >>  * On success, all basic functions exported by the Ethernet API (link >> status, >>  * receive/transmit, and so on) can be invoked. >>  * >> @@ -2804,6 +2807,8 @@ int rte_eth_dev_start(uint16_t port_id); >>  * Stop an Ethernet device. The device can be restarted with a call to >>  * rte_eth_dev_start() >>  * >> + * All device queues status should be `RTE_ETH_QUEUE_STATE_STOPPED` >> after stop. >> + * >>  * @param port_id >>  *   The port identifier of the Ethernet device. >>  * @return >> --  >> 2.34.1 >> >>