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 6880441EAC; Thu, 16 Mar 2023 09:50:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EA4B40FDF; Thu, 16 Mar 2023 09:50:09 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id EFAA040EF1 for ; Thu, 16 Mar 2023 09:50:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678956607; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ABk2LQNzAWJko8/KRPhucWdE7W6neNuQhESwQZWhCf0=; b=I/H9aT382T6XijFbt4wYXaxArwzlr/jHx2DaTtGs/Pkr9ulEVysPHvHx9lVBZycXr2Tqfl P3b2PdMEHhLv5KEiYwf8Wa0mROPk4QpCTsq9jx7qFIaAM3QR/rkXRjTC/yUrP9Qtm0o/vk q/w2Z7QvxrsS1JgArZMTse5+4wuPuMc= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-60-5O7iQ1HoPzujW4DvmaYmzA-1; Thu, 16 Mar 2023 04:50:06 -0400 X-MC-Unique: 5O7iQ1HoPzujW4DvmaYmzA-1 Received: by mail-pl1-f199.google.com with SMTP id z16-20020a170902d55000b001a06f9b5e31so630972plf.21 for ; Thu, 16 Mar 2023 01:50:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678956605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ABk2LQNzAWJko8/KRPhucWdE7W6neNuQhESwQZWhCf0=; b=2o8ljo68ZhJ/yjQRNfg5B7zGL6v4hw7GTmISEJBS2gFAUFvj/9839iiFUHk6BfJVjA 79IdKwQIVWdj6S2pxSO8Q3d/S4FUW/Wx1TcWLZ/JwdQ4+mwRDa4TgrdnbG2JQsraFuBG qLIK6icMMyIZA3DdKt1ynltfanCdDMHufWJ7rpImAT3AeIMwX+MAZSkPuv4uvgbj3+VN 6l9VqlV7p1JK7fhrGWav17zWoFyCx7jBR1UDg1+3T3ntJ5O7U9An6P9FjuVgeNtPJ10C 0jftTlbE2b9/kMicIzeDym85rBqA+1VVceJ0zYk/z6O9sb99XMCbjjtmj2Dd9j3ajuzt a5mQ== X-Gm-Message-State: AO0yUKVY/OeC3L2bKVw9yBIi6bEDxttwKqARCHWf1neNVjtMRJ19V3U5 ATQ63MwFgwHByohdBxZN/myriP5beBFuCGtn/F8VL6LtRwuXf2DR4SkX3lupwSbd0g7CKzXzWnK MiipTUIfxXmi3zRqKbw4= X-Received: by 2002:a05:6a00:2343:b0:61c:67d2:a332 with SMTP id j3-20020a056a00234300b0061c67d2a332mr1227865pfj.3.1678956605095; Thu, 16 Mar 2023 01:50:05 -0700 (PDT) X-Google-Smtp-Source: AK7set8cbgf7U/ncVFYJMaj2h05uu8ihV8BV9bOeRtCqFA04S0bTpbbMmLos+d7c1VWNCmilqtY/zNo+wY6EHnippWs= X-Received: by 2002:a05:6a00:2343:b0:61c:67d2:a332 with SMTP id j3-20020a056a00234300b0061c67d2a332mr1227855pfj.3.1678956604700; Thu, 16 Mar 2023 01:50:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Thu, 16 Mar 2023 09:49:53 +0100 Message-ID: Subject: Re: Meson buildtype for ci jobs? To: Patrick Robb , Honnappa Nagarahalli , Konstantin Ananyev Cc: "Richardson, Bruce" , "ci@dpdk.org" , Aaron Conole , Thomas Monjalon , dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Adding dev@ mailing list and ring maintainers, On Wed, Mar 15, 2023 at 8:13=E2=80=AFPM Patrick Robb wr= ote: >> >> Would passing "-Ddebug=3Dtrue" be better than changing the default build= type? >> It's possible to have a release build (i.e. O3 optimized) with debug inf= o. > > > Strangely, even with -Ddebug true if I'm running buildtype "release" it r= eturns the same warnings. I'm inferring from your comment that release opti= mization =3D=3D debugoptimized optimization and debug behavior from -Ddebug= =3Dtrue =3D=3D debug behavior from debugoptimized, so release buildtype + d= ebug "should" have the same behavior as just setting buildtype debugoptimiz= ed, and yet... > > I'll have to look into this a little more. Hopefully by the end I'll be l= ike David and understand the relations between these flags better, hah. As for how buildtype, optimizations and debug params are concerned, the summary is here: https://mesonbuild.com/Builtin-options.html#details-for-buildtype In my tests this morning with a Alpine container, I noticed that setting -Dplatform to native makes the issue disappear... So an additional factor is building with platform=3Dgeneric. ~/dpdk # meson configure build | awk '{if ($1 ~ /^(buildtype|platform|debug|optimization)$/) { print $0; }}' buildtype debug [plain, debug, debugoptimized, release, minsize, custom] Build type to use debug true [true, false] Debug optimization 0 [0, g, 1, 2, 3, s] Optimization level platform generic Platform to build, either "native", "generic" or a SoC. Please refer to the Linux build guide for more information. ... In file included from ../lib/ring/rte_ring_elem.h:24, from ../lib/ring/rte_ring.h:43, from ../lib/mempool/rte_mempool.h:47, from ../lib/mbuf/rte_mbuf.h:38, from ../lib/net/rte_ether.h:22, from ../lib/ethdev/rte_eth_ctrl.h:10, from ../lib/ethdev/rte_ethdev.h:1421, from ../app/test/test_event_timer_adapter.c:14: In function '__rte_ring_enqueue_elems_128', inlined from '__rte_ring_enqueue_elems' at ../lib/ring/rte_ring_elem_pvt.h:132:3, inlined from '__rte_ring_do_enqueue_elem' at ../lib/ring/rte_ring_elem_pvt.h:328:2, inlined from 'rte_ring_mp_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:134:9, inlined from 'rte_ring_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:199:10, inlined from 'rte_ring_enqueue_elem' at ../lib/ring/rte_ring_elem.h:290= :9, inlined from 'rte_ring_enqueue' at ../lib/ring/rte_ring.h:339:9, inlined from '_cancel_producer' at ../app/test/test_event_timer_adapter.c:834:10: ../lib/ring/rte_ring_elem_pvt.h:100:25: error: 'memcpy' reading 32 bytes from a region of size 8 [-Werror=3Dstringop-overread] 100 | memcpy((void *)(ring + idx), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | (const void *)(obj + i), 32); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_producer': ../app/test/test_event_timer_adapter.c:805:1: note: source object 'obj' of size 8 805 | _cancel_producer(uint64_t timeout_tcks, uint64_t timers) | ^~~~~~~~~~~~~~~~ In function '__rte_ring_enqueue_elems_128', inlined from '__rte_ring_enqueue_elems' at ../lib/ring/rte_ring_elem_pvt.h:132:3, inlined from '__rte_ring_do_enqueue_elem' at ../lib/ring/rte_ring_elem_pvt.h:328:2, inlined from 'rte_ring_sp_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:163:9, inlined from 'rte_ring_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:202:10, inlined from 'rte_ring_enqueue_elem' at ../lib/ring/rte_ring_elem.h:290= :9, inlined from 'rte_ring_enqueue' at ../lib/ring/rte_ring.h:339:9, inlined from '_cancel_producer' at ../app/test/test_event_timer_adapter.c:834:10: ../lib/ring/rte_ring_elem_pvt.h:100:25: error: 'memcpy' reading 32 bytes from a region of size 8 [-Werror=3Dstringop-overread] 100 | memcpy((void *)(ring + idx), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | (const void *)(obj + i), 32); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_producer': ../app/test/test_event_timer_adapter.c:805:1: note: source object 'obj' of size 8 805 | _cancel_producer(uint64_t timeout_tcks, uint64_t timers) | ^~~~~~~~~~~~~~~~ In function '__rte_ring_enqueue_elems_128', inlined from '__rte_ring_enqueue_elems' at ../lib/ring/rte_ring_elem_pvt.h:132:3, inlined from '__rte_ring_do_rts_enqueue_elem' at ../lib/ring/rte_ring_rts_elem_pvt.h:211:3, inlined from 'rte_ring_mp_rts_enqueue_bulk_elem' at ../lib/ring/rte_ring_rts.h:83:9, inlined from 'rte_ring_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:205:10, inlined from 'rte_ring_enqueue_elem' at ../lib/ring/rte_ring_elem.h:290= :9, inlined from 'rte_ring_enqueue' at ../lib/ring/rte_ring.h:339:9, inlined from '_cancel_producer' at ../app/test/test_event_timer_adapter.c:834:10: ../lib/ring/rte_ring_elem_pvt.h:100:25: error: 'memcpy' reading 32 bytes from a region of size 8 [-Werror=3Dstringop-overread] 100 | memcpy((void *)(ring + idx), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | (const void *)(obj + i), 32); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_producer': ../app/test/test_event_timer_adapter.c:805:1: note: source object 'obj' of size 8 805 | _cancel_producer(uint64_t timeout_tcks, uint64_t timers) | ^~~~~~~~~~~~~~~~ In function '__rte_ring_enqueue_elems_128', inlined from '__rte_ring_enqueue_elems' at ../lib/ring/rte_ring_elem_pvt.h:132:3, inlined from '__rte_ring_do_hts_enqueue_elem' at ../lib/ring/rte_ring_hts_elem_pvt.h:196:3, inlined from 'rte_ring_mp_hts_enqueue_bulk_elem' at ../lib/ring/rte_ring_hts.h:56:9, inlined from 'rte_ring_enqueue_bulk_elem' at ../lib/ring/rte_ring_elem.h:208:10, inlined from 'rte_ring_enqueue_elem' at ../lib/ring/rte_ring_elem.h:290= :9, inlined from 'rte_ring_enqueue' at ../lib/ring/rte_ring.h:339:9, inlined from '_cancel_producer' at ../app/test/test_event_timer_adapter.c:834:10: ../lib/ring/rte_ring_elem_pvt.h:100:25: error: 'memcpy' reading 32 bytes from a region of size 8 [-Werror=3Dstringop-overread] 100 | memcpy((void *)(ring + idx), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | (const void *)(obj + i), 32); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_producer': ../app/test/test_event_timer_adapter.c:805:1: note: source object 'obj' of size 8 805 | _cancel_producer(uint64_t timeout_tcks, uint64_t timers) | ^~~~~~~~~~~~~~~~ In function '__rte_ring_dequeue_elems_128', inlined from '__rte_ring_dequeue_elems' at ../lib/ring/rte_ring_elem_pvt.h:262:3, inlined from '__rte_ring_do_dequeue_elem' at ../lib/ring/rte_ring_elem_pvt.h:375:2, inlined from 'rte_ring_mc_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:320:9, inlined from 'rte_ring_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:381:10, inlined from 'rte_ring_dequeue_elem' at ../lib/ring/rte_ring_elem.h:475= :9, inlined from 'rte_ring_dequeue' at ../lib/ring/rte_ring.h:477:9, inlined from '_cancel_thread' at ../app/test/test_event_timer_adapter.c:917:7: ../lib/ring/rte_ring_elem_pvt.h:234:25: error: 'memcpy' writing 32 bytes into a region of size 8 overflows the destination [-Werror=3Dstringop-overflow=3D] 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_thread': ../app/test/test_event_timer_adapter.c:913:33: note: destination object 'ev_tim' of size 8 913 | struct rte_event_timer *ev_tim =3D NULL; | ^~~~~~ In function '__rte_ring_dequeue_elems_128', inlined from '__rte_ring_dequeue_elems' at ../lib/ring/rte_ring_elem_pvt.h:262:3, inlined from '__rte_ring_do_dequeue_elem' at ../lib/ring/rte_ring_elem_pvt.h:375:2, inlined from 'rte_ring_sc_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:348:9, inlined from 'rte_ring_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:384:10, inlined from 'rte_ring_dequeue_elem' at ../lib/ring/rte_ring_elem.h:475= :9, inlined from 'rte_ring_dequeue' at ../lib/ring/rte_ring.h:477:9, inlined from '_cancel_thread' at ../app/test/test_event_timer_adapter.c:917:7: ../lib/ring/rte_ring_elem_pvt.h:234:25: error: 'memcpy' writing 32 bytes into a region of size 8 overflows the destination [-Werror=3Dstringop-overflow=3D] 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_thread': ../app/test/test_event_timer_adapter.c:913:33: note: destination object 'ev_tim' of size 8 913 | struct rte_event_timer *ev_tim =3D NULL; | ^~~~~~ In function '__rte_ring_dequeue_elems_128', inlined from '__rte_ring_dequeue_elems' at ../lib/ring/rte_ring_elem_pvt.h:262:3, inlined from '__rte_ring_do_rts_dequeue_elem' at ../lib/ring/rte_ring_rts_elem_pvt.h:252:3, inlined from 'rte_ring_mc_rts_dequeue_bulk_elem' at ../lib/ring/rte_ring_rts.h:110:9, inlined from 'rte_ring_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:387:10, inlined from 'rte_ring_dequeue_elem' at ../lib/ring/rte_ring_elem.h:475= :9, inlined from 'rte_ring_dequeue' at ../lib/ring/rte_ring.h:477:9, inlined from '_cancel_thread' at ../app/test/test_event_timer_adapter.c:917:7: ../lib/ring/rte_ring_elem_pvt.h:234:25: error: 'memcpy' writing 32 bytes into a region of size 8 overflows the destination [-Werror=3Dstringop-overflow=3D] 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_thread': ../app/test/test_event_timer_adapter.c:913:33: note: destination object 'ev_tim' of size 8 913 | struct rte_event_timer *ev_tim =3D NULL; | ^~~~~~ In function '__rte_ring_dequeue_elems_128', inlined from '__rte_ring_dequeue_elems' at ../lib/ring/rte_ring_elem_pvt.h:262:3, inlined from '__rte_ring_do_hts_dequeue_elem' at ../lib/ring/rte_ring_hts_elem_pvt.h:237:3, inlined from 'rte_ring_mc_hts_dequeue_bulk_elem' at ../lib/ring/rte_ring_hts.h:83:9, inlined from 'rte_ring_dequeue_bulk_elem' at ../lib/ring/rte_ring_elem.h:390:10, inlined from 'rte_ring_dequeue_elem' at ../lib/ring/rte_ring_elem.h:475= :9, inlined from 'rte_ring_dequeue' at ../lib/ring/rte_ring.h:477:9, inlined from '_cancel_thread' at ../app/test/test_event_timer_adapter.c:917:7: ../lib/ring/rte_ring_elem_pvt.h:234:25: error: 'memcpy' writing 32 bytes into a region of size 8 overflows the destination [-Werror=3Dstringop-overflow=3D] 234 | memcpy((void *)(obj + i), (void *)(ring + idx), 32); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../app/test/test_event_timer_adapter.c: In function '_cancel_thread': ../app/test/test_event_timer_adapter.c:913:33: note: destination object 'ev_tim' of size 8 913 | struct rte_event_timer *ev_tim =3D NULL; | ^~~~~~ cc1: all warnings being treated as errors ninja: subcommands failed This is gcc (Alpine 12.2.1_git20220924-r4) 12.2.1 20220924. The compiler seems unhappy about the rte_int128_t type. The below hunk seems to (confuse?) help the compiler. diff --git a/lib/ring/rte_ring_elem_pvt.h b/lib/ring/rte_ring_elem_pvt.h index 83788c56e6..ece937f8e1 100644 --- a/lib/ring/rte_ring_elem_pvt.h +++ b/lib/ring/rte_ring_elem_pvt.h @@ -98,7 +98,7 @@ __rte_ring_enqueue_elems_128(struct rte_ring *r, uint32_t prod_head, if (likely(idx + n <=3D size)) { for (i =3D 0; i < (n & ~0x1); i +=3D 2, idx +=3D 2) memcpy((void *)(ring + idx), - (const void *)(obj + i), 32); + (const void *)((uintptr_t)obj + i), 32); switch (n & 0x1) { case 1: memcpy((void *)(ring + idx), @@ -231,7 +231,7 @@ __rte_ring_dequeue_elems_128(struct rte_ring *r, uint32_t prod_head, rte_int128_t *obj =3D (rte_int128_t *)obj_table; if (likely(idx + n <=3D size)) { for (i =3D 0; i < (n & ~0x1); i +=3D 2, idx +=3D 2) - memcpy((void *)(obj + i), (void *)(ring + idx), 32); + memcpy((void *)((uintptr_t)obj + i), (void *)(ring + idx), 32)= ; switch (n & 0x1) { case 1: memcpy((void *)(obj + i), (void *)(ring + idx), 16); RTE_PTR_ADD has the same effect. --=20 David Marchand