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 5895FA0032; Wed, 11 May 2022 12:08:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E5E4410F2; Wed, 11 May 2022 12:08:07 +0200 (CEST) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) by mails.dpdk.org (Postfix) with ESMTP id AD08740DDD for ; Wed, 11 May 2022 12:08:05 +0200 (CEST) Received: by mail-lf1-f47.google.com with SMTP id u23so2677749lfc.1 for ; Wed, 11 May 2022 03:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kNAOqTZ8tzjt9JgSx38nbuDvCcm0Dhr/itMJubhJOhw=; b=j6Rwz4zLXV5TVO3FMp6QfKO7hnYka/WoGHfLCLucPwcUelKdVo+1t8CnUNzpfZr/NY kLTq//A/m4KN2FAZpImLH/9S4hIuQFjxiFNR1fMJNwaPbqisvrVf/fJv/yrIiXgjHETp NrVTTmqC7lDfm+p8v9frE2XmIcoDNN2JPYsTi9uVPAW2vYhQ9q06kiIqqmEJdFKHExcB o+p5rHPtZza3Fp1wy65DZJ7dQULZqVlcITiCcq2C6M3GZLci/2c7oZyMPlX/dO/tkoeX H5Vm0A3U0Cnw0WK5ka+8+qK1C7CFyWHV8dSLFou49/xY4HBcafihHIizRNxMJ2n8FNqp IniQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kNAOqTZ8tzjt9JgSx38nbuDvCcm0Dhr/itMJubhJOhw=; b=XauMH5MtyrZgI7b78DUeXwakAMVvb/R4XNwerZ1+Gzwig8Au49/U2zc0uov2/TZnXF XOs1Y/JKzA/QWPkGkgy6SdTXoMcoKR6vSYBBn5coQ0e/KZlRyyUIwDHaZajnoR32lMdb VWNx6XCJ8N46ucAXvvrnqBkh/3TKRjxjiNv5b5y77obaVIWa+1itE4fpfqFSniz6GspL 3ufJ0cu6gGDOo0wFLLR0ArKLG2SVB+Xj9Nzj9h4W9h8J9BwF+RIxpmvybRqmpGg881+t NyHc+0swPBikoie402aU8bzUHfR3ie0x5nl86Wpr8vK5EWnJOl3AKLi9X12JnTUZcwD/ fs8A== X-Gm-Message-State: AOAM530TJTfItSK+HXz5O5JSAtH9fcDVLJZlkD1K6fGbvAgGRRfbC3U2 dWQKx+huNlxSXNjISxc34o6KPhDZwhc5wN+EoHTLAw== X-Google-Smtp-Source: ABdhPJxQhxrZ22Hnuql8lt3eOLZpZC3S3Mnxg3z2kZFSfkf6AdkZzEZkPXmOvPo8/Pwi62dYosFsVnEOYkk76FrpF64= X-Received: by 2002:a05:6512:6d1:b0:473:e135:134f with SMTP id u17-20020a05651206d100b00473e135134fmr19511754lff.542.1652263683701; Wed, 11 May 2022 03:08:03 -0700 (PDT) MIME-Version: 1.0 References: <20220505173003.3242618-1-kda@semihalf.com> <20220505173003.3242618-10-kda@semihalf.com> In-Reply-To: From: =?UTF-8?Q?Stanis=C5=82aw_Kardach?= Date: Wed, 11 May 2022 12:07:27 +0200 Message-ID: Subject: Re: [PATCH 09/11] test/ring: disable problematic tests for RISC-V To: Honnappa Nagarahalli Cc: "dev@dpdk.org" , Frank Zhao , Sam Grove , "mw@semihalf.com" , "upstream@semihalf.com" , nd Content-Type: text/plain; charset="UTF-8" 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 On Wed, May 11, 2022 at 1:28 AM Honnappa Nagarahalli wrote: > > > > > > > When compiling for RISC-V in debug mode the large amount of inlining in > > test_ring_basic_ex() and test_ring_with_exact_size() (in test_ring.c) leads to > > large loop bodies. This causes 'goto' and 'for' loop PC-relative jumps generated > > by the compiler to go beyond the architecture limitation of +/-1MB offset (the > > 'j ' instruction). This instruction should not be generated by the > > compiler since C language does not limit the maximum distance for 'goto' or > > 'for' loop jumps. > > > > This only happens in the unit test for ring which tries to perform long loops > > with ring enqueue/dequeue and it seems to be caused by excessive > > __rte_always_inline usage. ring perf test compiles just fine under debug. > > > > To work around this, disable the offending tests in debug mode. > Is this still required given you have submitted [1] > > [1] http://patches.dpdk.org/project/dpdk/patch/20220510115758.457794-1-kda@semihalf.com/ Correct, this patch is no longer necessary and marked as superseded in patchwork. I did send v2 and v3 series without it. Thank you for taking a look. > > > > > Signed-off-by: Stanislaw Kardach > > Sponsored-by: Frank Zhao > > Sponsored-by: Sam Grove > > --- > > app/test/test_ring.c | 8 ++++++++ > > config/riscv/meson.build | 5 +++++ > > doc/guides/rel_notes/release_22_07.rst | 3 ++- > > 3 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/app/test/test_ring.c b/app/test/test_ring.c index > > bde33ab4a1..7d809c147b 100644 > > --- a/app/test/test_ring.c > > +++ b/app/test/test_ring.c > > @@ -955,6 +955,7 @@ test_ring_burst_bulk_tests4(unsigned int test_idx) > > return -1; > > } > > > > +#if !defined(RTE_RISCV_WO_DISABLE_RING_TESTS) > > /* > > * Test default, single element, bulk and burst APIs > > */ > > @@ -1189,6 +1190,7 @@ test_ring_with_exact_size(void) > > rte_ring_free(exact_sz_r); > > return -1; > > } > > +#endif > > > > static int > > test_ring(void) > > @@ -1200,12 +1202,18 @@ test_ring(void) > > if (test_ring_negative_tests() < 0) > > goto test_fail; > > > > +/* Disable the following tests on RISC-V in debug mode. This is a > > +work-around > > + * GCC bug for RISC-V which fails to generate proper jumps for loops > > +with large > > + * bodies. > > + */ > > +#if !defined(RTE_RISCV_WO_DISABLE_RING_TESTS) > > /* Some basic operations */ > > if (test_ring_basic_ex() < 0) > > goto test_fail; > > > > if (test_ring_with_exact_size() < 0) > > goto test_fail; > > +#endif > > > > /* Burst and bulk operations with sp/sc, mp/mc and default. > > * The test cases are split into smaller test cases to diff --git > > a/config/riscv/meson.build b/config/riscv/meson.build index > > 0c16c31fc2..50d0b513bf 100644 > > --- a/config/riscv/meson.build > > +++ b/config/riscv/meson.build > > @@ -141,3 +141,8 @@ foreach flag: dpdk_flags endforeach message('Using > > machine args: @0@'.format(machine_args)) > > > > +# Enable work-around for ring unit tests in debug mode which fail to > > +link # properly due to bad code generation by GCC. > > +if get_option('optimization') == '0' or get_option('optimization') == 'g' > > + add_project_arguments('-DRTE_RISCV_WO_DISABLE_RING_TESTS', > > +language: 'c') endif > > diff --git a/doc/guides/rel_notes/release_22_07.rst > > b/doc/guides/rel_notes/release_22_07.rst > > index 453591e568..4d64b68dfd 100644 > > --- a/doc/guides/rel_notes/release_22_07.rst > > +++ b/doc/guides/rel_notes/release_22_07.rst > > @@ -76,7 +76,8 @@ New Features > > * Debug build of ``app/test/dpdk-test`` fails currently on RISC-V due to > > seemingly invalid loop and goto jump code generation by GCC in > > ``test_ring.c`` where extensive inlining increases the code size beyond the > > - capability of the generated instruction (JAL: +/-1MB PC-relative). > > + capability of the generated instruction (JAL: +/-1MB PC-relative). The > > + workaround is to disable ``test_ring_basic_ex()`` and > > ``test_ring_with_exact_size()`` on RISC-V on ``-O0`` or ``-Og``. > > > > * **Updated Intel iavf driver.** > > > > -- > > 2.30.2 >