DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andre Muezerie <andremue@linux.microsoft.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Tyler Retzlaff <roretzla@linux.microsoft.com>, dev@dpdk.org
Subject: Re: [PATCH 09/10] test: add workaround for __builtin_constant_p in test_memcpy_perf
Date: Tue, 11 Feb 2025 18:07:27 -0800	[thread overview]
Message-ID: <20250212020727.GB19389@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <20250211141305.0a46a1cb@hermes.local>

On Tue, Feb 11, 2025 at 02:13:05PM -0800, Stephen Hemminger wrote:
> On Tue, 11 Feb 2025 14:02:05 -0800
> Andre Muezerie <andremue@linux.microsoft.com> wrote:
> 
> > There's no MSVC equivalent for compiler extension __builtin_constant_p,
> > so a workaround is needed.
> > 
> > Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> 
> Prefer that __rte_constant worked on all platforms,
> but template code is hard to maintain.

I'm not a huge fan of __rte_constant_with_default either. Here are some thoughts about it:

In test_memcpy_perf we could get rid of __builtin_constant_p or similar macros and just use the second argument (def) I'm passing to __rte_constant_with_default as the condition in the if() statement. I only used __rte_constant_with_default to keep the source code practically the same when using non-msvc compilers. But I don't see advantages beyond that, other than not having to pass that second parameter (def), which now we have to anyways.

__rte_constant_with_default is needed though in the first patch of this series, unless we decide to remove that extra check where it is being used.

      reply	other threads:[~2025-02-12  2:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-11 22:01 [PATCH 00/10] enable "app" to be compiled with MSVC Andre Muezerie
2025-02-11 22:01 ` [PATCH 01/10] eal: add workaround for __builtin_constant_p Andre Muezerie
2025-02-11 22:09   ` Stephen Hemminger
2025-02-12  0:59   ` fengchengwen
2025-02-11 22:01 ` [PATCH 02/10] test_alarm: avoid warning about different qualifiers Andre Muezerie
2025-02-12  0:59   ` fengchengwen
2025-02-11 22:01 ` [PATCH 03/10] test-pmd: fix printf format string mismatch Andre Muezerie
2025-02-11 22:10   ` Stephen Hemminger
2025-02-12  1:01   ` fengchengwen
2025-02-11 22:02 ` [PATCH 04/10] test-pmd: do explicit 64-bit shift to avoid implicit conversion Andre Muezerie
2025-02-12  1:03   ` fengchengwen
2025-02-11 22:02 ` [PATCH 05/10] test-pmd: avoid undefined behavior Andre Muezerie
2025-02-12  1:04   ` fengchengwen
2025-02-11 22:02 ` [PATCH 06/10] test-pmd: avoid non-constant initializer Andre Muezerie
2025-02-12  1:04   ` fengchengwen
2025-02-11 22:02 ` [PATCH 07/10] test-pmd: don't return value from void function Andre Muezerie
2025-02-12  1:10   ` fengchengwen
2025-02-11 22:02 ` [PATCH 08/10] test-pmd: declare lcore_count atomic when using C11 memory model Andre Muezerie
2025-02-11 22:12   ` Stephen Hemminger
2025-02-12  1:16     ` Andre Muezerie
2025-02-12  1:16   ` fengchengwen
2025-02-11 22:02 ` [PATCH 09/10] test: add workaround for __builtin_constant_p in test_memcpy_perf Andre Muezerie
2025-02-11 22:13   ` Stephen Hemminger
2025-02-12  2:07     ` Andre Muezerie [this message]

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=20250212020727.GB19389@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=andremue@linux.microsoft.com \
    --cc=dev@dpdk.org \
    --cc=roretzla@linux.microsoft.com \
    --cc=stephen@networkplumber.org \
    /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).