[dpdk-dev,v3,06/20] eal/class: register destructor

Message ID 63ecbe92f158267aaf817c3183644d0fe39f6e9b.1522105876.git.gaetan.rivet@6wind.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Gaëtan Rivet March 26, 2018, 11:18 p.m. UTC
  Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/include/rte_class.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Shreyansh Jain March 27, 2018, 8:42 a.m. UTC | #1
On 3/27/2018 4:48 AM, Gaetan Rivet wrote:
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> ---
>   lib/librte_eal/common/include/rte_class.h | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/lib/librte_eal/common/include/rte_class.h b/lib/librte_eal/common/include/rte_class.h
> index 59b578e3e..95107d937 100644
> --- a/lib/librte_eal/common/include/rte_class.h
> +++ b/lib/librte_eal/common/include/rte_class.h
> @@ -112,6 +112,11 @@ static void classinitfn_ ##nm(void) \
>   {\
>   	(cls).name = RTE_STR(nm);\
>   	rte_class_register(&cls); \
> +} \
> +RTE_FINI_PRIO(classfinifn_ ##nm, CLASS); \
> +static void classfinifn_ ##nm(void) \
> +{ \
> +	rte_class_unregister(&cls); \
>   }
>   
>   #ifdef __cplusplus
> 

I think this can be merged with the Patch 05/20 - isn't it?
  
Gaëtan Rivet March 27, 2018, 8:49 a.m. UTC | #2
Hi Shreyansh,

On Tue, Mar 27, 2018 at 02:12:51PM +0530, Shreyansh Jain wrote:
> On 3/27/2018 4:48 AM, Gaetan Rivet wrote:
> > Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> > ---
> >   lib/librte_eal/common/include/rte_class.h | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/lib/librte_eal/common/include/rte_class.h b/lib/librte_eal/common/include/rte_class.h
> > index 59b578e3e..95107d937 100644
> > --- a/lib/librte_eal/common/include/rte_class.h
> > +++ b/lib/librte_eal/common/include/rte_class.h
> > @@ -112,6 +112,11 @@ static void classinitfn_ ##nm(void) \
> >   {\
> >   	(cls).name = RTE_STR(nm);\
> >   	rte_class_register(&cls); \
> > +} \
> > +RTE_FINI_PRIO(classfinifn_ ##nm, CLASS); \
> > +static void classfinifn_ ##nm(void) \
> > +{ \
> > +	rte_class_unregister(&cls); \
> >   }
> >   #ifdef __cplusplus
> > 
> 
> I think this can be merged with the Patch 05/20 - isn't it?

Absolutely, I only separated it as I wasn't sure for the dtor patch
itself.

If the dtors are accepted, this patch can be merged with the previous
patch.
  

Patch

diff --git a/lib/librte_eal/common/include/rte_class.h b/lib/librte_eal/common/include/rte_class.h
index 59b578e3e..95107d937 100644
--- a/lib/librte_eal/common/include/rte_class.h
+++ b/lib/librte_eal/common/include/rte_class.h
@@ -112,6 +112,11 @@  static void classinitfn_ ##nm(void) \
 {\
 	(cls).name = RTE_STR(nm);\
 	rte_class_register(&cls); \
+} \
+RTE_FINI_PRIO(classfinifn_ ##nm, CLASS); \
+static void classfinifn_ ##nm(void) \
+{ \
+	rte_class_unregister(&cls); \
 }
 
 #ifdef __cplusplus