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 4D5FEA0546; Wed, 7 Apr 2021 08:50:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 47C3C141033; Wed, 7 Apr 2021 08:50:00 +0200 (CEST) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mails.dpdk.org (Postfix) with ESMTP id C18441411F9 for ; Tue, 6 Apr 2021 17:31:22 +0200 (CEST) Received: by mail-lf1-f45.google.com with SMTP id r8so5905246lfp.10 for ; Tue, 06 Apr 2021 08:31:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9UJfAkmZGIfM8Kk56Rixgae5HBEwltS9kqJRzCZ/uQU=; b=hpHbL6xZsvNZZXuQ/tBQcteF0f7PToEPrvWd9YxM1VK7yYUJ1ztD5n32GdDSb1Oyec ynoAv0QHpWa/rOekrrNnTn39hZVFHUgs0H9lE6bfN1VchprjFxWp3eK4tvXi/Z8IPzBb ZXKx8VoWCIaQPglAUfkb5ia3oaLu8fkWN0eoyTuiOfHMSkC/60SFuo6/gF4TmhbNTo2v jNY+JYwndmNO8std4LfvzdxD043wlkriey6hJIJ3zQXme3eN4Dn1ijFVPqiz/gzezlMv x+E1pfANLsgNCEZxnbz6M+WTDG0GUDJmJqxEeFKfu1ZVy1LLHpKaAkeSU66zmzkfgVa7 WSVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9UJfAkmZGIfM8Kk56Rixgae5HBEwltS9kqJRzCZ/uQU=; b=K+JHxOO9qBUYSlPEtM+hk94M78XXWYMhhcaQKls+7yQLAGyKLIwwHiX47/kGTwAQDX CAi/bZkyW0vv1iZlxoUmEdowfdP8TOLQyGKifzWYXfRRlCkdudvYkZjOTN0Kj1v4P+LG apw0iqHA8O6ZJH7N3p32G57Dbff3vKKc3j18/E41zKniTlAObh1hD8KOGx40lqotrOXr 7gbkfTEAPCTCtFkVvLwp0Y2ZUAxJPM4K5Qro+SIasMK9jaQe4O+udmp/yQhar1YTDKQs leHOO0ZyUzMKbF98hFHWLGKJZONrgopHnzOUcMBfRCtwSiVGyyb5uYquSTlZw46/slxT oH4w== X-Gm-Message-State: AOAM533DL5BUYCR4fu2bFGekgDSYXY54eCcQ61R24MQwJ/Al+OpYBe6D NkCjn8AYs1q9IRFfL4sHZT6Omv7aaVYQdEo7+FnElw== X-Google-Smtp-Source: ABdhPJw5PGW5mbW46RcRltGsAvAeynEBX8+bqYO4MoaZ/7hf5oozgQEtWeeVcaFmiVy05NWadozIMBB5YIU9rgVxYw8= X-Received: by 2002:a05:6512:1116:: with SMTP id l22mr20905122lfg.61.1617723082173; Tue, 06 Apr 2021 08:31:22 -0700 (PDT) MIME-Version: 1.0 References: <20210326104759.280175-1-mk@semihalf.com> <20210326104759.280175-3-mk@semihalf.com> <3282663.DU2RlWCeFW@thomas> In-Reply-To: <3282663.DU2RlWCeFW@thomas> From: =?UTF-8?Q?Stanis=C5=82aw_Kardach?= Date: Tue, 6 Apr 2021 17:31:10 +0200 Message-ID: To: Thomas Monjalon Cc: dev@dpdk.org, Michal Krawczyk , erik.g.carrillo@intel.com X-Mailman-Approved-At: Wed, 07 Apr 2021 08:49:57 +0200 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [dpdk-dev] [PATCH 2/2] test: proceed if timer subsystem was initialized 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 Sender: "dev" Hi Thomas, Thanks for the review. On Tue, Apr 6, 2021 at 5:24 PM Thomas Monjalon wrote: > 26/03/2021 11:47, Michal Krawczyk: > > From: Stanislaw Kardach > > > > rte_timer_subsystem_init() may return -EALREADY if the timer subsystem > > was already initialized. This can happen i.e. in PMD code (see > > eth_ena_dev_init). This is not an error, rather a notification as the > > initialization function simply returns without any action taken. > > Missing these lines: > > Fixes: 50247fe03fe0 ("test/timer: exercise new APIs in secondary process") > Cc: stable@dpdk.org Will add in V2. > > > > Signed-off-by: Stanislaw Kardach > > Reviewed-by: Michal Krawczyk > > --- > > app/test/test.c | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/app/test/test.c b/app/test/test.c > > index 624dd48042..864523ed61 100644 > > --- a/app/test/test.c > > +++ b/app/test/test.c > > @@ -134,8 +134,13 @@ main(int argc, char **argv) > > goto out; > > } > > > > + argv += ret; > > + > > + prgname = argv[0]; > > + > > #ifdef RTE_LIB_TIMER > > - if (rte_timer_subsystem_init() < 0) { > > + ret = rte_timer_subsystem_init(); > > + if (ret < 0 && ret != -EALREADY) { > > ret = -1; > > goto out; > > } > > @@ -146,10 +151,6 @@ main(int argc, char **argv) > > goto out; > > } > > > > - argv += ret; > > - > > - prgname = argv[0]; > > - > > How this change for argv/prgname is related to the fix? > This patch saves the return value of rte_timer_subsystem_init() in ret which overwrites the previous ret that held the number of arguments consumed by rte_eal_init(). Similarly because rte_eal_init() reshuffles argv, the prgname is effectively at argv[ret]. So I need to move this logic before the timer subsystem check.