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 5F967A0C58; Mon, 23 Aug 2021 21:41:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EEF44411AD; Mon, 23 Aug 2021 21:40:50 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 0138F411A8 for ; Mon, 23 Aug 2021 21:40:48 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17NHFEM7021362; Mon, 23 Aug 2021 12:40:48 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=AE4BqWAMmjuy0WmYsMi9srmBaMzBPxKewqOFomscJaQ=; b=CkFwsi52/fDua7ERbASPNo0O0iIz8JDXMtrW03m+lk2Dx6n8Ze1UkVRLv7YXmyBfmDRB hAKDBa8iinJ3juVbqFts2TEBiLC8GKcuHBkBw4LI0fRY0ytUV5REXenagGkM6lT0qSx9 nEzxIKie/0idbs8ZSFZe2Ae2XNhtp2FYAMmClfnbcRLLESftWzA/0P0+Ev81toifUxm9 79g/Vhy0++gUJfmurNugvrXJ+biBNAq65oI2gXIr8LU97Fxea7t4Nm2vhHbk7yKaHP3n 8eOoby4zC41lqfOii+G873s/dUuwmXHeELFGvXwMpHiuzF14L5r86lVAon6z1EXTFo47 TA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3amfwj0h66-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 12:40:48 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 23 Aug 2021 12:40:41 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 23 Aug 2021 12:40:41 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176]) by maili.marvell.com (Postfix) with ESMTP id C55F15B6937; Mon, 23 Aug 2021 12:40:39 -0700 (PDT) From: To: , Abhinandan Gujjar , "Jay Jayatheerthan" CC: , , Pavan Nikhilesh Date: Tue, 24 Aug 2021 01:10:10 +0530 Message-ID: <20210823194020.1229-6-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210823194020.1229-1-pbhagavatula@marvell.com> References: <20210823194020.1229-1-pbhagavatula@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: PMTPPsNEahu6z9gjalD9FmC8SYUovtvU X-Proofpoint-GUID: PMTPPsNEahu6z9gjalD9FmC8SYUovtvU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-23_04,2021-08-23_01,2020-04-07_01 Subject: [dpdk-dev] [RFC 06/15] eventdev: use new API for inline functions 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 Sender: "dev" From: Pavan Nikhilesh Use new driver interface for the fastpath enqueue/dequeue inline functions. Signed-off-by: Pavan Nikhilesh --- lib/eventdev/rte_event_crypto_adapter.h | 13 +----- lib/eventdev/rte_event_eth_tx_adapter.h | 22 ++------- lib/eventdev/rte_eventdev.h | 61 +++++++------------------ 3 files changed, 22 insertions(+), 74 deletions(-) diff --git a/lib/eventdev/rte_event_crypto_adapter.h b/lib/eventdev/rte_event_crypto_adapter.h index 431d05b6ed..a91585a369 100644 --- a/lib/eventdev/rte_event_crypto_adapter.h +++ b/lib/eventdev/rte_event_crypto_adapter.h @@ -568,20 +568,11 @@ rte_event_crypto_adapter_enqueue(uint8_t dev_id, struct rte_event ev[], uint16_t nb_events) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG - RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); - - if (port_id >= dev->data->nb_ports) { - rte_errno = EINVAL; - return 0; - } -#endif rte_eventdev_trace_crypto_adapter_enqueue(dev_id, port_id, ev, nb_events); - return dev->ca_enqueue(dev->data->ports[port_id], ev, nb_events); + return rte_eventdev_api[dev_id].ca_enqueue(dev_id, port_id, ev, + nb_events); } #ifdef __cplusplus diff --git a/lib/eventdev/rte_event_eth_tx_adapter.h b/lib/eventdev/rte_event_eth_tx_adapter.h index 8c59547165..e3e78a5616 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.h +++ b/lib/eventdev/rte_event_eth_tx_adapter.h @@ -355,28 +355,14 @@ rte_event_eth_tx_adapter_enqueue(uint8_t dev_id, uint16_t nb_events, const uint8_t flags) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG - if (dev_id >= RTE_EVENT_MAX_DEVS || - !rte_eventdevs[dev_id].attached) { - rte_errno = EINVAL; - return 0; - } - - if (port_id >= dev->data->nb_ports) { - rte_errno = EINVAL; - return 0; - } -#endif rte_eventdev_trace_eth_tx_adapter_enqueue(dev_id, port_id, ev, nb_events, flags); if (flags) - return dev->txa_enqueue_same_dest(dev->data->ports[port_id], - ev, nb_events); + return rte_eventdev_api[dev_id].txa_enqueue_same_dest( + dev_id, port_id, ev, nb_events); else - return dev->txa_enqueue(dev->data->ports[port_id], ev, - nb_events); + return rte_eventdev_api[dev_id].txa_enqueue(dev_id, port_id, ev, + nb_events); } /** diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index 1b11d4576d..7378597846 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -1745,30 +1745,17 @@ rte_event_vector_pool_create(const char *name, unsigned int n, static __rte_always_inline uint16_t __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events, - const event_enqueue_burst_t fn) + const rte_event_enqueue_burst_t fn) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG - if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { - rte_errno = EINVAL; - return 0; - } - - if (port_id >= dev->data->nb_ports) { - rte_errno = EINVAL; - return 0; - } -#endif rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn); /* * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one */ if (nb_events == 1) - return (*dev->enqueue)(dev->data->ports[port_id], ev); + return rte_eventdev_api[dev_id].enqueue(dev_id, port_id, ev); else - return fn(dev->data->ports[port_id], ev, nb_events); + return fn(dev_id, port_id, ev, nb_events); } /** @@ -1818,10 +1805,9 @@ static inline uint16_t rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, - dev->enqueue_burst); + return __rte_event_enqueue_burst( + dev_id, port_id, ev, nb_events, + rte_eventdev_api[dev_id].enqueue_burst); } /** @@ -1869,10 +1855,9 @@ static inline uint16_t rte_event_enqueue_new_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, - dev->enqueue_new_burst); + return __rte_event_enqueue_burst( + dev_id, port_id, ev, nb_events, + rte_eventdev_api[dev_id].enqueue_new_burst); } /** @@ -1920,10 +1905,9 @@ static inline uint16_t rte_event_enqueue_forward_burst(uint8_t dev_id, uint8_t port_id, const struct rte_event ev[], uint16_t nb_events) { - const struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - - return __rte_event_enqueue_burst(dev_id, port_id, ev, nb_events, - dev->enqueue_forward_burst); + return __rte_event_enqueue_burst( + dev_id, port_id, ev, nb_events, + rte_eventdev_api[dev_id].enqueue_forward_burst); } /** @@ -1996,30 +1980,17 @@ static inline uint16_t rte_event_dequeue_burst(uint8_t dev_id, uint8_t port_id, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks) { - struct rte_eventdev *dev = &rte_eventdevs[dev_id]; - -#ifdef RTE_LIBRTE_EVENTDEV_DEBUG - if (dev_id >= RTE_EVENT_MAX_DEVS || !rte_eventdevs[dev_id].attached) { - rte_errno = EINVAL; - return 0; - } - - if (port_id >= dev->data->nb_ports) { - rte_errno = EINVAL; - return 0; - } -#endif rte_eventdev_trace_deq_burst(dev_id, port_id, ev, nb_events); /* * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one */ if (nb_events == 1) - return (*dev->dequeue)(dev->data->ports[port_id], ev, - timeout_ticks); + return rte_eventdev_api[dev_id].dequeue(dev_id, port_id, ev, + timeout_ticks); else - return (*dev->dequeue_burst)(dev->data->ports[port_id], ev, - nb_events, timeout_ticks); + return rte_eventdev_api[dev_id].dequeue_burst( + dev_id, port_id, ev, nb_events, timeout_ticks); } #ifdef __cplusplus -- 2.17.1