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 DDA3D42EDE; Sat, 22 Jul 2023 00:58:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE467410E9; Sat, 22 Jul 2023 00:58:39 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2084.outbound.protection.outlook.com [40.107.220.84]) by mails.dpdk.org (Postfix) with ESMTP id 4B2EE40A7A for ; Sat, 22 Jul 2023 00:58:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YdrrgQKgOpavXkcKHJTX0yFdIQHRTAV4YwYtANaH2m4QwjLaVpht4z5rlYehDWJEdorGewXG1Y5NlZJu1nLWhCN1rcGS52mneXrde0+9h6EoGHHaod3cspN87Z6RG3gJ0qtwOwpYwFkG414DmNBQiCw90jr9zm2HjlPSSFdfFP0/0ebgXbXF/Bw6u1o5nz3bW8hL4XRbjmKqFGoHJmo75TVBt0N32igqn/IuRhdcKUtr9lUbFHTr8jYwbTeEXcHVi98xv2L4i4q8hzweI7PM6Po0ilGCWmczIBWJLEsRdpzsTQBg7YymoihkYl3aqRDqfEQbDuKiEGlEea7Y5buAXA== 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=LlG6mb1MJ9F03/Niw5Ni7RiLFvdbe53qjtaSACm5UjE=; b=aiWxTC6jrFxh3mYuMFkBq5SNMNsOSp+meYLdUK4fTowcuSk0Sx+bKEZz00E7Vs1ik5ebIGMRCHy6d5V7ZBpbry+RMry2skEgAfeWaUUEPcz/XAZizc29UJnae6KmagoGTLwkshGgx+TW4ZQf00G0CrgzmqYIRR6BV+UyPpx+aNVC1imkelmAI1hJQGshVngX7obs0FGaci/fNlFSbKY3SmPD2IZGtGFM5xBjZCsR74OOI4y9AsqqZmGSgC2Rgd8WRDHE4pzf2xMJdag2Fpyo+OIGMwpN6YnZv7ICzK11Z5w9Nkw4Q86Hm4MJjl3FxwDRYR3pMKRAdeVyVXAQqd/byg== 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=LlG6mb1MJ9F03/Niw5Ni7RiLFvdbe53qjtaSACm5UjE=; b=wwfKMSAVj25YsAmP3BquMaUdVt4LhSKmgYXAiPhEx6xpG13dqrGvnWV36NZ6KL0DTtJN8PvkpKVUp7XAju8TLiLoTcl9RaxHOvqk09PlGdYNvZ/c/crm4nee1YfNw2Y8uy6kE3pXH3OV9Y9WXGQCgofPnz8tH9ZsNA4OMrJzIpE= 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:58:36 +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:58:36 +0000 Message-ID: <195a37cd-04f0-050d-f3cf-67d5639fd06b@amd.com> Date: Fri, 21 Jul 2023 23:58:30 +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> <1befaf91-ddc1-1e6b-2681-88fefd4daa3c@arknetworks.am> From: Ferruh Yigit In-Reply-To: <1befaf91-ddc1-1e6b-2681-88fefd4daa3c@arknetworks.am> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P265CA0217.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:33a::14) 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: ce65f64b-d2e0-4a7e-3e50-08db8a3e03de X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 23mV6qUdtsvl52l5xGBX8skGzMgjE3RPwMHr0L79ojDfVrgnact3O4cofCOgtvkoDLSp4ORdl5osbgBFGXJtxzzDOmd8KO2hyMNpipBpXgPNVeRFwykSm4GtHruP/CrijeVTqzk3IJ1okKKtScvgBs0dQZX1PgnOOvYaEjnZ/C4ANmrgqR5r8uiQ2nGtuFcC8Vo0LMCQAg00ViH3QbNv+hXF5sjCFQizdzL7+02KIjPeKkwKBbrb2IEcnKCxD75rY5vkypqxZyCcE8ZS5YV8Gu5F6vnmIeFBjP3e5ej4bxUo/ooKxcCvsiqE01TVKJT7nZ/o02/pgekmk+Hh4lQ7WD4y3YCN69v2jgvx4e0U/GhZ2oVIxkJWjluNueiE+grWDOyWZ+DqUV3RmgliycpVwfzxm9v1ZE7ByX+BkgdMymKr0U8oERNJhjbQH8o/7RcPiJxXY7ZdQpCdrPHZP0r1BLkYD8/4iOF78hcTrfsbA9Mak9OjapGyZwy0AAjUgxBCZppzKg73R4y+64FeskrQ8VZ4OHvW178CXyXBo1GVSehnq8d1J+dYgjj9L8ur7RQJCSuRTIQwr8sIAX1HY974FnfFYVKJNfXhGjArk6lO177HIK9ckLWHKLUo3ZbGCZYIX4fUYNtxdHnXEMPNZZ6jjQ== 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?dEQrd2VIWTg0ak4wcDM2ampQVTVmWDFtczVsQS9vMVRKU3NmOTRHaC8yY2Fm?= =?utf-8?B?dFdjZGlRc0Y5NExBYS8rTkd1YjB0ZmFlSUtLY290d25NL1h0dG5PMWEzNTFL?= =?utf-8?B?MVNKNDBvb0pRMXFzV2R0cXBaaDNXb1VpU0FGd1JXNnkwazhVK21JM01vNmY5?= =?utf-8?B?TW5QSzUyUUdRbys5MXVLTWFhK21oUklCdVhRVmllT1R2bnZkL3VqcFl5cDd2?= =?utf-8?B?RVJKU3BVQXd5ZG9ZdlErTEs1S1hLQzd2WVJQdEx5c1l1bUxRcklyNHA2Wn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2WFhOU2xlNWF1cSs2R3c1L3l3S3hvTzhJTURmR2c1?= =?utf-8?Q?6FtOcwbuzkjLsdVRliNYSkzE6?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce65f64b-d2e0-4a7e-3e50-08db8a3e03de 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:58:36.1712 (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: zz/ZdKUcO1VQaSx/ioAQ+P6OhuFiCQtDr5qxDg1n2SO/CDs0l/OLWmsegQNF5BnY 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: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 >> --- >> 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)); > This clears "eth_conf", but the sizeof is "dev_info". Why? > Will fix in next version, thx.