From patchwork Thu Sep 9 12:54:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 98428 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC232A0547; Thu, 9 Sep 2021 14:54:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEA294114F; Thu, 9 Sep 2021 14:54:30 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 936154003E for ; Thu, 9 Sep 2021 14:54:28 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="200306295" X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="200306295" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 05:54:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="606824698" Received: from silpixa00401089.ir.intel.com ([10.55.129.12]) by fmsmga001.fm.intel.com with ESMTP; 09 Sep 2021 05:54:27 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: pravin.pathak@intel.com, timothy.mcdaniel@intel.com, Harry van Haaren Date: Thu, 9 Sep 2021 12:54:21 +0000 Message-Id: <20210909125422.31144-2-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909125422.31144-1-harry.van.haaren@intel.com> References: <20210909125422.31144-1-harry.van.haaren@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/2] lib/eventdev: add usage hints to port configure API 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" This commit introduces 3 flags to the port configuration flags. These flags allow the application to indicate what type of work is expected to be performed by an eventdev port. The three new flags are - RTE_EVENT_PORT_CFG_HINT_PRODUCER (mostly RTE_EVENT_OP_NEW events) - RTE_EVENT_PORT_CFG_HINT_CONSUMER (mostly RTE_EVENT_OP_RELEASE events) - RTE_EVENT_PORT_CFG_HINT_WORKER (mostly RTE_EVENT_OP_FORWARD events) These flags are only hints, and the PMDs must operate under the assumption that any port can enqueue an event with any type of op. Signed-off-by: Harry van Haaren --- lib/eventdev/rte_eventdev.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index a9c496fb62..159b580938 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -709,6 +709,29 @@ rte_event_queue_attr_get(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, * * @see rte_event_port_setup(), rte_event_port_link() */ +#define RTE_EVENT_PORT_CFG_HINT_PRODUCER (1ULL << 2) +/**< Hint that this event port will primarily enqueue events to the system. + * A PMD can optimize its internal workings by assuming that this port is + * primarily going to enqueue NEW events. Note that this flag is only a hint. + * + * @see rte_event_port_setup() + */ +#define RTE_EVENT_PORT_CFG_HINT_CONSUMER (1ULL << 3) +/**< Hint that this event port will primarily dequeue events from the system. + * A PMD can optimize its internal workings by assuming that this port is + * primarily going to consume events, and not enqueue FORWARD or RELEASE events. + * Note that this flag is only a hint. + * + * @see rte_event_port_setup() + */ +#define RTE_EVENT_PORT_CFG_HINT_WORKER (1ULL << 4) +/**< Hint that this event port will primarily events to the system. + * A PMD can optimize its internal workings by assuming that this port is + * primarily going to FORWARD events, and not enqueue NEW or RELEASE events + * often. Note that this flag is only a hint. + * + * @see rte_event_port_setup() + */ /** Event port configuration structure */ struct rte_event_port_conf { From patchwork Thu Sep 9 12:54:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 98429 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3660AA0547; Thu, 9 Sep 2021 14:54:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B7E3A4115F; Thu, 9 Sep 2021 14:54:31 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 431AB4114B for ; Thu, 9 Sep 2021 14:54:30 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="200306300" X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="200306300" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2021 05:54:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,280,1624345200"; d="scan'208";a="606824701" Received: from silpixa00401089.ir.intel.com ([10.55.129.12]) by fmsmga001.fm.intel.com with ESMTP; 09 Sep 2021 05:54:28 -0700 From: Harry van Haaren To: dev@dpdk.org Cc: pravin.pathak@intel.com, timothy.mcdaniel@intel.com, Harry van Haaren Date: Thu, 9 Sep 2021 12:54:22 +0000 Message-Id: <20210909125422.31144-3-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909125422.31144-1-harry.van.haaren@intel.com> References: <20210909125422.31144-1-harry.van.haaren@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/2] examples/eventdev_pipeline: use port config hints 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" This commit adds the per-port hints added to the eventdev API, indicating which eventdev ports will be used for producing, forwarding, or consuming events from the system. Signed-off-by: Harry van Haaren --- examples/eventdev_pipeline/pipeline_worker_generic.c | 2 ++ examples/eventdev_pipeline/pipeline_worker_tx.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/eventdev_pipeline/pipeline_worker_generic.c b/examples/eventdev_pipeline/pipeline_worker_generic.c index f70ab0cc9e..8f43d1f71e 100644 --- a/examples/eventdev_pipeline/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline/pipeline_worker_generic.c @@ -139,6 +139,7 @@ setup_eventdev_generic(struct worker_data *worker_data) .dequeue_depth = cdata.worker_cq_depth, .enqueue_depth = 64, .new_event_threshold = 4096, + .event_port_cfg = RTE_EVENT_PORT_CFG_HINT_WORKER, }; struct rte_event_queue_conf wkr_q_conf = { .schedule_type = cdata.queue_type, @@ -419,6 +420,7 @@ init_adapters(uint16_t nb_ports) .dequeue_depth = cdata.worker_cq_depth, .enqueue_depth = 64, .new_event_threshold = 4096, + .event_port_cfg = RTE_EVENT_PORT_CFG_HINT_PRODUCER, }; if (adptr_p_conf.new_event_threshold > dev_info.max_num_events) diff --git a/examples/eventdev_pipeline/pipeline_worker_tx.c b/examples/eventdev_pipeline/pipeline_worker_tx.c index ca6cd200ca..ad17451a04 100644 --- a/examples/eventdev_pipeline/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline/pipeline_worker_tx.c @@ -446,6 +446,7 @@ setup_eventdev_worker_tx_enq(struct worker_data *worker_data) .dequeue_depth = cdata.worker_cq_depth, .enqueue_depth = 64, .new_event_threshold = 4096, + .event_port_cfg = RTE_EVENT_PORT_CFG_HINT_WORKER, }; struct rte_event_queue_conf wkr_q_conf = { .schedule_type = cdata.queue_type, @@ -747,6 +748,7 @@ init_adapters(uint16_t nb_ports) .dequeue_depth = cdata.worker_cq_depth, .enqueue_depth = 64, .new_event_threshold = 4096, + .event_port_cfg = RTE_EVENT_PORT_CFG_HINT_PRODUCER, }; init_ports(nb_ports);