DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>,
	 Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Thomas Monjalon <thomas@monjalon.net>,
	 "Richardson, Bruce" <bruce.richardson@intel.com>
Cc: "ci@dpdk.org" <ci@dpdk.org>, Aaron Conole <aconole@redhat.com>,
	dev <dev@dpdk.org>,  Patrick Robb <probb@iol.unh.edu>,
	Kevin Traynor <ktraynor@redhat.com>
Subject: Re: Meson buildtype for ci jobs?
Date: Thu, 16 Mar 2023 10:08:47 +0100	[thread overview]
Message-ID: <CAJFAV8wBcZO_-8j39F3CxrgK1PzK0fShjscgrQ-P8T5+N=zqmg@mail.gmail.com> (raw)
In-Reply-To: <CAJFAV8x4EP=-vX4UjVsT2aB6pdSt66BdJdndsVTGvgPpMk8UZg@mail.gmail.com>

On Thu, Mar 16, 2023 at 9:49 AM David Marchand
<david.marchand@redhat.com> wrote:
>
> Adding dev@ mailing list and ring maintainers,
>
> On Wed, Mar 15, 2023 at 8:13 PM Patrick Robb <probb@iol.unh.edu> wrote:
> >>
> >> Would passing "-Ddebug=true" be better than changing the default buildtype?
> >> It's possible to have a release build (i.e. O3 optimized) with debug info.
> >
> >
> > Strangely, even with -Ddebug true if I'm running buildtype "release" it returns the same warnings. I'm inferring from your comment that release optimization == debugoptimized optimization and debug behavior from -Ddebug=true == debug behavior from debugoptimized, so release buildtype + debug "should" have the same behavior as just setting buildtype debugoptimized, and yet...
> >
> > I'll have to look into this a little more. Hopefully by the end I'll be like 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=generic.
>
> ~/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=stringop-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=stringop-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=stringop-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=stringop-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=stringop-overflow=]
>   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 = 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=stringop-overflow=]
>   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 = 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=stringop-overflow=]
>   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 = 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=stringop-overflow=]
>   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 = 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 <= size)) {
>          for (i = 0; i < (n & ~0x1); i += 2, idx += 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 = (rte_int128_t *)obj_table;
>      if (likely(idx + n <= size)) {
>          for (i = 0; i < (n & ~0x1); i += 2, idx += 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.
>

This seems what Kevin had worked around for 21.11 release:
https://inbox.dpdk.org/stable/20221220123754.239802-1-ktraynor@redhat.com/

I would tend to do the same and disable this warning for rc3 at least,
and have stable branches and the main repository aligned.
We can have a better fix later.

Opinions?


-- 
David Marchand


  reply	other threads:[~2023-03-16  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJvnSUDGnYveF8Ss9vzz40WC4=XLdyOtL3W3A-_tAsLd5e-ScA@mail.gmail.com>
     [not found] ` <CAJFAV8whvEU77oou=4QHjZyT8pn_LDg0WGNHMnaUX56h6d9viQ@mail.gmail.com>
     [not found]   ` <DS0PR11MB730955EC70691C25045A839397BF9@DS0PR11MB7309.namprd11.prod.outlook.com>
     [not found]     ` <CAJvnSUB+JH1UW8bUe0Nv5w-7eTnmDtb7anrSFLmXsgHFGYbFWQ@mail.gmail.com>
2023-03-16  8:49       ` David Marchand
2023-03-16  9:08         ` David Marchand [this message]
2023-03-16 10:06           ` Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8wBcZO_-8j39F3CxrgK1PzK0fShjscgrQ-P8T5+N=zqmg@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=aconole@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=ci@dpdk.org \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=ktraynor@redhat.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).