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 68B23A04DD; Mon, 26 Oct 2020 23:24:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D3A24F9C; Mon, 26 Oct 2020 23:20:59 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 1E33E4C8B for ; Mon, 26 Oct 2020 23:20:51 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id C42E95C0057; Mon, 26 Oct 2020 18:20:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 26 Oct 2020 18:20:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=UrSLqDWj1E199 Is1z7hyUMYMsw1AsrsjZJC9exhsLpE=; b=tGvSQVZYWI1wPNAYNp2deHkfuA3Q1 dxVedCY7OsjbYkOnQzX0mvzoI1Rq0bBE19XKygTSr7r0j45klijmypnixyRKpKvg /c5wr2gLNuN6HTyAQTWRQXNdyp9q19ffLZfCzfBkunjxZHD90Z6DVAht1V6245Km vPqOu9ftiBy2nWGoxd5B7PT+48mKdmnWaiGj1exOcWpWieUULcKUbnkULmP4WWNn 0OyvxXyQPTJt1abBwaCazSMY58o6osvY7Q3mNap6wM7aOjF+OMidgYFcYbDCFZqf voH4dIY9LQEtSWuZi5nKJ+3YtlNW/V4MZgTGk9qlc2ejrJIEDoKkUJHtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=UrSLqDWj1E199Is1z7hyUMYMsw1AsrsjZJC9exhsLpE=; b=jvK5Ed9y mszmCKdUsmWpfRHzAEUUMJ2+5r9E4ohRmnqhROlW047xnxX/gJ3BmivrCcTyQNRN Y4Lcwf3s9pMZ71zD6GuWxlc3e/mwVahOr0fbYFPqeutjY+Kr9qpmNVqfmYjjusT+ 0jHDvrcehO4BnI1ucoVRgTr1WMJgSd4rs/nZRiPTy4kjNpfLQpeLSB4B2j9ReHMw ete51upQdpnBT38V8swv7zON455I7+iAXuFaA05TaMVr+CVkzV35g1snax6VXa1y gignHEgDaaV6bXa5hF36CClkv0oXObHEcMNnQVcIBmei2Of55aA9Y6NEXkB+zFOc Sm/Tq8t8p1jxzQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkeejgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeelnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id C71963064680; Mon, 26 Oct 2020 18:20:48 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@intel.com, david.marchand@redhat.com, bruce.richardson@intel.com, olivier.matz@6wind.com, andrew.rybchenko@oktetlabs.ru, akhil.goyal@nxp.com, Jerin Jacob Date: Mon, 26 Oct 2020 23:20:10 +0100 Message-Id: <20201026222013.2147904-13-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201026222013.2147904-1-thomas@monjalon.net> References: <20201026052105.1561859-1-thomas@monjalon.net> <20201026222013.2147904-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 12/15] app/eventdev: switch flow ID to dynamic mbuf field 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" The order test stored the flow ID in the deprecated mbuf field udata64. It is moved to a dynamic field in order to allow removal of udata64. Signed-off-by: Thomas Monjalon --- app/test-eventdev/test_order_atq.c | 4 ++-- app/test-eventdev/test_order_common.c | 16 +++++++++++++++- app/test-eventdev/test_order_common.h | 6 ++++++ app/test-eventdev/test_order_queue.c | 4 ++-- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/app/test-eventdev/test_order_atq.c b/app/test-eventdev/test_order_atq.c index cfcb1dc4e9..4087c26fc5 100644 --- a/app/test-eventdev/test_order_atq.c +++ b/app/test-eventdev/test_order_atq.c @@ -35,7 +35,7 @@ order_atq_worker(void *arg, const bool flow_id_cap) } if (!flow_id_cap) - ev.flow_id = ev.mbuf->udata64; + ev.flow_id = FLOW_ID(ev.mbuf); if (ev.sub_event_type == 0) { /* stage 0 from producer */ order_atq_process_stage_0(&ev); @@ -72,7 +72,7 @@ order_atq_worker_burst(void *arg, const bool flow_id_cap) for (i = 0; i < nb_rx; i++) { if (!flow_id_cap) - ev[i].flow_id = ev[i].mbuf->udata64; + ev[i].flow_id = FLOW_ID(ev[i].mbuf); if (ev[i].sub_event_type == 0) { /*stage 0 */ order_atq_process_stage_0(&ev[i]); diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c index dc55d93921..3721dbabd9 100644 --- a/app/test-eventdev/test_order_common.c +++ b/app/test-eventdev/test_order_common.c @@ -4,6 +4,8 @@ #include "test_order_common.h" +int flow_id_dynfield_offset; + int order_test_result(struct evt_test *test, struct evt_options *opt) { @@ -49,7 +51,7 @@ order_producer(void *arg) const uint32_t flow = (uintptr_t)m % nb_flows; /* Maintain seq number per flow */ m->seqn = producer_flow_seq[flow]++; - m->udata64 = flow; + FLOW_ID(m) = flow; ev.flow_id = flow; ev.mbuf = m; @@ -139,6 +141,18 @@ order_test_setup(struct evt_test *test, struct evt_options *opt) { void *test_order; + static const struct rte_mbuf_dynfield flow_id_dynfield_desc = { + .name = "test_event_dynfield_flow_id", + .size = sizeof(FLOW_ID_TYPE), + .align = __alignof__(FLOW_ID_TYPE), + }; + flow_id_dynfield_offset = + rte_mbuf_dynfield_register(&flow_id_dynfield_desc); + if (flow_id_dynfield_offset < 0) { + evt_err("failed to register mbuf field"); + return -rte_errno; + } + test_order = rte_zmalloc_socket(test->name, sizeof(struct test_order), RTE_CACHE_LINE_SIZE, opt->socket_id); if (test_order == NULL) { diff --git a/app/test-eventdev/test_order_common.h b/app/test-eventdev/test_order_common.h index e0fe9c968a..e384856710 100644 --- a/app/test-eventdev/test_order_common.h +++ b/app/test-eventdev/test_order_common.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "evt_common.h" #include "evt_options.h" @@ -20,6 +21,11 @@ #define BURST_SIZE 16 +extern int flow_id_dynfield_offset; +#define FLOW_ID_TYPE uint32_t +#define FLOW_ID(mbuf) (*RTE_MBUF_DYNFIELD(mbuf, \ + flow_id_dynfield_offset, FLOW_ID_TYPE *)) + struct test_order; struct worker_data { diff --git a/app/test-eventdev/test_order_queue.c b/app/test-eventdev/test_order_queue.c index 1511c0092d..80c9c24af5 100644 --- a/app/test-eventdev/test_order_queue.c +++ b/app/test-eventdev/test_order_queue.c @@ -35,7 +35,7 @@ order_queue_worker(void *arg, const bool flow_id_cap) } if (!flow_id_cap) - ev.flow_id = ev.mbuf->udata64; + ev.flow_id = FLOW_ID(ev.mbuf); if (ev.queue_id == 0) { /* from ordered queue */ order_queue_process_stage_0(&ev); @@ -73,7 +73,7 @@ order_queue_worker_burst(void *arg, const bool flow_id_cap) for (i = 0; i < nb_rx; i++) { if (!flow_id_cap) - ev[i].flow_id = ev[i].mbuf->udata64; + ev[i].flow_id = FLOW_ID(ev[i].mbuf); if (ev[i].queue_id == 0) { /* from ordered queue */ order_queue_process_stage_0(&ev[i]); -- 2.28.0