From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B5CA0A05A1; Sun, 12 Apr 2020 05:21:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 947CE1BF6C; Sun, 12 Apr 2020 05:21:04 +0200 (CEST) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) by dpdk.org (Postfix) with ESMTP id 5A89E1BF68 for ; Sun, 12 Apr 2020 05:21:03 +0200 (CEST) Received: by mail-qt1-f194.google.com with SMTP id l13so1950179qtr.7 for ; Sat, 11 Apr 2020 20:21:03 -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=+YLqd5Hn3U3nNEZtlG4P0uCLKu57ehipFonbOOaWuoM=; b=Lixu2Qm4Oq4G51wOkQIfAR0B6fIKfzpo3hoNWW+tZMbdMTajCe4RUripWtq/x4i121 okIVaAV+yELXLPxe2rwBzh31/7TSpBwIfaEQTUbIbRThkwv3OPsHVCv83LeZMafXhnQK fQ05WrrC/8DUKygWsJvRNSei2AQGUyebY1umj6o03uAXvaFPO5HnKXUVwVtOX+a3xnZU OJZv7/llFmoD90z9tWi344FekVjUWWVuStoCp5Il7XmpVjMj5zDJ7Q/GbgwBldrXd0OO Q4HZY5EUUovapAKy1Xxd2KX2dtJk8aCndhvsqKy71xoHSsRJda/949U/6euTVV+GMB3U +1OQ== 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=+YLqd5Hn3U3nNEZtlG4P0uCLKu57ehipFonbOOaWuoM=; b=VdfGIEgUAAL9WzC5LGNVFdoJ+dC49ve/W+RF++fUDNfBjUB9LfKp9KCU5kCC3jbaJY f+UnlXuNRzlTUxV+g+S2QhdFcIt9XDUlFQdHcwMje+zXEYOSuBh+h4OgQy4vsBFj/W7u IfwPNJKbO2+lgIW7irBIrYMoPbTCs7Kkr6TRcZZc64W+0ZQSM4g4ZnENfxNhh2nQ9At8 48Pl1Uj5LS4Y8qmzQCy00EvKqD//iArJVdG7DXi9cEMCpE+5ncScbbMxuaOpdXIBqvve 5aXtu0EGF5IS4PTTWSAS8WeBmeV9CLValS0kWrh6QekWaFdBdkHp28qc6WL8R4XlTJmN Xh7g== X-Gm-Message-State: AGi0PuZsCv0eyigIdQZKaXFPu4CLIwAy/px2Bh23EiZqweGZicmE6mCl tUsuU5u12F+jDchX/iIVvIEzaJGwHgDhISn6lzk= X-Google-Smtp-Source: APiQypKjDcdd6/IxPVmth4r5r57IxWC/SA3N7WSD3PNNDQEuJBPgnlDVyY2DxDx6CGo/g0vCy+AlklFWDOgsXmijh28= X-Received: by 2002:ac8:554a:: with SMTP id o10mr6116142qtr.221.1586661662480; Sat, 11 Apr 2020 20:21:02 -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> In-Reply-To: From: Tonghao Zhang Date: Sun, 12 Apr 2020 11:20:26 +0800 Message-ID: To: Jerin Jacob Cc: Olivier Matz , Andrew Rybchenko , Gage Eads , "Artem V. Andreev" , Jerin Jacob , Nithin Dabilpuram , Vamsi Attunuru , Hemant Agrawal , David Marchand , Anatoly Burakov , "Richardson, Bruce" , dpdk-dev 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Apr 10, 2020 at 9:11 PM Jerin Jacob wrote: > > On Fri, Apr 10, 2020 at 11:48 AM Jerin Jacob wrot= e: > > > > Three more items are missing in this patch > > 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 is = 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 wrote: > > > > > > From: Tonghao Zhang > > > > > > 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 > > > --- > > 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/inclu= de/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 > > > +#include > > > > 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 subseq= uent > > * events overwrite the old events in the trace buffer. > > */ > > RTE_TRACE_MODE_OVERWRITE, > > /** > > * In this mode, When no space left on trace buffer, the subseq= uent > > * 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_ */ --=20 Best regards, Tonghao