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 2374942C10; Fri, 2 Jun 2023 14:48:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD62D40ED8; Fri, 2 Jun 2023 14:48:12 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2051.outbound.protection.outlook.com [40.107.92.51]) by mails.dpdk.org (Postfix) with ESMTP id 97C5B406B8 for ; Fri, 2 Jun 2023 14:48:11 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e+6pQa9sQ/kUu6N22/Xyi4gfTXcGviZ47DuNtp4fkHaW4CgZpitsOFlqAxEKjzBnJiIS8ALhX8L0uaWA1EqGhUI6GyDZo5dXq3lYGcirUS8mPo3z3X7OW95u4dhko4ruXuL5ozM3YA9MipmaE9Vn/tzJxtEfGTHBXOUJUqgFJAoKEo+hPQqKOs1JUD9zSoirxhEDlFSs6S9w8c/JkEGnYDBdKV0JKJL9itmt78NHDzENHfnrbHeZJWxqjLeuxRxwIGlG5Xk2qVMAE76MkgJir8T1chFRc7qa6hQxj73sCA/72P6HvqyU0791kKtY//kU7rkgDKAb1cO473AOCJe5Pg== 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=GxtQw3AKEGQbo7bbthJpQ1vlHfj9lAIhUvEAFvsgi2I=; b=LMUg/EiizXktb6Sgmy7SPkZeYYLPqJO6bXqSnbmVNyQ41FyfHu53yW7WtAvSzo164Id383tfpEoHHL8zr4roOYoodbNW6ggmv7q1adeEJGNbT1FyZWKOJhG/sJ8Xzy6rIBkXvegF+cANCa+EuKeWbz/mPN/OEbU/uFvrnS99tKXmujP8xgtPotl40Xw57qChMi1phmNwagxPb5GKExlgpvUkJ/z1lEPE+tvkztgAH45a9moGUD7F55s16xyA73+5aqPOXMjsMoxSj2fKqXsE72p3sjt2rJy0u8XmHGGRdBoyJ927yYzwTSt5MldVwK1cZRBnUB+ZBsmPDgpfjzEY8Q== 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=GxtQw3AKEGQbo7bbthJpQ1vlHfj9lAIhUvEAFvsgi2I=; b=ucpOylRk7u+GivwCqW8nSX1Cf4LLRbNa5i/qiqe++zDQ6oz0RyHAUFUcIT3TrsJ4SF85D6kASsdSJs6jc3I6bYkIo3qrpi8kooLtQRh9RU5glK3wgptT/FBFeotDmK3zKZiJBtizcJuzbAkY+zUJFJFHqYRPT/ax2iAi/dHZKK0= 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 MW4PR12MB7309.namprd12.prod.outlook.com (2603:10b6:303:22f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.26; Fri, 2 Jun 2023 12:48:09 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6433.022; Fri, 2 Jun 2023 12:48:09 +0000 Message-ID: Date: Fri, 2 Jun 2023 13:47:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US To: Dengdui Huang , dev@dpdk.org Cc: stephen@networkplumber.org, thomas@monjalon.net, aman.deep.singh@intel.com, yuying.zhang@intel.com, andrew.rybchenko@oktetlabs.ru, anatoly.burakov@intel.com, lihuisong@huawei.com, liuyonglong@huawei.com, liudongdong3@huawei.com References: <20230516110021.1801443-1-huangdengdui@huawei.com> <20230602075211.3628165-1-huangdengdui@huawei.com> <20230602075211.3628165-2-huangdengdui@huawei.com> From: Ferruh Yigit Subject: Re: [PATCH v4 1/2] ethdev: add API to check if queue is valid In-Reply-To: <20230602075211.3628165-2-huangdengdui@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0615.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:314::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MW4PR12MB7309:EE_ X-MS-Office365-Filtering-Correlation-Id: aaa765f2-fc4c-4379-55be-08db63679e0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r9yqUudUPQhB7hWQMQGXsZwHpVNo+aEbgP9vpr4u9JalFA+zrykAb8I+qUvM1VTeugLVMxJUKnif/oteUoj/sDlJGkQzm/vMNRo0PPaj1STZlpT1lqkOXPmEBwN72vpAaW6+77ydITRYOveHq670ehP4d0HgS89acpeBEuDjRrzEVkhjLp1qz7XKdIbH13NUJtdX6g1yKDOSZy46arvGqYexyVUblrJS/E/3np5AZIg4UAHPgBD0wiClIAMPsM7oOVKv70hjmCw+TJRieh3/7kz7D01O03C/e6+HZ3vlt8NYNpMQsDe5V2t0eB7bAdg33mg9ZXtfM7Zb65IFv8O2/PkkAhqiROThvAgls2gG+Wct93xdixDOIwiHL+BGqYFiM3ZzcLKB2DL5XN+8Do0VDoycCn6zC4khKiS4TRqtaFEVJBZOlRtk9EA+RzfzEHhHZySmwusmlk3FTyqDEhvKJWZgZ0G+sojkDQrGk1O/8w9p7De8R4MaPHkhOV+6gxpG7vWLZ+J0c5vJJPpYkk+dHwj7jz6KLCLx5RueiUgo/ApNVI5rvm490BWQl7tDXueuQTOLYh31UrOGWYUswjU07fyyFCNjJWd9Fa2yZCKyQ6T52QTaq595l6SaEpDbFuq20l1h2js4YTe26jpDaZAc6g== 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)(39860400002)(366004)(396003)(136003)(346002)(376002)(451199021)(6506007)(53546011)(26005)(186003)(6512007)(6666004)(6486002)(2616005)(41300700001)(83380400001)(316002)(44832011)(2906002)(5660300002)(8936002)(7416002)(8676002)(478600001)(4326008)(66556008)(66946007)(66476007)(36756003)(86362001)(31696002)(38100700002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bGRYNmFOcm00U0RQNXcwcHJ0Zk0wZjNIcXhQK20zLzJuNGwycDh2T2h6Tktz?= =?utf-8?B?ZGFTYjdVUW1SU1VEdDlYTGw5RzZvb2NEODJ3akd6TEdwK0Y5L2lQbm94bjAv?= =?utf-8?B?eFpWZCtpWnNmQ2Z1UnNITmNVRy9YaStCa3lpbUZQbXYrV2V5RWFVWFRVTGRW?= =?utf-8?B?Wmx6ZDNwN2d6ZnlNODVaRG5CSFh4TFpnMFNhZjRGK25mREF2Uk9qcGEzR3dM?= =?utf-8?B?em91VmlMV2w0d211WVVTdCszTmlTUWZWcGlFSW9UNTBHUFNaUTJBNFdPVmVC?= =?utf-8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K2o3eHFLbFhxZmdEem9L?= =?utf-8?Q?OaFaE0iCrADX3T68NpFYGuHIT?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaa765f2-fc4c-4379-55be-08db63679e0a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2023 12:48:08.9445 (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: SP+ImympGgvbCx+uHKx20BpeivbVp+T9H9LlPAouleC+/36F6CtUfHMz5PVHQdo8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7309 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 6/2/2023 8:52 AM, Dengdui Huang wrote: > The API rte_eth_dev_is_valid_rxq/txq which > is used to check if Rx/Tx queue is valid. > If the queue has been setup, it is considered valid. > > Signed-off-by: Dengdui Huang > --- > doc/guides/rel_notes/release_23_07.rst | 6 ++++ > lib/ethdev/rte_ethdev.c | 22 +++++++++++++++ > lib/ethdev/rte_ethdev.h | 38 ++++++++++++++++++++++++++ > lib/ethdev/version.map | 2 ++ > 4 files changed, 68 insertions(+) > > diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst > index 0d3cada5d0..1332fa3a5a 100644 > --- a/doc/guides/rel_notes/release_23_07.rst > +++ b/doc/guides/rel_notes/release_23_07.rst > @@ -83,6 +83,12 @@ New Features > for new capability registers, large passthrough BAR and some > performance enhancements for UPT. > > +* **Added ethdev Rx/Tx queue ID check API.** > + > + Added ethdev Rx/Tx queue ID check API which provides functions > + for check if Rx/Tx queue is valid. If the queue has been setup, > + it is considered valid. > + > Can you please move the release note update to up, before rte_flow updates, the expected order is documented in section comment. > Removed Items > ------------- > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index d46e74504e..a134928c8a 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -771,6 +771,28 @@ eth_dev_validate_tx_queue(const struct rte_eth_dev *dev, uint16_t tx_queue_id) > return 0; > } > > +int > +rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + return eth_dev_validate_rx_queue(dev, queue_id); > +} > + > +int > +rte_eth_dev_is_valid_txq(uint16_t port_id, uint16_t queue_id) > +{ > + struct rte_eth_dev *dev; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > + dev = &rte_eth_devices[port_id]; > + > + return eth_dev_validate_tx_queue(dev, queue_id); > +} > + > int > rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_t rx_queue_id) > { > diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h > index 9932413c33..4ef803c244 100644 > --- a/lib/ethdev/rte_ethdev.h > +++ b/lib/ethdev/rte_ethdev.h > @@ -2666,6 +2666,44 @@ int rte_eth_dev_socket_id(uint16_t port_id); > */ > int rte_eth_dev_is_valid_port(uint16_t port_id); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Check if Rx queue is valid. If the queue has been setup, > + * it is considered valid. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_id > + * The index of the receive queue. > + * @return > + * - -ENODEV: if *port_id* is valid. s/valid/invalid ? > + * - -EINVAL: if queue is out of range or not been setup. "if queue_id is out of range or queue is not been setup" ? > + * - 0 if Rx queue is valid. > + */ > +__rte_experimental > +int rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * Check if Tx queue is valid. If the queue has been setup, > + * it is considered valid. > + * > + * @param port_id > + * The port identifier of the Ethernet device. > + * @param queue_id > + * The index of the transmit queue. > + * @return > + * - -ENODEV: if *port_id* is valid. s/valid/invalid ? > + * - -EINVAL: if queue is out of range or not been setup. "if queue_id is out of range or queue is not been setup" ? > + * - 0 if Tx queue is valid. > + */ > +__rte_experimental > +int rte_eth_dev_is_valid_txq(uint16_t port_id, uint16_t queue_id); > + > /** > * Start specified Rx queue of a port. It is used when rx_deferred_start > * flag of the specified queue is true. > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map > index 9d418091ef..3aa6bce156 100644 > --- a/lib/ethdev/version.map > +++ b/lib/ethdev/version.map > @@ -309,6 +309,8 @@ EXPERIMENTAL { > rte_flow_async_action_list_handle_destroy; > rte_flow_async_action_list_handle_query_update; > rte_flow_async_actions_update; > + rte_eth_dev_is_valid_rxq; > + rte_eth_dev_is_valid_txq; Can you please sort '23.07' block alphabetically? > }; > > INTERNAL {