From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id 9D154239 for ; Mon, 18 Mar 2019 08:54:56 +0100 (CET) Received: by mail-vs1-f65.google.com with SMTP id g127so1810651vsd.6 for ; Mon, 18 Mar 2019 00:54:56 -0700 (PDT) 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=DHTbVvR4BC32RGJZtAcfyuyDz9OVa+mzkSYeZ6GZwhM=; b=nNs4Vj13j5rTKUjIC1mfl5Fu2zK2zorIUFmKzBnKrwlLrYJPXmqu4XvpagVOWhyYLW cWysDltAH1M0P+xje1fauE0osF0PVSGjIg0ZUzL11F+YE/2QJJdVlPxSG9MWOI3ppjgi tSyCRb2dfDk8JMvUsh8t+221q6fz+b2eIOzz2BGrp7BCaJBB+ZFFvaMM8O94DvdrJH4m +9EBe3hqh5EAd8wea2lsrF1sdidxCPLklNwv/33Q580GeWvbQctbIjfYUcaWZMwbrpiN bm03Rx5Elp1F/48DMSneDtItgYRvciyOpvvetBkFbPtJu0QDhfFvIIfQpBBaQcdIR9T9 0STw== X-Gm-Message-State: APjAAAV+cWrDAg5AOWgJrTvBaBhilbXMG25sytH6RJrr00eJaZp1zoCJ EKE+0XaBwoXMHZGSuumx2n0eZHTG3V1taqHTBR8uvA== X-Google-Smtp-Source: APXvYqzM5tB7FyT2wmlTo52gNiCDf/SfbY43+K7MA3KDJpG5Llj/U4Z/mXmjty+5enyJFBwS/GLjM08O3Y27cAsaK8U= X-Received: by 2002:a67:f69a:: with SMTP id n26mr8423848vso.105.1552895695714; Mon, 18 Mar 2019 00:54:55 -0700 (PDT) MIME-Version: 1.0 References: <20190318041512.19526-1-jerinj@marvell.com> In-Reply-To: <20190318041512.19526-1-jerinj@marvell.com> From: David Marchand Date: Mon, 18 Mar 2019 08:54:44 +0100 Message-ID: To: Jerin Jacob Kollanukkaran Cc: Amr Mokhtar , Olivier Matz , Andrew Rybchenko , "dev@dpdk.org" , "thomas@monjalon.net" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] eal: use eal abstraction for defining constructors 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: , X-List-Received-Date: Mon, 18 Mar 2019 07:54:56 -0000 On Mon, Mar 18, 2019 at 5:16 AM Jerin Jacob Kollanukkaran < jerinj@marvell.com> wrote: > From: Jerin Jacob > > Use eal's RTE_INIT abstraction for defining constructors. > > Signed-off-by: Jerin Jacob > --- > app/test-bbdev/main.h | 3 +-- > app/test/resource.h | 2 +- > app/test/test.h | 3 +-- > lib/librte_mempool/rte_mempool.h | 7 +++---- > 4 files changed, 6 insertions(+), 9 deletions(-) > > diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h > index 20a55efca..2bbe1b822 100644 > --- a/app/test-bbdev/main.h > +++ b/app/test-bbdev/main.h > @@ -103,8 +103,7 @@ void add_test_command(struct test_command *t); > .command = RTE_STR(name), \ > .callback = test_func_##name, \ > }; \ > - static void __attribute__((constructor, used)) \ > - test_register_##name(void) \ > + RTE_INIT(test_register_##name) \ > { \ > add_test_command(&test_struct_##name); \ > } > diff --git a/app/test/resource.h b/app/test/resource.h > index 223fa22ae..c75ebd4b5 100644 > --- a/app/test/resource.h > +++ b/app/test/resource.h > @@ -98,7 +98,7 @@ static struct resource linkres_ ##n = { \ > .begin = b, \ > .end = e, \ > }; \ > -static void __attribute__((constructor, used)) resinitfn_ ##n(void) \ > +RTE_INIT(resinitfn_ ##n) \ > { \ > resource_register(&linkres_ ##n); \ > } > diff --git a/app/test/test.h b/app/test/test.h > index 7c2443230..9b3846b1e 100644 > --- a/app/test/test.h > +++ b/app/test/test.h > @@ -177,8 +177,7 @@ void add_test_command(struct test_command *t); > .command = RTE_STR(cmd), \ > .callback = func, \ > }; \ > - static void __attribute__((constructor, used)) \ > - test_register_##cmd(void) \ > + RTE_INIT(test_register_##cmd) \ > { \ > add_test_command(&test_struct_##cmd); \ > } > diff --git a/lib/librte_mempool/rte_mempool.h > b/lib/librte_mempool/rte_mempool.h > index 7c9cd9a2f..fd19470d7 100644 > --- a/lib/librte_mempool/rte_mempool.h > +++ b/lib/librte_mempool/rte_mempool.h > @@ -832,10 +832,9 @@ int rte_mempool_register_ops(const struct > rte_mempool_ops *ops); > * Note that the rte_mempool_register_ops fails silently here when > * more than RTE_MEMPOOL_MAX_OPS_IDX is registered. > */ > -#define MEMPOOL_REGISTER_OPS(ops) \ > - void mp_hdlr_init_##ops(void); \ > - void __attribute__((constructor, used)) mp_hdlr_init_##ops(void)\ > - { \ > +#define MEMPOOL_REGISTER_OPS(ops) \ > + RTE_INIT(mp_hdlr_init_##ops) \ > + { \ > rte_mempool_register_ops(&ops); \ > } > > -- > 2.21.0 > > Reviewed-by: David Marchand -- David Marchand From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 74D21A00E6 for ; Mon, 18 Mar 2019 08:54:58 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7B94E152A; Mon, 18 Mar 2019 08:54:57 +0100 (CET) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id 9D154239 for ; Mon, 18 Mar 2019 08:54:56 +0100 (CET) Received: by mail-vs1-f65.google.com with SMTP id g127so1810651vsd.6 for ; Mon, 18 Mar 2019 00:54:56 -0700 (PDT) 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=DHTbVvR4BC32RGJZtAcfyuyDz9OVa+mzkSYeZ6GZwhM=; b=nNs4Vj13j5rTKUjIC1mfl5Fu2zK2zorIUFmKzBnKrwlLrYJPXmqu4XvpagVOWhyYLW cWysDltAH1M0P+xje1fauE0osF0PVSGjIg0ZUzL11F+YE/2QJJdVlPxSG9MWOI3ppjgi tSyCRb2dfDk8JMvUsh8t+221q6fz+b2eIOzz2BGrp7BCaJBB+ZFFvaMM8O94DvdrJH4m +9EBe3hqh5EAd8wea2lsrF1sdidxCPLklNwv/33Q580GeWvbQctbIjfYUcaWZMwbrpiN bm03Rx5Elp1F/48DMSneDtItgYRvciyOpvvetBkFbPtJu0QDhfFvIIfQpBBaQcdIR9T9 0STw== X-Gm-Message-State: APjAAAV+cWrDAg5AOWgJrTvBaBhilbXMG25sytH6RJrr00eJaZp1zoCJ EKE+0XaBwoXMHZGSuumx2n0eZHTG3V1taqHTBR8uvA== X-Google-Smtp-Source: APXvYqzM5tB7FyT2wmlTo52gNiCDf/SfbY43+K7MA3KDJpG5Llj/U4Z/mXmjty+5enyJFBwS/GLjM08O3Y27cAsaK8U= X-Received: by 2002:a67:f69a:: with SMTP id n26mr8423848vso.105.1552895695714; Mon, 18 Mar 2019 00:54:55 -0700 (PDT) MIME-Version: 1.0 References: <20190318041512.19526-1-jerinj@marvell.com> In-Reply-To: <20190318041512.19526-1-jerinj@marvell.com> From: David Marchand Date: Mon, 18 Mar 2019 08:54:44 +0100 Message-ID: To: Jerin Jacob Kollanukkaran Cc: Amr Mokhtar , Olivier Matz , Andrew Rybchenko , "dev@dpdk.org" , "thomas@monjalon.net" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] eal: use eal abstraction for defining constructors 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" Message-ID: <20190318075444.13sXBC8d2ksId42KuWW9lA4NwveIWopYfuCD-C4SYvw@z> On Mon, Mar 18, 2019 at 5:16 AM Jerin Jacob Kollanukkaran < jerinj@marvell.com> wrote: > From: Jerin Jacob > > Use eal's RTE_INIT abstraction for defining constructors. > > Signed-off-by: Jerin Jacob > --- > app/test-bbdev/main.h | 3 +-- > app/test/resource.h | 2 +- > app/test/test.h | 3 +-- > lib/librte_mempool/rte_mempool.h | 7 +++---- > 4 files changed, 6 insertions(+), 9 deletions(-) > > diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h > index 20a55efca..2bbe1b822 100644 > --- a/app/test-bbdev/main.h > +++ b/app/test-bbdev/main.h > @@ -103,8 +103,7 @@ void add_test_command(struct test_command *t); > .command = RTE_STR(name), \ > .callback = test_func_##name, \ > }; \ > - static void __attribute__((constructor, used)) \ > - test_register_##name(void) \ > + RTE_INIT(test_register_##name) \ > { \ > add_test_command(&test_struct_##name); \ > } > diff --git a/app/test/resource.h b/app/test/resource.h > index 223fa22ae..c75ebd4b5 100644 > --- a/app/test/resource.h > +++ b/app/test/resource.h > @@ -98,7 +98,7 @@ static struct resource linkres_ ##n = { \ > .begin = b, \ > .end = e, \ > }; \ > -static void __attribute__((constructor, used)) resinitfn_ ##n(void) \ > +RTE_INIT(resinitfn_ ##n) \ > { \ > resource_register(&linkres_ ##n); \ > } > diff --git a/app/test/test.h b/app/test/test.h > index 7c2443230..9b3846b1e 100644 > --- a/app/test/test.h > +++ b/app/test/test.h > @@ -177,8 +177,7 @@ void add_test_command(struct test_command *t); > .command = RTE_STR(cmd), \ > .callback = func, \ > }; \ > - static void __attribute__((constructor, used)) \ > - test_register_##cmd(void) \ > + RTE_INIT(test_register_##cmd) \ > { \ > add_test_command(&test_struct_##cmd); \ > } > diff --git a/lib/librte_mempool/rte_mempool.h > b/lib/librte_mempool/rte_mempool.h > index 7c9cd9a2f..fd19470d7 100644 > --- a/lib/librte_mempool/rte_mempool.h > +++ b/lib/librte_mempool/rte_mempool.h > @@ -832,10 +832,9 @@ int rte_mempool_register_ops(const struct > rte_mempool_ops *ops); > * Note that the rte_mempool_register_ops fails silently here when > * more than RTE_MEMPOOL_MAX_OPS_IDX is registered. > */ > -#define MEMPOOL_REGISTER_OPS(ops) \ > - void mp_hdlr_init_##ops(void); \ > - void __attribute__((constructor, used)) mp_hdlr_init_##ops(void)\ > - { \ > +#define MEMPOOL_REGISTER_OPS(ops) \ > + RTE_INIT(mp_hdlr_init_##ops) \ > + { \ > rte_mempool_register_ops(&ops); \ > } > > -- > 2.21.0 > > Reviewed-by: David Marchand -- David Marchand