DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Juraj Linkeš" <juraj.linkes@pantheon.tech>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] Minimun value of RTE_MAX_LCORE
Date: Thu, 15 Oct 2020 12:15:11 +0100	[thread overview]
Message-ID: <20201015111511.GA554@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <317a9b0f7130448190e2391150bd0f67@pantheon.tech>

On Thu, Oct 15, 2020 at 10:49:17AM +0000, Juraj Linkeš wrote:
> Hi dpdk devs,
> 
> Is there a constraint on how low RTE_MAX_LCORE can be? I'm implementing a
> discovery mechanism that sets RTE_MAX_LCORE according to the number of
> host cores, but I'm hitting errors when the values are low:
> https://travis-ci.com/github/jlinkes/dpdk/jobs/399596828 Message: Found 2
> cores Message: Found 1 numa nodes
> 
> ../app/test/test_rcu_qsbr.c:296:54: error: iteration 2 invokes undefined
> behavior [-Werror=aggressive-loop-optimizations]
> 
> ../app/test/test_rcu_qsbr.c:315:55: error: array subscript is above array
> bounds [-Werror=array-bounds]
> 
> All VM jobs failed in that Travis build. Travis VMs only have 2 cores, so
> I tried to put a bound on the build. I set it to 4 and all jobs except
> GCC shared lib jobs passed, which still threw iteration 4 invokes
> undefined behavior error:
> https://travis-ci.com/github/jlinkes/dpdk/jobs/400004089
> 
> ../examples/performance-thread/l3fwd-thread/main.c:2338:34: error:
> iteration 4 invokes undefined behavior
> [-Werror=aggressive-loop-optimizations]
> 
> This happens for number of cores < 32 and looks like a limitation unique
> to l3fwd (with cores between 4 and 32 - I didn't see the error
> elsewhere).
> 
> Should I use the bound or are these legitimate errors? The fact that only
> GCC (and not clang) shared lib jobs failed is also suspicious.
>
Four seems a reasonable lower bound to have, but 32 seems high. I agree
that the warning itself looks suspicious too.

However, looking at the code and the line in question, I think there is
indeed an app bug.  The loop goes up to MAX_ETHPORTS, but the tx_bufs array
being dereferenced is dimensioned by MAX_LCORES, which is why you hit
problems with lcore values below 32 (==MAX_ETHPORTS). Based on the use, I
suspect the structure definition may be wrong and the array should be
dimensioned for MAX_ETHPORTS - but I haven't dug into the code further than
that.

Regards,
/Bruce

  reply	other threads:[~2020-10-15 11:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-15 10:49 Juraj Linkeš
2020-10-15 11:15 ` Bruce Richardson [this message]
2020-10-15 11:30 ` Gaëtan Rivet
2020-10-15 12:14   ` Juraj Linkeš
2020-10-16  6:06     ` Honnappa Nagarahalli

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=20201015111511.GA554@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=juraj.linkes@pantheon.tech \
    /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).