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 B8C1DA04B5; Tue, 27 Oct 2020 22:03:39 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7415F2C2A; Tue, 27 Oct 2020 22:01:58 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 59E9E2C2A for ; Tue, 27 Oct 2020 22:01:56 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 027955C0107; Tue, 27 Oct 2020 17:01:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 27 Oct 2020 17:01:55 -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=1UzBR21QvXDgt S81e9z9w66hiO7pk6hmwzzFEMFIFjY=; b=fqvICvO9ALB6YTdXz/Yp4GkcaKejz OtMhqgqh4N1WckuKZmlg2KT2yPFdm2XJsAB/c8udwxH7sWqT782IahTirKw0p81S 1uICUv+181ciqwlYbbv8KFp0XCYJXkGus3F8c0A8/PhIJj6RH8Yv4UdVhMRMIvcr jTRwuYDzx+Yk/TQBMuAUBWJnqMj2vfa/ajJgLxMoSd2uH07msZ+/5MP+fMQyx0E2 oil57NsnkZsXhy+QAV72ZqOCge2v+5cE5Zs7qZcGsCcJL8DIFTwke0IzDIRrHIGH Zi0sxXEhaUhqIyGkd/GLQDFgujEGFCV1zEcMp9WpXsQlsUcQb4M/EFFHA== 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=1UzBR21QvXDgtS81e9z9w66hiO7pk6hmwzzFEMFIFjY=; b=N48kXv5W 0b5xBC7Gg4ESaa8IoUcI9340ueq96dOhB4hChDHECyULNc50VZintN7f9441ERH1 AmP/V4LgjGW6kZzbhzJYqrLZg8+C3k20AY8QrzXp/com0XnQbfj44qQ6yxY7DYq1 GOZOgMH5CFl1CHmXUohJYVNYsEquzoEXbowpRV8myXhWLZSas7/5K103EngZuefO 3740RA5GiHMtfmwkd4VXP3JWuDuE0VLTRUieMcuD93oon55Cmhoch/nxPlGTuo1z Qy4aqIJw9tme/JdO6vDNzdFMIPb1ucPaIpfZZ61R/bqC7Xmz5Pv8l4LB+88iMjHL R0TAmLsB80HS+w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrkeelgddugeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl 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 E15D5328005A; Tue, 27 Oct 2020 17:01:53 -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, Harry van Haaren Date: Tue, 27 Oct 2020 22:01:06 +0100 Message-Id: <20201027210115.2529025-7-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201027210115.2529025-1-thomas@monjalon.net> References: <20201026052105.1561859-1-thomas@monjalon.net> <20201027210115.2529025-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 06/15] event/sw: switch test counter 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 test worker_loopback used the deprecated mbuf field udata64. It is moved to a dynamic field in order to allow removal of udata64. Signed-off-by: Thomas Monjalon Reviewed-by: Andrew Rybchenko --- drivers/event/sw/sw_evdev_selftest.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c index 5c7e527917..ad4fc0eed7 100644 --- a/drivers/event/sw/sw_evdev_selftest.c +++ b/drivers/event/sw/sw_evdev_selftest.c @@ -40,6 +40,11 @@ struct test { uint32_t service_id; }; +typedef uint8_t counter_dynfield_t; +static int counter_dynfield_offset = -1; +#define COUNTER_FIELD(mbuf) (*RTE_MBUF_DYNFIELD(mbuf, \ + counter_dynfield_offset, counter_dynfield_t *)) + static struct rte_event release_ev; static inline struct rte_mbuf * @@ -2987,8 +2992,8 @@ worker_loopback_worker_fn(void *arg) } ev[i].queue_id = 0; - ev[i].mbuf->udata64++; - if (ev[i].mbuf->udata64 != 16) { + COUNTER_FIELD(ev[i].mbuf)++; + if (COUNTER_FIELD(ev[i].mbuf) != 16) { ev[i].op = RTE_EVENT_OP_FORWARD; enqd = rte_event_enqueue_burst(evdev, port, &ev[i], 1); @@ -3028,7 +3033,7 @@ worker_loopback_producer_fn(void *arg) m = rte_pktmbuf_alloc(t->mbuf_pool); } while (m == NULL); - m->udata64 = 0; + COUNTER_FIELD(m) = 0; struct rte_event ev = { .op = RTE_EVENT_OP_NEW, @@ -3061,6 +3066,18 @@ worker_loopback(struct test *t, uint8_t disable_implicit_release) int err; int w_lcore, p_lcore; + static const struct rte_mbuf_dynfield counter_dynfield_desc = { + .name = "rte_event_sw_dynfield_selftest_counter", + .size = sizeof(counter_dynfield_t), + .align = __alignof__(counter_dynfield_t), + }; + counter_dynfield_offset = + rte_mbuf_dynfield_register(&counter_dynfield_desc); + if (counter_dynfield_offset < 0) { + printf("Error registering mbuf field\n"); + return -rte_errno; + } + if (init(t, 8, 2) < 0 || create_atomic_qids(t, 8) < 0) { printf("%d: Error initializing device\n", __LINE__); -- 2.28.0