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 E6EF345EE8; Thu, 19 Dec 2024 08:34:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C470540144; Thu, 19 Dec 2024 08:34:33 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 21A1F400EF for ; Thu, 19 Dec 2024 08:34:32 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJ7PETR005361; Wed, 18 Dec 2024 23:34:30 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=OUTyQ1eLToUkmgbbgQ6OAI5 Wy4aECxbG4NvOxVNZMNU=; b=X6KxQDNzN2mVrA0GcXlKnC0QfWSeNKWdioxpNhA TJbko7er/MOIbeNpvxRv/NCkEQgKcizqNLvSOPuZ+kOf1BnX1qGv0oL2nsq4FxdX 2hZ7Mep0SUfnd9eM1faWna5UVGgbA4X1ZD72aNlJmSlEYR8tjSurk8R96D+PqvIb lZtH038DcWOZTuDSPTU3DJnk2MEC2HUeFGTcUG25p20tDWX2VIxWWLKHSj1Nag29 fVvN9gV4lL75UtlWrmAZOU5rfITUbJGyQHtxxfdHwQt+0iWuzLONSJzw8q0otSYa /IXFBQNlEQI44Rc1XTkWuxi5v57cRS7v7nn4lPd1LU9Bxdw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 43mf2wg0j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Dec 2024 23:34:30 -0800 (PST) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 18 Dec 2024 23:34:29 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Wed, 18 Dec 2024 23:34:29 -0800 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id C62493F7052; Wed, 18 Dec 2024 23:34:24 -0800 (PST) From: Shijith Thotton To: CC: Shijith Thotton , Pavan Nikhilesh , Pravin Pathak , "Hemant Agrawal" , Sachin Saxena , Mattias R_nnblom , Jerin Jacob , Liang Ma , Peter Mccarthy , Harry van Haaren , Erik Gabriel Carrillo , Abhinandan Gujjar , Amit Prakash Shukla , Naga Harish K S V , Anatoly Burakov Subject: [RFC PATCH] eventdev: adapter API to configure multiple Rx queues Date: Thu, 19 Dec 2024 13:04:04 +0530 Message-ID: <20241219073405.1724200-1-sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: FNlce2AP7TN4lbYJniR7ZxKD5Tdg-WBE X-Proofpoint-ORIG-GUID: FNlce2AP7TN4lbYJniR7ZxKD5Tdg-WBE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 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 This RFC introduces a new API, rte_event_eth_rx_adapter_queues_add(), designed to enhance the flexibility of configuring multiple Rx queues in eventdev Rx adapter. The existing rte_event_eth_rx_adapter_queue_add() API supports adding multiple queues by specifying rx_queue_id = -1, but it lacks the ability to apply specific configurations to each of the added queues. The proposed API, rte_event_eth_rx_adapter_queues_add, addresses this limitation by: - Enabling users to specify an array of rx_queue_id values alongside individual configurations for each queue. - Supporting a nb_rx_queues argument to define the number of queues to configure. When set to 0, the API applies a common configuration to all queues, similar to the existing rx_queue_id = -1 behavior. This enhancement allows for more granular control when configuring multiple Rx queues. Additionally, the API can act as a replacement for the older API, offering both flexibility and improved functionality. Signed-off-by: Shijith Thotton --- lib/eventdev/eventdev_pmd.h | 34 +++++++++++++++++++++++++ lib/eventdev/rte_event_eth_rx_adapter.h | 34 +++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 36148f8d86..2e458a9779 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -25,6 +25,7 @@ #include #include "event_timer_adapter_pmd.h" +#include "rte_event_eth_rx_adapter.h" #include "rte_eventdev.h" #ifdef __cplusplus @@ -708,6 +709,37 @@ typedef int (*eventdev_eth_rx_adapter_queue_add_t)( int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); +/** + * Add ethernet Rx queues to event device. This callback is invoked if + * the caps returned from rte_eventdev_eth_rx_adapter_caps_get(, eth_port_id) + * has RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT set. + * + * @param dev + * Event device pointer + * + * @param eth_dev + * Ethernet device pointer + * + * @param rx_queue_id + * Ethernet device receive queue index array + * + * @param queue_conf + * Additional configuration structure array + * + * @param nb_rx_queues + * Number of ethernet device receive queues + * + * @return + * - 0: Success, ethernet receive queues added successfully. + * - <0: Error code returned by the driver function. + */ +typedef int (*eventdev_eth_rx_adapter_queues_add_t)( + const struct rte_eventdev *dev, + const struct rte_eth_dev *eth_dev, + int32_t rx_queue_id[], + const struct rte_event_eth_rx_adapter_queue_conf queue_conf[], + uint16_t nb_rx_queues); + /** * Delete ethernet Rx queues from event device. This callback is invoked if * the caps returned from eventdev_eth_rx_adapter_caps_get(, eth_port_id) @@ -1578,6 +1610,8 @@ struct eventdev_ops { /**< Get ethernet Rx adapter capabilities */ eventdev_eth_rx_adapter_queue_add_t eth_rx_adapter_queue_add; /**< Add Rx queues to ethernet Rx adapter */ + eventdev_eth_rx_adapter_queues_add_t eth_rx_adapter_queues_add; + /**< Add Rx queues to ethernet Rx adapter */ eventdev_eth_rx_adapter_queue_del_t eth_rx_adapter_queue_del; /**< Delete Rx queues from ethernet Rx adapter */ eventdev_eth_rx_adapter_queue_conf_get_t eth_rx_adapter_queue_conf_get; diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index 9237e198a7..9a5c560b67 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -553,6 +553,40 @@ int rte_event_eth_rx_adapter_queue_add(uint8_t id, int32_t rx_queue_id, const struct rte_event_eth_rx_adapter_queue_conf *conf); +/** + * Add multiple receive queues to an event adapter. + * + * @param id + * Adapter identifier. + * + * @param eth_dev_id + * Port identifier of Ethernet device. + * + * @param rx_queue_id + * Array of Ethernet device receive queue indices. + * If nb_rx_queues is 0, then rx_queue_id is ignored. + * + * @param conf + * Array of additional configuration structures of type + * *rte_event_eth_rx_adapter_queue_conf*. conf[i] is used for rx_queue_id[i]. + * If nb_rx_queues is 0, then conf[0] is used for all Rx queues. + * + * @param nb_rx_queues + * Number of receive queues to add. + * If nb_rx_queues is 0, then all Rx queues configured for + * the device are added with the same configuration in conf[0]. + * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ + * + * @return + * - 0: Success, Receive queues added correctly. + * - <0: Error code on failure. + */ +__rte_experimental +int rte_event_eth_rx_adapter_queues_add( + uint8_t id, uint16_t eth_dev_id, int32_t rx_queue_id[], + const struct rte_event_eth_rx_adapter_queue_conf conf[], + uint16_t nb_rx_queues); + /** * Delete receive queue from an event adapter. * -- 2.25.1