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 92C1C454FB; Mon, 1 Jul 2024 10:50:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26C5D40A76; Mon, 1 Jul 2024 10:50:56 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 47F664025D for ; Mon, 1 Jul 2024 10:50:54 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id A186C19961 for ; Mon, 1 Jul 2024 10:50:53 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 946E91995F; Mon, 1 Jul 2024 10:50:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=ALL_TRUSTED,AWL, T_SCC_BODY_TEXT_LINE autolearn=disabled version=4.0.0 X-Spam-Score: -1.3 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 7120D19A1F; Mon, 1 Jul 2024 10:50:51 +0200 (CEST) Message-ID: Date: Mon, 1 Jul 2024 10:50:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] eventdev: add support for enqueue reorder To: Abdullah Sevincer , dev@dpdk.org Cc: jerinj@marvell.com, bruce.richardson@intel.com, pravin.pathak@intel.com, mattias.ronnblom@ericsson.com, manish.aggarwal@intel.com, Peter Nilsson , Maria Lingemark References: <20240621201248.504989-2-abdullah.sevincer@intel.com> <20240621222408.583464-1-abdullah.sevincer@intel.com> <20240621222408.583464-3-abdullah.sevincer@intel.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= In-Reply-To: <20240621222408.583464-3-abdullah.sevincer@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2024-06-22 00:24, Abdullah Sevincer wrote: > This commit adds support flag to enable enqueue reorder > feature. > > When this flag is enabled in the port configuration PMD > restores dequeue order on enqueue if applications happen to > change it. > > Signed-off-by: Abdullah Sevincer > --- > lib/eventdev/rte_eventdev.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index 08e5f9320b..f4220dd5dc 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -1073,6 +1073,14 @@ rte_event_queue_attr_set(uint8_t dev_id, uint8_t queue_id, uint32_t attr_id, > * @see rte_event_port_setup() > */ > > +#define RTE_EVENT_PORT_CFG_RESTORE_DEQ_ORDER (1ULL << 5) > +/**< Flag to enable feature enqueue reordering to dequeue. > + * The feature restores dequeue order on enqueue if applications > + * happen to change the order. > + * Add a device-level RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ as well. The documentation of that flag should probably house the detailed description of this feature. Here's how I would describe this feature: #define RTE_EVENT_PORT_CFG_INDEPENDENT_ENQ (1ULL << 5) /**< Flag to enable independent enqueue. Must be unset if the device * is not RTE_EVENT_DEV_CAP_INDEPENDENT_ENQ capable. This feature * allows an application to enqueue RTE_EVENT_OP_FORWARD or * RTE_EVENT_OP_RELEASE in an order different than the order the * events were dequeued from the event device, while maintaining * RTE_SCHED_TYPE_ATOMIC or RTE_SCHED_TYPE_ORDERED semantics. * * If the application wish to change the order of two events *within * a flow*, it must both change the enqueue order and exchange the * impl_opaque field, to be portable across all event devices. */ That second paragraph allows DSW to support this feature without modification, since this is the only difference between DSW-style independent enqueue, and DLB enqueue reordering. DLB will restore a total order, while DSW doesn't (since it would be both pointless and costly, given its design). The upside with DSW-style implementation is that it's very simple and efficient, and does not impose any head-of-line blocking (which follows from restoring a total order between dequeue and enqueue). The downside is it does not allow for a scenario where a particular flow is split across different modules, the application performs reordering (e.g., with the dispatcher library) *and* wants to maintain ordering between events pertaining to those "sub flows". I've never come across such a scenario, but it may well exist. If we fail to make DLB2 and DSW compatible, we'll probably need another flag for DSW, because needlessly imposing a total order DSW does not make a lot of sense. You may want to add an example as well. And a note on the importance of maintaining impl_opaque between dequeue and enqueue. > + * @see rte_event_port_setup() > + */ > + > /** Event port configuration structure */ > struct rte_event_port_conf { > int32_t new_event_threshold;