DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
@ 2017-04-27  6:51 Guduri Prathyusha
  2017-07-31 21:10 ` Thomas Monjalon
  2017-09-04 10:58 ` Bruce Richardson
  0 siblings, 2 replies; 8+ messages in thread
From: Guduri Prathyusha @ 2017-04-27  6:51 UTC (permalink / raw)
  To: cristian.dumitrescu; +Cc: dev, Guduri Prathyusha

rte_cfgfile_section_num_entries_by_index() is added to get the number of
entries of a section when multiple sections of the same name are
present.

Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
---
 lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
 lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
index b54a523..2588093 100644
--- a/lib/librte_cfgfile/rte_cfgfile.c
+++ b/lib/librte_cfgfile/rte_cfgfile.c
@@ -408,7 +408,20 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
 	return s->num_entries;
 }
 
+int
+rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
+	char *sectionname, int index)
+{
+	const struct rte_cfgfile_section *sect;
+
+	if (index < 0 || index >= cfg->num_sections)
+		return -1;
 
+	sect = cfg->sections[index];
+	snprintf(sectionname, CFG_NAME_LEN, "%s", sect->name);
+
+	return sect->num_entries;
+}
 int
 rte_cfgfile_section_entries(struct rte_cfgfile *cfg, const char *sectionname,
 		struct rte_cfgfile_entry *entries, int max_entries)
diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
index fa10d40..35dc419 100644
--- a/lib/librte_cfgfile/rte_cfgfile.h
+++ b/lib/librte_cfgfile/rte_cfgfile.h
@@ -184,6 +184,26 @@ int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
 	const char *sectionname);
 
 /**
+* Get number of entries in given config file section
+*
+* The index of a section is the same as the index of its name in the
+* result of rte_cfgfile_sections. This API can be used when there are
+* multiple sections with the same name.
+*
+* @param cfg
+*   Config file
+* @param sectionname
+*   Section name
+* @param index
+*   Section index
+* @return
+*   Number of entries in section on success, -1 otherwise
+*/
+int rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
+	char *sectionname,
+	int index);
+
+/**
 * Get section entries as key-value pairs
 *
 * If multiple sections have the given name this function operates on the
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-04-27  6:51 [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index Guduri Prathyusha
@ 2017-07-31 21:10 ` Thomas Monjalon
  2017-08-01 12:36   ` Dumitrescu, Cristian
  2017-09-04 10:58 ` Bruce Richardson
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2017-07-31 21:10 UTC (permalink / raw)
  To: cristian.dumitrescu; +Cc: dev, Guduri Prathyusha

27/04/2017 08:51, Guduri Prathyusha:
> rte_cfgfile_section_num_entries_by_index() is added to get the number of
> entries of a section when multiple sections of the same name are
> present.
> 
> Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> ---
>  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
>  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
>  2 files changed, 33 insertions(+)

Cristian, this is an old patch not reviewed.
Any comment please?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-07-31 21:10 ` Thomas Monjalon
@ 2017-08-01 12:36   ` Dumitrescu, Cristian
  2017-08-01 12:42     ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Dumitrescu, Cristian @ 2017-08-01 12:36 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, Guduri Prathyusha



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, July 31, 2017 10:10 PM
> To: Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
> Cc: dev@dpdk.org; Guduri Prathyusha
> <gprathyusha@caviumnetworks.com>
> Subject: Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by
> index
> 
> 27/04/2017 08:51, Guduri Prathyusha:
> > rte_cfgfile_section_num_entries_by_index() is added to get the number
> of
> > entries of a section when multiple sections of the same name are
> > present.
> >
> > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> > ---
> >  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
> >  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
> >  2 files changed, 33 insertions(+)
> 
> Cristian, this is an old patch not reviewed.
> Any comment please?

Do you need this reviewed for this release, or can it wait until the next release?

I have a few patches on my list to review (librte_cfgfile, librte_sched), I will make this review a priority for next release cycle.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-08-01 12:36   ` Dumitrescu, Cristian
@ 2017-08-01 12:42     ` Thomas Monjalon
  2017-09-04  6:12       ` Prathyusha, Guduri
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2017-08-01 12:42 UTC (permalink / raw)
  To: Dumitrescu, Cristian; +Cc: dev, Guduri Prathyusha

01/08/2017 14:36, Dumitrescu, Cristian:
> > 27/04/2017 08:51, Guduri Prathyusha:
> > > rte_cfgfile_section_num_entries_by_index() is added to get the number
> > of
> > > entries of a section when multiple sections of the same name are
> > > present.
> > >
> > > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> > > ---
> > >  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
> > >  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
> > >  2 files changed, 33 insertions(+)
> > 
> > Cristian, this is an old patch not reviewed.
> > Any comment please?
> 
> Do you need this reviewed for this release, or can it wait until the next release?

It has already waited 3 months without any ping, so I guess it can wait.

> I have a few patches on my list to review (librte_cfgfile, librte_sched), I will make this review a priority for next release cycle.

OK thanks.
It's not about you specifically, but as a community, we need to improve
our response time (I'm not good as well).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-08-01 12:42     ` Thomas Monjalon
@ 2017-09-04  6:12       ` Prathyusha, Guduri
  0 siblings, 0 replies; 8+ messages in thread
From: Prathyusha, Guduri @ 2017-09-04  6:12 UTC (permalink / raw)
  To: Thomas Monjalon, Dumitrescu, Cristian; +Cc: dev

ping???

________________________________
From: Thomas Monjalon <thomas@monjalon.net>
Sent: Tuesday, August 1, 2017 6:12:26 PM
To: Dumitrescu, Cristian
Cc: dev@dpdk.org; Prathyusha, Guduri
Subject: Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index

01/08/2017 14:36, Dumitrescu, Cristian:
> > 27/04/2017 08:51, Guduri Prathyusha:
> > > rte_cfgfile_section_num_entries_by_index() is added to get the number
> > of
> > > entries of a section when multiple sections of the same name are
> > > present.
> > >
> > > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> > > ---
> > >  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
> > >  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
> > >  2 files changed, 33 insertions(+)
> >
> > Cristian, this is an old patch not reviewed.
> > Any comment please?
>
> Do you need this reviewed for this release, or can it wait until the next release?

It has already waited 3 months without any ping, so I guess it can wait.

> I have a few patches on my list to review (librte_cfgfile, librte_sched), I will make this review a priority for next release cycle.

OK thanks.
It's not about you specifically, but as a community, we need to improve
our response time (I'm not good as well).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-04-27  6:51 [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index Guduri Prathyusha
  2017-07-31 21:10 ` Thomas Monjalon
@ 2017-09-04 10:58 ` Bruce Richardson
  2017-09-04 11:28   ` Guduri Prathyusha
  2017-09-15 13:59   ` Thomas Monjalon
  1 sibling, 2 replies; 8+ messages in thread
From: Bruce Richardson @ 2017-09-04 10:58 UTC (permalink / raw)
  To: Guduri Prathyusha; +Cc: cristian.dumitrescu, dev

On Thu, Apr 27, 2017 at 12:21:40PM +0530, Guduri Prathyusha wrote:
> rte_cfgfile_section_num_entries_by_index() is added to get the number of
> entries of a section when multiple sections of the same name are
> present.
> 
> Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
>  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
>  2 files changed, 33 insertions(+)
> 
> diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
> index b54a523..2588093 100644
> --- a/lib/librte_cfgfile/rte_cfgfile.c
> +++ b/lib/librte_cfgfile/rte_cfgfile.c
> @@ -408,7 +408,20 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
>  	return s->num_entries;
>  }
>  
> +int
> +rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
> +	char *sectionname, int index)
> +{
> +	const struct rte_cfgfile_section *sect;
> +
> +	if (index < 0 || index >= cfg->num_sections)
> +		return -1;
>  
> +	sect = cfg->sections[index];
> +	snprintf(sectionname, CFG_NAME_LEN, "%s", sect->name);

I don't like the fact that the section name is being overwritten here,
but the behaviour is consistent with that done by the other "by_index()"
functions, so it's probably better to keep this.
In future a change to consider would be remove the sectionname entirely
from the function arguments since it serves no purpose that I can see.

> +
> +	return sect->num_entries;
> +}
>  int
>  rte_cfgfile_section_entries(struct rte_cfgfile *cfg, const char *sectionname,
>  		struct rte_cfgfile_entry *entries, int max_entries)
> diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
> index fa10d40..35dc419 100644
> --- a/lib/librte_cfgfile/rte_cfgfile.h
> +++ b/lib/librte_cfgfile/rte_cfgfile.h
> @@ -184,6 +184,26 @@ int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
>  	const char *sectionname);
>  
>  /**
> +* Get number of entries in given config file section
> +*
> +* The index of a section is the same as the index of its name in the
> +* result of rte_cfgfile_sections. This API can be used when there are
> +* multiple sections with the same name.
> +*
> +* @param cfg
> +*   Config file
> +* @param sectionname
> +*   Section name
> +* @param index
> +*   Section index
> +* @return
> +*   Number of entries in section on success, -1 otherwise
> +*/
> +int rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
> +	char *sectionname,
> +	int index);
> +
> +/**
>  * Get section entries as key-value pairs
>  *
>  * If multiple sections have the given name this function operates on the
> -- 
> 1.7.9.5
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-09-04 10:58 ` Bruce Richardson
@ 2017-09-04 11:28   ` Guduri Prathyusha
  2017-09-15 13:59   ` Thomas Monjalon
  1 sibling, 0 replies; 8+ messages in thread
From: Guduri Prathyusha @ 2017-09-04 11:28 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev

On Mon, Sep 04, 2017 at 11:58:44AM +0100, Bruce Richardson wrote:
> On Thu, Apr 27, 2017 at 12:21:40PM +0530, Guduri Prathyusha wrote:
> > rte_cfgfile_section_num_entries_by_index() is added to get the number of
> > entries of a section when multiple sections of the same name are
> > present.
> >
> > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
>
> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> >  lib/librte_cfgfile/rte_cfgfile.c |   13 +++++++++++++
> >  lib/librte_cfgfile/rte_cfgfile.h |   20 ++++++++++++++++++++
> >  2 files changed, 33 insertions(+)
> >
> > diff --git a/lib/librte_cfgfile/rte_cfgfile.c b/lib/librte_cfgfile/rte_cfgfile.c
> > index b54a523..2588093 100644
> > --- a/lib/librte_cfgfile/rte_cfgfile.c
> > +++ b/lib/librte_cfgfile/rte_cfgfile.c
> > @@ -408,7 +408,20 @@ int rte_cfgfile_close(struct rte_cfgfile *cfg)
> >  	return s->num_entries;
> >  }
> >
> > +int
> > +rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
> > +	char *sectionname, int index)
> > +{
> > +	const struct rte_cfgfile_section *sect;
> > +
> > +	if (index < 0 || index >= cfg->num_sections)
> > +		return -1;
> >
> > +	sect = cfg->sections[index];
> > +	snprintf(sectionname, CFG_NAME_LEN, "%s", sect->name);
>
> I don't like the fact that the section name is being overwritten here,
> but the behaviour is consistent with that done by the other "by_index()"
> functions, so it's probably better to keep this.
> In future a change to consider would be remove the sectionname entirely
> from the function arguments since it serves no purpose that I can see.
>
I agree that sectionname doesn't serve any purpose and can be removed. Thanks.
> > +
> > +	return sect->num_entries;
> > +}
> >  int
> >  rte_cfgfile_section_entries(struct rte_cfgfile *cfg, const char *sectionname,
> >  		struct rte_cfgfile_entry *entries, int max_entries)
> > diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
> > index fa10d40..35dc419 100644
> > --- a/lib/librte_cfgfile/rte_cfgfile.h
> > +++ b/lib/librte_cfgfile/rte_cfgfile.h
> > @@ -184,6 +184,26 @@ int rte_cfgfile_section_num_entries(struct rte_cfgfile *cfg,
> >  	const char *sectionname);
> >
> >  /**
> > +* Get number of entries in given config file section
> > +*
> > +* The index of a section is the same as the index of its name in the
> > +* result of rte_cfgfile_sections. This API can be used when there are
> > +* multiple sections with the same name.
> > +*
> > +* @param cfg
> > +*   Config file
> > +* @param sectionname
> > +*   Section name
> > +* @param index
> > +*   Section index
> > +* @return
> > +*   Number of entries in section on success, -1 otherwise
> > +*/
> > +int rte_cfgfile_section_num_entries_by_index(struct rte_cfgfile *cfg,
> > +	char *sectionname,
> > +	int index);
> > +
> > +/**
> >  * Get section entries as key-value pairs
> >  *
> >  * If multiple sections have the given name this function operates on the
> > --
> > 1.7.9.5
> >

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index
  2017-09-04 10:58 ` Bruce Richardson
  2017-09-04 11:28   ` Guduri Prathyusha
@ 2017-09-15 13:59   ` Thomas Monjalon
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-09-15 13:59 UTC (permalink / raw)
  To: Guduri Prathyusha; +Cc: dev, Bruce Richardson, cristian.dumitrescu

04/09/2017 12:58, Bruce Richardson:
> On Thu, Apr 27, 2017 at 12:21:40PM +0530, Guduri Prathyusha wrote:
> > rte_cfgfile_section_num_entries_by_index() is added to get the number of
> > entries of a section when multiple sections of the same name are
> > present.
> > 
> > Signed-off-by: Guduri Prathyusha <gprathyusha@caviumnetworks.com>
> 
> Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-09-15 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-27  6:51 [dpdk-dev] [PATCH] librte_cfgfile: add section num entries by index Guduri Prathyusha
2017-07-31 21:10 ` Thomas Monjalon
2017-08-01 12:36   ` Dumitrescu, Cristian
2017-08-01 12:42     ` Thomas Monjalon
2017-09-04  6:12       ` Prathyusha, Guduri
2017-09-04 10:58 ` Bruce Richardson
2017-09-04 11:28   ` Guduri Prathyusha
2017-09-15 13:59   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).