From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E166A0597; Wed, 8 Apr 2020 19:57:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7EF021C1D7; Wed, 8 Apr 2020 19:57:25 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by dpdk.org (Postfix) with ESMTP id A7FF01C1D0 for ; Wed, 8 Apr 2020 19:57:22 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 4FCF140029 for ; Wed, 8 Apr 2020 19:57:22 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 3777940027; Wed, 8 Apr 2020 19:57:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.4.2 X-Spam-Score: -0.9 Received: from isengard.friendlyfire.se (host-95-205-2-251.mobileonline.telia.com [95.205.2.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 2DFB040017; Wed, 8 Apr 2020 19:57:20 +0200 (CEST) From: =?UTF-8?q?Mattias=20R=C3=B6nnblom?= To: dev@dpdk.org, Jerin Jacob Cc: Gage Eads , Bruce Richardson , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= Date: Wed, 8 Apr 2020 19:56:54 +0200 Message-Id: <20200408175655.18879-2-mattias.ronnblom@ericsson.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200408175655.18879-1-mattias.ronnblom@ericsson.com> References: <20200408175655.18879-1-mattias.ronnblom@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [RFC 2/3] event/dsw: make use of eventdev maintenance facility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Set the RTE_EVENT_DEV_CAP_REQUIRES_MAINT flag, and perform DSW background tasks on rte_event_maintain() calls. Signed-off-by: Mattias Rönnblom --- drivers/event/dsw/dsw_evdev.c | 4 +++- drivers/event/dsw/dsw_evdev.h | 1 + drivers/event/dsw/dsw_event.c | 8 ++++++++ lib/librte_eventdev/rte_eventdev.h | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/event/dsw/dsw_evdev.c b/drivers/event/dsw/dsw_evdev.c index 7798a38ad..ebacad2d6 100644 --- a/drivers/event/dsw/dsw_evdev.c +++ b/drivers/event/dsw/dsw_evdev.c @@ -223,7 +223,8 @@ dsw_info_get(struct rte_eventdev *dev __rte_unused, .event_dev_cap = RTE_EVENT_DEV_CAP_BURST_MODE| RTE_EVENT_DEV_CAP_DISTRIBUTED_SCHED| RTE_EVENT_DEV_CAP_NONSEQ_MODE| - RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT + RTE_EVENT_DEV_CAP_MULTIPLE_QUEUE_PORT| + RTE_EVENT_DEV_CAP_REQUIRES_MAINT }; } @@ -411,6 +412,7 @@ dsw_probe(struct rte_vdev_device *vdev) dev->enqueue_forward_burst = dsw_event_enqueue_forward_burst; dev->dequeue = dsw_event_dequeue; dev->dequeue_burst = dsw_event_dequeue_burst; + dev->maintain = dsw_event_maintain; if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; diff --git a/drivers/event/dsw/dsw_evdev.h b/drivers/event/dsw/dsw_evdev.h index 5c7b6108d..deef5061a 100644 --- a/drivers/event/dsw/dsw_evdev.h +++ b/drivers/event/dsw/dsw_evdev.h @@ -246,6 +246,7 @@ uint16_t dsw_event_enqueue_forward_burst(void *port, uint16_t dsw_event_dequeue(void *port, struct rte_event *ev, uint64_t wait); uint16_t dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, uint64_t wait); +void dsw_event_maintain(void *port); int dsw_xstats_get_names(const struct rte_eventdev *dev, enum rte_event_dev_xstats_mode mode, diff --git a/drivers/event/dsw/dsw_event.c b/drivers/event/dsw/dsw_event.c index d68b71b98..9c0669e1d 100644 --- a/drivers/event/dsw/dsw_event.c +++ b/drivers/event/dsw/dsw_event.c @@ -1254,3 +1254,11 @@ dsw_event_dequeue_burst(void *port, struct rte_event *events, uint16_t num, return dequeued; } + +void dsw_event_maintain(void *port) +{ + struct dsw_port *source_port = port; + struct dsw_evdev *dsw = source_port->dsw; + + dsw_port_bg_process(dsw, source_port); +} diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h index d69150792..00a9380d9 100644 --- a/lib/librte_eventdev/rte_eventdev.h +++ b/lib/librte_eventdev/rte_eventdev.h @@ -1235,7 +1235,7 @@ typedef uint16_t (*event_dequeue_burst_t)(void *port, struct rte_event ev[], uint16_t nb_events, uint64_t timeout_ticks); /**< @internal Dequeue burst of events from port of a device */ -typedef void (*maintain_t)(void *port); +typedef void (*event_maintain_t)(void *port); /**< @internal Maintains a port */ typedef uint16_t (*event_tx_adapter_enqueue)(void *port, -- 2.20.1