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 4F724A04B5; Mon, 26 Oct 2020 10:40:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D5FE2B9E; Mon, 26 Oct 2020 10:40:17 +0100 (CET) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 1522529C6 for ; Mon, 26 Oct 2020 10:40:15 +0100 (CET) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201026094003euoutp01e5dd3f6f8314b90e4d9835a440503cc5~BgWK3ggza2397623976euoutp01E for ; Mon, 26 Oct 2020 09:40:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201026094003euoutp01e5dd3f6f8314b90e4d9835a440503cc5~BgWK3ggza2397623976euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603705203; bh=Mhxrobx4rpIRwOitLvszjQ9SuJdrWlYZaCGnWnzotJE=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=aM0CtsN2bZCpcwfam8EzXohMn27HAQ0astImVfpcBnLiQcDNmVJHzItzvB5d6FgwT ooxsX7Ql5wjkytpeinXqaEBUBuCYjXuvt9OquJCcIO5FBdHt6avXCNK9j9/nraRrho eQXXE68uASXfsyua4RIKELc4xBjoHrX02SgZ2NKA= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201026093958eucas1p1b05ff682bd5882b6be9b0ed9972216fe~BgWF84r791200312003eucas1p1x; Mon, 26 Oct 2020 09:39:58 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 39.E1.05997.D69969F5; Mon, 26 Oct 2020 09:39:57 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201026093957eucas1p100f640fabe970294bb5513f16c7f98b8~BgWFrf4DF2083020830eucas1p1u; Mon, 26 Oct 2020 09:39:57 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201026093957eusmtrp25c16442a19fedcd48dba1fa14f20a7ce~BgWFq26_72383523835eusmtrp2W; Mon, 26 Oct 2020 09:39:57 +0000 (GMT) X-AuditID: cbfec7f4-677ff7000000176d-4b-5f96996d80fe Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id CF.C5.06314.D69969F5; Mon, 26 Oct 2020 09:39:57 +0000 (GMT) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20201026093956eusmtip21629a19c2d0b78ab6d6079d112e8b61f~BgWEq4r5Y1246412464eusmtip2a; Mon, 26 Oct 2020 09:39:56 +0000 (GMT) To: Thomas Monjalon , 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, David Hunt From: Lukasz Wojciechowski Message-ID: <4cd5bf70-9a0c-ce1f-2bcf-8aa8c34173e1@partner.samsung.com> Date: Mon, 26 Oct 2020 10:39:56 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: <20201026052105.1561859-11-thomas@monjalon.net> Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01SaUhUYRTte+/NzHNw5Dkq3jQIBipscamoR9pK2fyIsCShTM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otPD06wOHB6XOy/w+jxa8FSVo/Fe14y eRy7OY3dY+O7HUwe17++YvV4v+8qWwB7lJ5NUX5pSapCRn5xia1StKGFkZ6hpYWekYmlnqGx eayVkamSvp1NSmpOZllqkb5dgl7G+q0HmAsWSVUcubOGsYHxgkgXIyeHhICJxMyf+1m6GLk4 hASWMkqsOjyRuYuRAyghI/HhkgBEjbDEn2tdbBA1rxkl3n1YxgqSEBaIlzi8ZycziC0iYC6x /+lHdpAiZoFjjBLz581khug4wCjR9uwrE0gVm4CtxJGZX8G6eQXcJB4v2M0CYrMIqEo8ff2e HcQWFYiT+DGxlw2iRlDi5MwnYDWcAjYSi88dBqthFjCTmLf5ITOELS/RvHU2lC0ucevJfKYJ jEKzkLTPQtIyC0nLLCQtCxhZVjGKpJYW56bnFhvqFSfmFpfmpesl5+duYgTG57ZjPzfvYLy0 MfgQowAHoxIP7441U+OFWBPLiitzDzFKcDArifA6nT0dJ8SbklhZlVqUH19UmpNafIjRFOi5 icxSosn5wNSRVxJvaGpobmFpaG5sbmxmoSTO2yFwMEZIID2xJDU7NbUgtQimj4mDU6qBccEa v/QvvUuNzb3SDtlc/NzVm1fMvPyk7gEF809P1b5zz5NarMZ2+8ClbVmfpNt6uc7I+TwLzuFa uZNrpVulr03eJZZS/sWvg+6sChJ/V2x1+O3XJUtnpHtMZZgUJ1Z/0v62yXT35qB8ocONn423 J/+8yLegekKeTHmbVdwqg80i9xTf29qlKbEUZyQaajEXFScCANCWvATlAgAA X-CMS-MailID: 20201026093957eucas1p100f640fabe970294bb5513f16c7f98b8 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201026052514eucas1p182fc521cf0c7c29c9cea0d566532ca24 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201026052514eucas1p182fc521cf0c7c29c9cea0d566532ca24 References: <20201026052105.1561859-1-thomas@monjalon.net> <20201026052105.1561859-11-thomas@monjalon.net> Subject: Re: [dpdk-dev] [PATCH 10/15] test/distributor: switch sequence 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" Changes in distributor tests look good. All tests pass W dniu 26.10.2020 o 06:21, Thomas Monjalon pisze: > The test 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 Acked-by: Lukasz Wojciechowski Tested-by: Lukasz Wojciechowski > --- > app/test/test_distributor.c | 27 ++++++++++++++++++++++----- > 1 file changed, 22 insertions(+), 5 deletions(-) > > diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c > index eb889b91d1..074a06f4a2 100644 > --- a/app/test/test_distributor.c > +++ b/app/test/test_distributor.c > @@ -10,6 +10,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -17,6 +18,10 @@ > #define BURST 32 > #define BIG_BATCH 1024 > > +static int seq_dynfield_offset; > +#define SEQ_FIELD(mbuf) \ > + (*RTE_MBUF_DYNFIELD(mbuf, seq_dynfield_offset, uint32_t *)) > + > struct worker_params { > char name[64]; > struct rte_distributor *dist; > @@ -578,7 +583,7 @@ handle_and_mark_work(void *arg) > __atomic_fetch_add(&worker_stats[id].handled_packets, num, > __ATOMIC_RELAXED); > for (i = 0; i < num; i++) > - buf[i]->udata64 += id + 1; > + SEQ_FIELD(buf[i]) += id + 1; > num = rte_distributor_get_pkt(db, id, > buf, buf, num); > } > @@ -631,10 +636,10 @@ sanity_mark_test(struct worker_params *wp, struct rte_mempool *p) > << shift; > } > /* Assign a sequence number to each packet. The sequence is shifted, > - * so that lower bits of the udate64 will hold mark from worker. > + * so that lower bits will hold mark from worker. > */ > for (i = 0; i < buf_count; i++) > - bufs[i]->udata64 = i << seq_shift; > + SEQ_FIELD(bufs[i]) = i << seq_shift; > > count = 0; > for (i = 0; i < buf_count/burst; i++) { > @@ -660,8 +665,8 @@ sanity_mark_test(struct worker_params *wp, struct rte_mempool *p) > > /* Sort returned packets by sent order (sequence numbers). */ > for (i = 0; i < buf_count; i++) { > - seq = returns[i]->udata64 >> seq_shift; > - id = returns[i]->udata64 - (seq << seq_shift); > + seq = SEQ_FIELD(returns[i]) >> seq_shift; > + id = SEQ_FIELD(returns[i]) - (seq << seq_shift); > sorted[seq] = id; > } > > @@ -805,6 +810,18 @@ test_distributor(void) > static struct rte_mempool *p; > int i; > > + static const struct rte_mbuf_dynfield seq_dynfield_desc = { > + .name = "test_distributor_dynfield_seq", > + .size = sizeof(uint32_t), > + .align = __alignof__(uint32_t), > + }; > + seq_dynfield_offset = > + rte_mbuf_dynfield_register(&seq_dynfield_desc); > + if (seq_dynfield_offset < 0) { > + printf("Error registering mbuf field\n"); > + return TEST_FAILED; > + } > + > if (rte_lcore_count() < 2) { > printf("Not enough cores for distributor_autotest, expecting at least 2\n"); > return TEST_SKIPPED; -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com