DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v5] eal_common_cpuflags: Fix %rbx corruption, and simplify the code
Date: Wed, 16 Apr 2014 08:58:31 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8970829D14A@IRSMSX103.ger.corp.intel.com> (raw)

Hi Neil,



>> What was the value of RTE_COMPILE_TIME_CPUFLAGS when you built your library?  If you added defines for flag support that are not tested for yet in the cpu_feature_table, that would be the error you would see I think



>RTE_COMPILE_TIME_CPUFLAGS= >RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SSE4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX



>For gcc_version >=4.6, that value is the same, of course (and all those flags are supported). So it has to be something else...



Silly me, I just saw what was hapenning. There are two missing brackets in the loop:



for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) {

ret = rte_cpu_get_flag_enabled(compile_time_flags[i]);



if (ret < 0) {

fprintf(stderr,

  "ERROR: CPU feature flag lookup failed with error %d\n",

  ret);

exit(1);

}

if (!ret) {

fprintf(stderr,

  "ERROR: This system does not support \"%s\".\n"

  "Please check that RTE_MACHINE is set correctly.\n",

  cpu_feature_table[compile_time_flags[i]].name);

exit(1);

}

}



So, basically, "i" was size of the array +1 after the loop and only the return value was being checked for the last item. Not sure why higher versions of gcc do not catch this.



Thanks,



Pablo de Lara

DPDK SW Engineer



--------------------------------------------------------------

Intel Shannon Limited

Registered in Ireland

Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 Business address: Dromore House, East Park, Shannon, Co. Clare

             reply	other threads:[~2014-04-16  9:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-16  8:58 De Lara Guarch, Pablo [this message]
2014-04-16  9:06 ` Thomas Monjalon
2014-04-16 10:49 ` Neil Horman
2014-04-16 11:09   ` De Lara Guarch, Pablo
2014-04-16 12:53     ` Neil Horman
  -- strict thread matches above, loose matches on Subject: below --
2014-04-15 14:09 De Lara Guarch, Pablo
2014-04-15 14:56 ` Neil Horman
2014-04-16  8:36   ` De Lara Guarch, Pablo
2014-03-20 16:39 [dpdk-dev] [RFC UNTESTED PATCH] " Neil Horman
2014-03-25 19:52 ` [dpdk-dev] [PATCH v5] " Neil Horman
2014-03-25 20:51   ` H. Peter Anvin
2014-04-02 11:16     ` Neil Horman
2014-04-02 11:53       ` Thomas Monjalon
2014-04-02 12:42     ` Thomas Monjalon

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=E115CCD9D858EF4F90C690B0DCB4D8970829D14A@IRSMSX103.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.com \
    /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).