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 9F025A04DD; Wed, 28 Oct 2020 11:29:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CCAB4CA00; Wed, 28 Oct 2020 11:27:20 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id EB131C9EC for ; Wed, 28 Oct 2020 11:27:14 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A227F5C019C; Wed, 28 Oct 2020 06:27:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 28 Oct 2020 06:27:13 -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=voIRqonoo8ELGewK8WzvfZ3df+CPS EGeN5iNYKhDoAOm4twlO8AGaId6o8NITS5jy4qCgShjvcLxFtbWFKJPMTOgwyNe6 zVbSEi0iHhWLpz1IDa2Asdbrb7iPQiTbBc456WxHuAfD+xJF1Gn+O29zSKJ6/0EB C3QjFnUzVH6rAn4UTteadrjEz7oWJimKh1oPfzJ3VdJaEcuD1XL5snGhUyt4mvao Vg6MqZ8PAGDWfjXXzxsmeQ9fJBIqVu2+6Qkt9J2R1+N6IPeFV7Ns7a8A+a/NHRzw wCPs6zI5izmTQSWBqlU+j+J3ZW8yjh8+hSAbTCtlH3zkQmH/CLvnMiXJw== 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=eXtXqtx3 NnTvLvX6bA3aAgmN2AMDTRPgbXgvCD4diOk4YYeW9dlyghUPnAr4Vxmf3PtZ8vgh byel0JErrWZ6jrt+/bWUTXy829UseWqZexmYGLToOjPt8qwEJldr8Na7Og6Qn2Lq HcRNbw6DYuAhhQW6YC5oUH9ARsFddFx6SEc/YA/PyKPpTqKclqv2/nwUpkhR9Dwi jjyKjTiFXtK+m7EfJTmT3nM55ShkmvWXbrxwywASZ9/NqfzC2GoBAT2TFYogqA4k Ebl8k44HypI4nH+GlOIR0WB1BCbkxbixRPjyrZklxsFCXpOVqvsBgXHcr72hCmc5 tZgxad2dNGejcg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrledugdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgepheenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth 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 A3B0E328005E; Wed, 28 Oct 2020 06:27:12 -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: Wed, 28 Oct 2020 11:26:31 +0100 Message-Id: <20201028102640.3191964-7-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201028102640.3191964-1-thomas@monjalon.net> References: <20201026052105.1561859-1-thomas@monjalon.net> <20201028102640.3191964-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 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