From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BE9A1A05A1;
	Sun, 12 Apr 2020 05:33:27 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 3A5A81BF68;
	Sun, 12 Apr 2020 05:33:27 +0200 (CEST)
Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com
 [209.85.222.194]) by dpdk.org (Postfix) with ESMTP id 89FBA1BF0B
 for <dev@dpdk.org>; Sun, 12 Apr 2020 05:33:26 +0200 (CEST)
Received: by mail-qk1-f194.google.com with SMTP id b62so6339054qkf.6
 for <dev@dpdk.org>; Sat, 11 Apr 2020 20:33:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to
 :cc:content-transfer-encoding;
 bh=osGyUGUe8RhdwSNUR2W20mnmVJ8e+0ThxLbmUZKcP0k=;
 b=j7mHJsNQNE2QBTyZIcK4Yykq/X4qxA0kGubRgzo8ecefsRGIvJeGbiuQ4mHpRiDUc7
 5EJ9QmbzQ+MHDpdFUc+Zt6z13j+oLY0Wl7FRqa3IG2hyrVq67+pE//jPnRGqU2D+w1tY
 jg6nvLFP2TBzgUWUNCn9lExh9JQXTTJHD9P2jchtpw1CucAgJrRpAwUvW8NaCFNnuzKL
 Vbn/5LkfjutXigyPCjYNyEIXi0QwUDXPBHVn+JYBThV3NA5iZwL/vby+qL2dEXtx/5g9
 NSBMxus5nJlzIPxQ9ENnoetBZsICdQN10+l3hZt21tquxTNjuTfkOlcBlXaSdH98Ua4D
 VhCQ==
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:content-transfer-encoding;
 bh=osGyUGUe8RhdwSNUR2W20mnmVJ8e+0ThxLbmUZKcP0k=;
 b=AwpoFjipE1UX3qCkgP8F17cnjrbX25rDlJ/+sufzo2vCsRPuvFA9mTsHCxiHwkujGd
 6qhtvTyXw/HBaKJVF0jt+RQuTxGpkvigvKup3HSVJU1aihfpYLu/g0+xjqGiC2Rfxr2I
 1C9moTWXWF16Y3XxBjahxI2hkkhFJDbMsa7trELlTvwmHJGhrl+FrAze10zcu+FLzdkP
 BKmfXkjc+2LRF+84cxUhON8EgUCGV7yJh++9QLzNdN9wtRMGwnrw5l3DVAbJgsL8xxHC
 n1lcSfY4h12MskXSJ1noJBM2JWj/kxcltDXVFz4y+KhpVJmwyleryD5ZO6sCKIpdLSmX
 iFgA==
X-Gm-Message-State: AGi0PuYTeACxWuCjw2MzO1lz5DITiB1ck+5tGE1AyVJO6N/XFlomSuFh
 G+KqHH5M/+OEqJgwlyCDWcm2VDBorn/Uc93oGTQ=
X-Google-Smtp-Source: APiQypK0pBt6VB23cZ6qQP3RfidzDP7JBZbq2sXm8IumhY8ZXuU8BvGsLesLqyXxqucOZEUl5bWP/w8wDofvXDHAtik=
X-Received: by 2002:a37:bc81:: with SMTP id
 m123mr10617985qkf.319.1586662405810; 
 Sat, 11 Apr 2020 20:33:25 -0700 (PDT)
MIME-Version: 1.0
References: <1583114253-15345-1-git-send-email-xiangxia.m.yue@gmail.com>
 <1586444567-9311-1-git-send-email-xiangxia.m.yue@gmail.com>
 <CALBAE1NRqEKwkphMf-aVk-g5242ub5KHFrEdqJdUEaP0vdAEDQ@mail.gmail.com>
 <CALBAE1NE54-5Ar=ThymW2twpfKew+mOnkGhV14H7DZ281_inrA@mail.gmail.com>
 <CAMDZJNWDANKtEHAdXrnwZugP9LOEpne_RqTSEbR2jHx7nsnxFQ@mail.gmail.com>
In-Reply-To: <CAMDZJNWDANKtEHAdXrnwZugP9LOEpne_RqTSEbR2jHx7nsnxFQ@mail.gmail.com>
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Date: Sun, 12 Apr 2020 11:32:49 +0800
Message-ID: <CAMDZJNXCG1QcVKaQTS4Y-5TR3B=kOJDwPgdY_=hU7Acwe3_JuA@mail.gmail.com>
To: Jerin Jacob <jerinjacobk@gmail.com>
Cc: Olivier Matz <olivier.matz@6wind.com>,
 Andrew Rybchenko <arybchenko@solarflare.com>, 
 Gage Eads <gage.eads@intel.com>,
 "Artem V. Andreev" <artem.andreev@oktetlabs.ru>, 
 Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, 
 Vamsi Attunuru <vattunuru@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,
 David Marchand <david.marchand@redhat.com>,
 Anatoly Burakov <anatoly.burakov@intel.com>, 
 "Richardson, Bruce" <bruce.richardson@intel.com>, dpdk-dev <dev@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Subject: Re: [dpdk-dev] [PATCH dpdk-dev v2 1/2] eal: introduce rte-init
 queue for libraries initialization
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

On Sun, Apr 12, 2020 at 11:20 AM Tonghao Zhang <xiangxia.m.yue@gmail.com> w=
rote:
>
> On Fri, Apr 10, 2020 at 9:11 PM Jerin Jacob <jerinjacobk@gmail.com> wrote=
:
> >
> > On Fri, Apr 10, 2020 at 11:48 AM Jerin Jacob <jerinjacobk@gmail.com> wr=
ote:
> > >
> >
> > Three more items are missing in this patch
Can I add "Co-authored-by" for you ?

> > 1) Unit test case for new API
> > 2) Make the new API __rte_experimal
> Hi Jerin
> This API will be invoked in mempool, if use that prefix, there is a
> compile warning:
> include/rte_mempool.h:933:2: error: =E2=80=98rte_init_register=E2=80=99 i=
s deprecated
> (declared at x86_64-native-linuxapp-gcc/include/rte_init.h:61): Symbol
> is not yet part of stable ABI [-Werror=3Ddeprecated-declarations]
>
> remove the __rte_experimal in the patch 2?
>
> > 3) Update the .map file
> >
> >
> > > On Thu, Apr 9, 2020 at 8:33 PM <xiangxia.m.yue@gmail.com> wrote:
> > > >
> > > > From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > > >
> > > > This patch introduces last-init queue, user can register a
> > > > callback for theirs initialization. Running rte_last_init_run(),
> > >
> > > The above section needs to be rewritten wrt v2 changes.
> > >
> > > > the almost resource of DPDK are available, such as memzone, ring.
> > > > With this way, user don't introduce additional codes in eal layer.
> > > >
> > > > [This patch will be used for next patch.]
> > >
> > > See below
> > >
> > >
> > > >
> > > > Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> > > > ---
> > > See above
> > >
> > > Move [This patch will be used for next patch.] here to avoid
> > > unnecessary information in the git commit.
> > >
> > > > v2:
> > > > * rename rte_last_init_register ->rte_init_register
> > > > * rename rte_last_init struct ->rte_init
> > > > * rename rte_init_cb ->rte_init_cb_t
> > > > * free the rte_init node when not used.
> > > > * remove rte_init and others to eal_private.h
> > > > * add comments
> > > > * fix checkpatch warning
> > > > ---
> > > > diff --git a/lib/librte_eal/include/rte_init.h b/lib/librte_eal/inc=
lude/rte_init.h
> > > > new file mode 100644
> > > > index 0000000..636efff
> > > > --- /dev/null
> > > > +++ b/lib/librte_eal/include/rte_init.h
> > > > @@ -0,0 +1,59 @@
> > > > +/* SPDX-License-Identifier: BSD-3-Clause
> > > > + * Copyright 2020 DPDK Community
> > > > + */
> > > > +
> > > > +#ifndef _RTE_INIT_H_
> > > > +#define _RTE_INIT_H_
> > >
> > > @file section is missing. See
> > > lib/librte_eal/common/include/rte_errno.h as example.
> > >
> > >
> > > > +#ifdef __cplusplus
> > > > +extern "C" {
> > > > +#endif
> > > > +
> > > > +#include <stdio.h>
> > > > +#include <sys/queue.h>
> > >
> > > <sys/queue.h> is not required in public API header file.
> > >
> > > > +
> > > > +/**
> > > > + * Implementation specific callback function which is
> > > > + * responsible for specificed initialization.
> > > > + *
> > > > + * This is called when almost resources are available.
> > > > + *
> > > > + * @return
> > > > + *     0 for successful callback
> > > > + *     Negative for unsuccessful callback with error value
> > > > + */
> > > > +typedef int (*rte_init_cb_t)(const void *arg);
> > > > +
> > > > +/**
> > > > + * rte_init type.
> > > > + *
> > > > + * The rte_init of RTE_INIT_PRE are called firstly,
> > > > + * and then RTE_INIT_POST.
> > > > + */
> > > > +enum rte_init_type {
> > > > +       RTE_INIT_PRE,
> > >
> > > Type specific comment is missing.
> > >
> > > Example as reference for formatting.
> > >
> > > /**
> > >  * Enumerate trace mode operation.
> > >  */
> > > enum rte_trace_mode_e {
> > >         /**
> > >          * In this mode, When no space left in trace buffer, the subs=
equent
> > >          * events overwrite the old events in the trace buffer.
> > >          */
> > >         RTE_TRACE_MODE_OVERWRITE,
> > >         /**
> > >          * In this mode, When no space left on trace buffer, the subs=
equent
> > >          * events shall not be recorded in the trace buffer.
> > >          */
> > >         RTE_TRACE_MODE_DISCARD,
> > > };
> > >
> > > > +       RTE_INIT_POST
> > > > +};
> > >
> > >
> > > > +
> > > > +/**
> > > > + * Register a rte_init callback.
> > > > + *
> > > > + * @param cb
> > > > + *   A pointer to a rte_init_cb structure, which will be used
> > >
> > > s/used/invoked?
> > >
> > > > + *   in rte_eal_init().
> > > > + *
> > > > + * @param arg
> > > > + *   The cb will use that as param.
> > > > + *
> > > > + * @param type
> > > > + *   The type of rte_init registered.
> > > > + */
> > > > +
> > > > +void rte_init_register(rte_init_cb_t cb, const void *arg,
> > > > +                      enum rte_init_type type);
> > > > +
> > > > +#ifdef __cplusplus
> > > > +}
> > > > +#endif
> > > > +
> > > > +#endif /* _RTE_INIT_H_ */
>
>
>
> --
> Best regards, Tonghao



--=20
Best regards, Tonghao