From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0BFD9A0096 for ; Mon, 3 Jun 2019 19:37:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7428D1BAD7; Mon, 3 Jun 2019 19:36:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 4EB961B9CB for ; Mon, 3 Jun 2019 19:35:57 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x53HKk5V027666; Mon, 3 Jun 2019 10:35:56 -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=pfpt0818; bh=1Am5+Qi78BYOKz5RjsWK6JT/VNh3BhakAh0d/utZAZ8=; b=weoObc91XRpEWthrd/iwhPd1gi+YdQ3bk++GW2M4OvDx/e+90aQFC7B7Z2YQ/DxAQ5KX wEUcyJsac8Kd9z8XDK02+q5ln3g/mrotuh41Hn2fK5dnziUhjB0LzMMjwsXkDVY+OR/3 M7MFUaO9GVxlPArs1soswoypmxJWWoUD1cAWQ84F6hv0ls5bKiVeDKbm+q7/0klSCtE5 71s8SF9eHTSiHE0jofQW5KO049p0YMDnQL51k+TARW+c/TAiSIlZ+q8qivLAm8YminjR OZz0vlkRODKTTDjvQBX7KChItJLHc+tkKZSYmJyecgjzHu5t6fRyZk5nOHgVAjqyNCeR 3A== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr70c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2019 10:35:56 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 3 Jun 2019 10:35:27 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 3 Jun 2019 10:35:26 -0700 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56]) by maili.marvell.com (Postfix) with ESMTP id 5A7563F703F; Mon, 3 Jun 2019 10:35:21 -0700 (PDT) From: Anoob Joseph To: Jerin Jacob , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Anoob Joseph , Narayana Prasad , , Lukasz Bartosik , Pavan Nikhilesh , Hemant Agrawal , "Nipun Gupta" , Harry van Haaren , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Liang Ma Date: Mon, 3 Jun 2019 23:02:21 +0530 Message-ID: <1559583160-13944-22-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559583160-13944-1-git-send-email-anoobj@marvell.com> References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-03_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 21/39] eventdev: add eventdev port-lcore link 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" Adding eventdev port-lcore link. In addition, this will also specify which event queue need to be connected to the event port. Signed-off-by: Anoob Joseph Signed-off-by: Lukasz Bartosik --- lib/librte_eventdev/rte_eventmode_helper.c | 22 ++++++++++++++++++++++ lib/librte_eventdev/rte_eventmode_helper.h | 12 ++++++++++++ .../rte_eventmode_helper_internal.h | 12 ++++++++++++ 3 files changed, 46 insertions(+) diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c index bebcfb9..ec0be44 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -165,10 +165,12 @@ rte_eventmode_helper_initialize_eventdev(struct eventmode_conf *em_conf) struct rte_event_dev_config eventdev_conf; struct rte_event_dev_info evdev_default_conf; struct rte_event_queue_conf eventq_conf = {0}; + struct rte_eventmode_helper_event_link_info *link; struct eventdev_params *eventdev_config; int nb_eventdev = em_conf->nb_eventdev; int nb_eventqueue; uint8_t eventdev_id; + uint8_t *queue = NULL; for (i = 0; i < nb_eventdev; i++) { @@ -259,6 +261,26 @@ rte_eventmode_helper_initialize_eventdev(struct eventmode_conf *em_conf) } } + /* Make event queue - event port link */ + for (j = 0; j < em_conf->nb_link; j++) { + + /* Get link info */ + link = &(em_conf->link[j]); + + /* Get event dev ID */ + eventdev_id = link->eventdev_id; + + queue = &(link->eventq_id); + + /* Link queue to port */ + ret = rte_event_port_link(eventdev_id, link->event_portid, + queue, NULL, 1); + if (ret < 0) { + RTE_EM_HLPR_LOG_ERR("Error in event port linking"); + return ret; + } + } + /* Start event devices */ for (i = 0; i < nb_eventdev; i++) { diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h index 0eafed3..1ae6a15 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.h +++ b/lib/librte_eventdev/rte_eventmode_helper.h @@ -29,6 +29,18 @@ struct rte_eventmode_helper_conf { /**< Mode specific parameters */ }; +/* Event-lcore link conf */ +struct rte_eventmode_helper_event_link_info { + uint8_t eventdev_id; + /**< Event device ID */ + uint8_t event_portid; + /**< Event port ID */ + uint8_t eventq_id; + /**< Event queue to be linked to the port */ + uint8_t lcore_id; + /**< Lcore to be polling on this port */ +}; + /* Common helper functions for command line parsing */ /** diff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h index 0b4ec59..ee41833 100644 --- a/lib/librte_eventdev/rte_eventmode_helper_internal.h +++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h @@ -35,6 +35,13 @@ /* Max event devices supported */ #define EVENT_MODE_MAX_EVENT_DEVS RTE_EVENT_MAX_DEVS +/* Max event queues supported per event device */ +#define EVENT_MODE_MAX_EVENT_QUEUES_PER_DEV RTE_EVENT_MAX_QUEUES_PER_DEV + +/* Max event-lcore links */ +#define EVENT_MODE_MAX_LCORE_LINKS \ + (EVENT_MODE_MAX_EVENT_DEVS * EVENT_MODE_MAX_EVENT_QUEUES_PER_DEV) + /* Event dev params */ struct eventdev_params { uint8_t eventdev_id; @@ -49,6 +56,11 @@ struct eventmode_conf { /**< No of event devs */ struct eventdev_params eventdev_config[EVENT_MODE_MAX_EVENT_DEVS]; /**< Per event dev conf */ + uint8_t nb_link; + /**< No of links */ + struct rte_eventmode_helper_event_link_info + link[EVENT_MODE_MAX_LCORE_LINKS]; + /**< Per link conf */ }; #endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */ -- 2.7.4