DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values
       [not found] <1441289108-4501-1-git-send-email-jasvinder.singh@intel.com>
@ 2015-09-03 14:18 ` Jasvinder Singh
  2015-09-03 14:33   ` Thomas Monjalon
  2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
  0 siblings, 2 replies; 12+ messages in thread
From: Jasvinder Singh @ 2015-09-03 14:18 UTC (permalink / raw)
  To: dev

This patch refers to the ABI change proposed for librte_cfgfile (rte_cfgfile.h).
In order to allow for longer names and values, the new values of macros CFG_NAME_LEN and CFG_NAME_VAL are set.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 lib/librte_cfgfile/Makefile          | 2 +-
 lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index da17880..ec049e7 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -86,10 +86,6 @@ Deprecation Notices
   be removed as well as the associated functions rte_acl_ipv4vlan_add_rules
   and rte_acl_ipv4vlan_build.
 
-* librte_cfgfile: In order to allow for longer names and values,
-  the value of macros CFG_NAME_LEN and CFG_NAME_VAL will be increased.
-  Most likely, the new values will be 64 and 256, respectively.
-
 * librte_port: Macros to access the packet meta-data stored within the
   packet buffer will be adjusted to cover the packet mbuf structure as well,
   as currently they are able to access any packet buffer location except the
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index 032c240..616aef0 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_cfgfile_version.map
 
-LIBABIVER := 1
+LIBABIVER := 2
 
 #
 # all source are stored in SRCS-y
diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
index 7c9fc91..d443782 100644
--- a/lib/librte_cfgfile/rte_cfgfile.h
+++ b/lib/librte_cfgfile/rte_cfgfile.h
@@ -47,8 +47,13 @@ extern "C" {
 *
 ***/
 
-#define CFG_NAME_LEN 32
-#define CFG_VALUE_LEN 64
+#ifndef CFG_NAME_LEN
+#define CFG_NAME_LEN 64
+#endif
+
+#ifndef CFG_VALUE_LEN
+#define CFG_VALUE_LEN 256
+#endif
 
 /** Configuration file */
 struct rte_cfgfile;
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values
  2015-09-03 14:18 ` [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values Jasvinder Singh
@ 2015-09-03 14:33   ` Thomas Monjalon
  2015-09-03 15:46     ` Mcnamara, John
  2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2015-09-03 14:33 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dev

2015-09-03 15:18, Jasvinder Singh:
> This patch refers to the ABI change proposed for librte_cfgfile (rte_cfgfile.h).
> In order to allow for longer names and values, the new values of macros CFG_NAME_LEN and CFG_NAME_VAL are set.

Please wrap the commit message.
CFG_NAME_VAL should be CFG_VALUE_LEN.
The title should start with "cfgfile:".
Instead of talking about macros changes, saying "increase maximum" would give
more clue about the goal of the change.

> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---
>  doc/guides/rel_notes/deprecation.rst | 4 ----
>  lib/librte_cfgfile/Makefile          | 2 +-
>  lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
>  3 files changed, 8 insertions(+), 7 deletions(-)

You have forgotten to update doc/guides/rel_notes/release_2_2.rst.

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

* Re: [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values
  2015-09-03 14:33   ` Thomas Monjalon
@ 2015-09-03 15:46     ` Mcnamara, John
  2015-09-03 17:22       ` Thomas Monjalon
  0 siblings, 1 reply; 12+ messages in thread
From: Mcnamara, John @ 2015-09-03 15:46 UTC (permalink / raw)
  To: Thomas Monjalon, Singh, Jasvinder; +Cc: dev

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> Sent: Thursday, September 3, 2015 3:34 PM
> To: Singh, Jasvinder
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify
> the macros values
> 
> >  doc/guides/rel_notes/deprecation.rst | 4 ----
> >  lib/librte_cfgfile/Makefile          | 2 +-
> >  lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
> >  3 files changed, 8 insertions(+), 7 deletions(-)
> 
> You have forgotten to update doc/guides/rel_notes/release_2_2.rst.

The new release notes file hasn't been merged yet.

John.
-- 

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

* Re: [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values
  2015-09-03 15:46     ` Mcnamara, John
@ 2015-09-03 17:22       ` Thomas Monjalon
  0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2015-09-03 17:22 UTC (permalink / raw)
  To: Mcnamara, John; +Cc: dev

2015-09-03 15:46, Mcnamara, John:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon
> > Sent: Thursday, September 3, 2015 3:34 PM
> > To: Singh, Jasvinder
> > Cc: dev@dpdk.org
> > Subject: Re: [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify
> > the macros values
> > 
> > >  doc/guides/rel_notes/deprecation.rst | 4 ----
> > >  lib/librte_cfgfile/Makefile          | 2 +-
> > >  lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
> > >  3 files changed, 8 insertions(+), 7 deletions(-)
> > 
> > You have forgotten to update doc/guides/rel_notes/release_2_2.rst.
> 
> The new release notes file hasn't been merged yet.

Right! It will be merged shortly.

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

* [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): modify the macros values
  2015-09-03 14:18 ` [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values Jasvinder Singh
  2015-09-03 14:33   ` Thomas Monjalon
@ 2015-09-04 10:58   ` Jasvinder Singh
  2015-09-07 11:23     ` Dumitrescu, Cristian
                       ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: Jasvinder Singh @ 2015-09-04 10:58 UTC (permalink / raw)
  To: dev

This patch refers to the ABI change proposed for librte_cfgfile
(rte_cfgfile.h). In order to allow for longer names and values,
the new values of macros CFG_NAME_LEN and CFG_NAME_VAL are set.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 doc/guides/rel_notes/release_2_2.rst | 7 ++++++-
 lib/librte_cfgfile/Makefile          | 2 +-
 lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
 4 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 5f6079b..2fbdee2 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -53,10 +53,6 @@ Deprecation Notices
 * The scheduler statistics structure will change to allow keeping track of
   RED actions.
 
-* librte_cfgfile: In order to allow for longer names and values,
-  the value of macros CFG_NAME_LEN and CFG_NAME_VAL will be increased.
-  Most likely, the new values will be 64 and 256, respectively.
-
 * librte_port: Macros to access the packet meta-data stored within the
   packet buffer will be adjusted to cover the packet mbuf structure as well,
   as currently they are able to access any packet buffer location except the
diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst
index abe57b4..ff64da8 100644
--- a/doc/guides/rel_notes/release_2_2.rst
+++ b/doc/guides/rel_notes/release_2_2.rst
@@ -44,6 +44,11 @@ ABI Changes
 
 * The LPM structure is changed. The deprecated field mem_location is removed.
 
+* librte_cfgfile: In order to allow for longer names and values,
+  the value of macros CFG_NAME_LEN and CFG_NAME_VAL is increased,
+  the new values are 64 and 256, respectively
+
+
 
 Shared Library Versions
 -----------------------
@@ -54,7 +59,7 @@ The libraries prepended with a plus sign were incremented in this version.
 
    + libethdev.so.2
    + librte_acl.so.2
-     librte_cfgfile.so.1
+   + librte_cfgfile.so.2
      librte_cmdline.so.1
      librte_distributor.so.1
    + librte_eal.so.2
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index 032c240..616aef0 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_cfgfile_version.map
 
-LIBABIVER := 1
+LIBABIVER := 2
 
 #
 # all source are stored in SRCS-y
diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
index 7c9fc91..d443782 100644
--- a/lib/librte_cfgfile/rte_cfgfile.h
+++ b/lib/librte_cfgfile/rte_cfgfile.h
@@ -47,8 +47,13 @@ extern "C" {
 *
 ***/
 
-#define CFG_NAME_LEN 32
-#define CFG_VALUE_LEN 64
+#ifndef CFG_NAME_LEN
+#define CFG_NAME_LEN 64
+#endif
+
+#ifndef CFG_VALUE_LEN
+#define CFG_VALUE_LEN 256
+#endif
 
 /** Configuration file */
 struct rte_cfgfile;
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): modify the macros values
  2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
@ 2015-09-07 11:23     ` Dumitrescu, Cristian
  2015-10-19 15:54     ` Thomas Monjalon
  2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
  2 siblings, 0 replies; 12+ messages in thread
From: Dumitrescu, Cristian @ 2015-09-07 11:23 UTC (permalink / raw)
  To: Singh, Jasvinder, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Jasvinder Singh
> Sent: Friday, September 4, 2015 1:59 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): modify the
> macros values
> 
> This patch refers to the ABI change proposed for librte_cfgfile
> (rte_cfgfile.h). In order to allow for longer names and values,
> the new values of macros CFG_NAME_LEN and CFG_NAME_VAL are set.
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> ---

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

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

* Re: [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): modify the macros values
  2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
  2015-09-07 11:23     ` Dumitrescu, Cristian
@ 2015-10-19 15:54     ` Thomas Monjalon
  2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
  2 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2015-10-19 15:54 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dev

2015-09-04 11:58, Jasvinder Singh:
> -#define CFG_NAME_LEN 32
> -#define CFG_VALUE_LEN 64
> +#ifndef CFG_NAME_LEN
> +#define CFG_NAME_LEN 64
> +#endif

Build fails:
examples/qos_sched/cfg_file.h:40:0: error: "CFG_NAME_LEN" redefined

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

* [dpdk-dev] [PATCH v4 0/2] cfgfile: modify the macros values
  2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
  2015-09-07 11:23     ` Dumitrescu, Cristian
  2015-10-19 15:54     ` Thomas Monjalon
@ 2015-10-22 14:03     ` Jasvinder Singh
  2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 1/2] qos_sched: fix example modification to use librte_cfgfile Jasvinder Singh
                         ` (2 more replies)
  2 siblings, 3 replies; 12+ messages in thread
From: Jasvinder Singh @ 2015-10-22 14:03 UTC (permalink / raw)
  To: dev

This patchset is modifying two macros in rte_cfgfile
library thus ABI needs versioning. To meet requirements
of ABI compatibility release notes and Makefile is also
modified. Additionally a fix for qos_sched application is
send as previously it was incomplete in 2.1 and application
was redefining that macros.

v2:
*changed commit message
*removed deprecation notice
*updated makefile

v3:
*updated release note.

v4:
*fixed build error for qos_sched sample app.
*supplement incomplete implementation in 2.1

Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Michal Jastrzebski (1):
  qos_sched: fix example modification to use librte_cfgfile

Jasvinder Singh (1):
  librte_cfgfile(rte_cfgfile.h): modify the macros values


 doc/guides/rel_notes/deprecation.rst |   4 -
 doc/guides/rel_notes/release_2_2.rst |   6 +-
 examples/qos_sched/cfg_file.c        | 183 -----------------------------------
 examples/qos_sched/cfg_file.h        |  29 ------
 lib/librte_cfgfile/Makefile          |   2 +-
 lib/librte_cfgfile/rte_cfgfile.h     |   9 +-
 6 files changed, 13 insertions(+), 220 deletions(-)

-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 1/2] qos_sched: fix example modification to use librte_cfgfile
  2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
@ 2015-10-22 14:03       ` Jasvinder Singh
  2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 2/2] librte_cfgfile(rte_cfgfile.h): modify the macros values Jasvinder Singh
  2015-10-22 16:35       ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Thomas Monjalon
  2 siblings, 0 replies; 12+ messages in thread
From: Jasvinder Singh @ 2015-10-22 14:03 UTC (permalink / raw)
  To: dev

From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>

This is a supplement for previous patch that was incomplete.
Previous commit message: This is a modification of qos_sched
example to use librte_cfgfile for parsing configuration file.

Fixes: db935d0171dd ("examples/qos_sched: use librte_cfgfile")

Signed-off-by: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
---
 examples/qos_sched/cfg_file.c | 183 ------------------------------------------
 examples/qos_sched/cfg_file.h |  29 -------
 2 files changed, 212 deletions(-)

diff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c
index 595e70b..94a1a22 100644
--- a/examples/qos_sched/cfg_file.c
+++ b/examples/qos_sched/cfg_file.c
@@ -49,189 +49,6 @@
  * for new entries do we add in */
 #define CFG_ALLOC_ENTRY_BATCH 16
 
-static unsigned
-_strip(char *str, unsigned len)
-{
-	int newlen = len;
-	if (len == 0)
-		return 0;
-
-	if (isspace(str[len-1])) {
-		/* strip trailing whitespace */
-		while (newlen > 0 && isspace(str[newlen - 1]))
-			str[--newlen] = '\0';
-	}
-
-	if (isspace(str[0])) {
-		/* strip leading whitespace */
-		int i,start = 1;
-		while (isspace(str[start]) && start < newlen)
-			start++
-			; /* do nothing */
-		newlen -= start;
-		for (i = 0; i < newlen; i++)
-			str[i] = str[i+start];
-		str[i] = '\0';
-	}
-	return newlen;
-}
-
-struct cfg_file *
-cfg_load(const char *filename, int flags)
-{
-	int allocated_sections = CFG_ALLOC_SECTION_BATCH;
-	int allocated_entries = 0;
-	int curr_section = -1;
-	int curr_entry = -1;
-	char buffer[256];
-	int lineno = 0;
-	struct cfg_file *cfg = NULL;
-
-	FILE *f = fopen(filename, "r");
-	if (f == NULL)
-		return NULL;
-
-	cfg = malloc(sizeof(*cfg) +	sizeof(cfg->sections[0]) * allocated_sections);
-	if (cfg == NULL)
-		goto error2;
-
-	memset(cfg->sections, 0, sizeof(cfg->sections[0]) * allocated_sections);
-
-	while (fgets(buffer, sizeof(buffer), f) != NULL) {
-		char *pos = NULL;
-		size_t len = strnlen(buffer, sizeof(buffer));
-		lineno++;
-		if (len >=sizeof(buffer) - 1 && buffer[len-1] != '\n'){
-			printf("Error line %d - no \\n found on string. "
-					"Check if line too long\n", lineno);
-			goto error1;
-		}
-		if ((pos = memchr(buffer, ';', sizeof(buffer))) != NULL) {
-			*pos = '\0';
-			len = pos -  buffer;
-		}
-
-		len = _strip(buffer, len);
-		if (buffer[0] != '[' && memchr(buffer, '=', len) == NULL)
-			continue;
-
-		if (buffer[0] == '[') {
-			/* section heading line */
-			char *end = memchr(buffer, ']', len);
-			if (end == NULL) {
-				printf("Error line %d - no terminating '[' found\n", lineno);
-				goto error1;
-			}
-			*end = '\0';
-			_strip(&buffer[1], end - &buffer[1]);
-
-			/* close off old section and add start new one */
-			if (curr_section >= 0)
-				cfg->sections[curr_section]->num_entries = curr_entry + 1;
-			curr_section++;
-
-			/* resize overall struct if we don't have room for more sections */
-			if (curr_section == allocated_sections) {
-				allocated_sections += CFG_ALLOC_SECTION_BATCH;
-				struct cfg_file *n_cfg = realloc(cfg, sizeof(*cfg) +
-						sizeof(cfg->sections[0]) * allocated_sections);
-				if (n_cfg == NULL) {
-					printf("Error - no more memory\n");
-					goto error1;
-				}
-				cfg = n_cfg;
-			}
-
-			/* allocate space for new section */
-			allocated_entries = CFG_ALLOC_ENTRY_BATCH;
-			curr_entry = -1;
-			cfg->sections[curr_section] = malloc(sizeof(*cfg->sections[0]) +
-					sizeof(cfg->sections[0]->entries[0]) * allocated_entries);
-			if (cfg->sections[curr_section] == NULL) {
-				printf("Error - no more memory\n");
-				goto error1;
-			}
-
-			snprintf(cfg->sections[curr_section]->name,
-					sizeof(cfg->sections[0]->name),
-					"%s", &buffer[1]);
-		}
-		else {
-			/* value line */
-			if (curr_section < 0) {
-				printf("Error line %d - value outside of section\n", lineno);
-				goto error1;
-			}
-
-			struct cfg_section *sect = cfg->sections[curr_section];
-			char *split[2];
-			if (rte_strsplit(buffer, sizeof(buffer), split, 2, '=') != 2) {
-				printf("Error at line %d - cannot split string\n", lineno);
-				goto error1;
-			}
-
-			curr_entry++;
-			if (curr_entry == allocated_entries) {
-				allocated_entries += CFG_ALLOC_ENTRY_BATCH;
-				struct cfg_section *n_sect = realloc(sect, sizeof(*sect) +
-						sizeof(sect->entries[0]) * allocated_entries);
-				if (n_sect == NULL) {
-					printf("Error - no more memory\n");
-					goto error1;
-				}
-				sect = cfg->sections[curr_section] = n_sect;
-			}
-
-			sect->entries[curr_entry] = malloc(sizeof(*sect->entries[0]));
-			if (sect->entries[curr_entry] == NULL) {
-				printf("Error - no more memory\n");
-				goto error1;
-			}
-
-			struct cfg_entry *entry = sect->entries[curr_entry];
-			snprintf(entry->name, sizeof(entry->name), "%s", split[0]);
-			snprintf(entry->value, sizeof(entry->value), "%s", split[1]);
-			_strip(entry->name, strnlen(entry->name, sizeof(entry->name)));
-			_strip(entry->value, strnlen(entry->value, sizeof(entry->value)));
-		}
-	}
-	fclose(f);
-	cfg->flags = flags;
-	cfg->sections[curr_section]->num_entries = curr_entry + 1;
-	cfg->num_sections = curr_section + 1;
-	return cfg;
-
-error1:
-	cfg_close(cfg);
-error2:
-	fclose(f);
-	return NULL;
-}
-
-
-int cfg_close(struct cfg_file *cfg)
-{
-	int i, j;
-
-	if (cfg == NULL)
-		return -1;
-
-	for(i = 0; i < cfg->num_sections; i++) {
-		if (cfg->sections[i] != NULL) {
-			if (cfg->sections[i]->num_entries) {
-				for(j = 0; j < cfg->sections[i]->num_entries; j++) {
-					if (cfg->sections[i]->entries[j] != NULL)
-						free(cfg->sections[i]->entries[j]);
-				}
-			}
-			free(cfg->sections[i]);
-		}
-	}
-	free(cfg);
-
-	return 0;
-}
-
 int
 cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params)
 {
diff --git a/examples/qos_sched/cfg_file.h b/examples/qos_sched/cfg_file.h
index 960cea4..cc5a2cd 100644
--- a/examples/qos_sched/cfg_file.h
+++ b/examples/qos_sched/cfg_file.h
@@ -37,39 +37,10 @@
 #include <rte_sched.h>
 #include <rte_cfgfile.h>
 
-#define CFG_NAME_LEN 32
-#define CFG_VALUE_LEN 64
-
-struct cfg_entry {
-	char name[CFG_NAME_LEN];
-	char value[CFG_VALUE_LEN];
-};
-
-struct cfg_section {
-	char name[CFG_NAME_LEN];
-	int num_entries;
-	struct cfg_entry *entries[0];
-};
-
-struct cfg_file {
-	int flags;
-	int num_sections;
-	struct cfg_section *sections[0];
-};
-
-
 int cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port);
 
 int cfg_load_pipe(struct rte_cfgfile *cfg, struct rte_sched_pipe_params *pipe);
 
 int cfg_load_subport(struct rte_cfgfile *cfg, struct rte_sched_subport_params *subport);
 
-/* reads a config file from disk and returns a handle to the config
- * 'flags' is reserved for future use and must be 0
- */
-struct cfg_file *cfg_load(const char *filename, int flags);
-
-/* cleans up memory allocated by cfg_load() */
-int cfg_close(struct cfg_file *cfg);
-
 #endif
-- 
2.1.0

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

* [dpdk-dev] [PATCH v4 2/2] librte_cfgfile(rte_cfgfile.h): modify the macros values
  2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
  2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 1/2] qos_sched: fix example modification to use librte_cfgfile Jasvinder Singh
@ 2015-10-22 14:03       ` Jasvinder Singh
  2015-10-22 16:35       ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Thomas Monjalon
  2 siblings, 0 replies; 12+ messages in thread
From: Jasvinder Singh @ 2015-10-22 14:03 UTC (permalink / raw)
  To: dev

This patch refers to the ABI change proposed for
librte_cfgfile(rte_cfgfile.h). In order to allow
for longer names and values, the values of macro
CFG_NAME_LEN and CFG_VAL_LEN is increased.

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 4 ----
 doc/guides/rel_notes/release_2_2.rst | 6 +++++-
 lib/librte_cfgfile/Makefile          | 2 +-
 lib/librte_cfgfile/rte_cfgfile.h     | 9 +++++++--
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 018a119..a391ff0 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -41,10 +41,6 @@ Deprecation Notices
 * The scheduler statistics structure will change to allow keeping track of
   RED actions.
 
-* librte_cfgfile: In order to allow for longer names and values,
-  the value of macros CFG_NAME_LEN and CFG_NAME_VAL will be increased.
-  Most likely, the new values will be 64 and 256, respectively.
-
 * librte_table: New functions for table entry bulk add/delete will be added
   to the table operations structure.
 
diff --git a/doc/guides/rel_notes/release_2_2.rst b/doc/guides/rel_notes/release_2_2.rst
index 4f75cff..3c85c92 100644
--- a/doc/guides/rel_notes/release_2_2.rst
+++ b/doc/guides/rel_notes/release_2_2.rst
@@ -117,6 +117,10 @@ ABI Changes
 * librte_port: Macros to access the packet meta-data stored within the packet
   buffer has been adjusted to cover the packet mbuf structure.
 
+* librte_cfgfile: In order to allow for longer names and values,
+  the value of macros CFG_NAME_LEN and CFG_VALUE_LEN is increased,
+  the new values are 64 and 256, respectively.
+
 
 Shared Library Versions
 -----------------------
@@ -127,7 +131,7 @@ The libraries prepended with a plus sign were incremented in this version.
 
    + libethdev.so.2
    + librte_acl.so.2
-     librte_cfgfile.so.1
+     librte_cfgfile.so.2
      librte_cmdline.so.1
      librte_distributor.so.1
    + librte_eal.so.2
diff --git a/lib/librte_cfgfile/Makefile b/lib/librte_cfgfile/Makefile
index 032c240..616aef0 100644
--- a/lib/librte_cfgfile/Makefile
+++ b/lib/librte_cfgfile/Makefile
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_cfgfile_version.map
 
-LIBABIVER := 1
+LIBABIVER := 2
 
 #
 # all source are stored in SRCS-y
diff --git a/lib/librte_cfgfile/rte_cfgfile.h b/lib/librte_cfgfile/rte_cfgfile.h
index 7c9fc91..d443782 100644
--- a/lib/librte_cfgfile/rte_cfgfile.h
+++ b/lib/librte_cfgfile/rte_cfgfile.h
@@ -47,8 +47,13 @@ extern "C" {
 *
 ***/
 
-#define CFG_NAME_LEN 32
-#define CFG_VALUE_LEN 64
+#ifndef CFG_NAME_LEN
+#define CFG_NAME_LEN 64
+#endif
+
+#ifndef CFG_VALUE_LEN
+#define CFG_VALUE_LEN 256
+#endif
 
 /** Configuration file */
 struct rte_cfgfile;
-- 
2.1.0

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

* Re: [dpdk-dev] [PATCH v4 0/2] cfgfile: modify the macros values
  2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
  2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 1/2] qos_sched: fix example modification to use librte_cfgfile Jasvinder Singh
  2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 2/2] librte_cfgfile(rte_cfgfile.h): modify the macros values Jasvinder Singh
@ 2015-10-22 16:35       ` Thomas Monjalon
  2015-10-23  8:12         ` Singh, Jasvinder
  2 siblings, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2015-10-22 16:35 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dev

> Michal Jastrzebski (1):
>   qos_sched: fix example modification to use librte_cfgfile
> 
> Jasvinder Singh (1):
>   librte_cfgfile(rte_cfgfile.h): modify the macros values

Applied with more meaningful titles:
	examples/qos_sched: remove duplicated cfgfile library
	cfgfile: increase entry name and value sizes

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

* Re: [dpdk-dev] [PATCH v4 0/2] cfgfile: modify the macros values
  2015-10-22 16:35       ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Thomas Monjalon
@ 2015-10-23  8:12         ` Singh, Jasvinder
  0 siblings, 0 replies; 12+ messages in thread
From: Singh, Jasvinder @ 2015-10-23  8:12 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Thursday, October 22, 2015 5:36 PM
> To: Singh, Jasvinder
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 0/2] cfgfile: modify the macros values
> 
> > Michal Jastrzebski (1):
> >   qos_sched: fix example modification to use librte_cfgfile
> >
> > Jasvinder Singh (1):
> >   librte_cfgfile(rte_cfgfile.h): modify the macros values
> 
> Applied with more meaningful titles:
> 	examples/qos_sched: remove duplicated cfgfile library
> 	cfgfile: increase entry name and value sizes

Thank you, Thomas. I will work on having more precise titles in future.

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

end of thread, other threads:[~2015-10-23  8:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1441289108-4501-1-git-send-email-jasvinder.singh@intel.com>
2015-09-03 14:18 ` [dpdk-dev] [PATCH v2] librte_cfgfile (rte_cfgfile.h): modify the macros values Jasvinder Singh
2015-09-03 14:33   ` Thomas Monjalon
2015-09-03 15:46     ` Mcnamara, John
2015-09-03 17:22       ` Thomas Monjalon
2015-09-04 10:58   ` [dpdk-dev] [PATCH v3] librte_cfgfile(rte_cfgfile.h): " Jasvinder Singh
2015-09-07 11:23     ` Dumitrescu, Cristian
2015-10-19 15:54     ` Thomas Monjalon
2015-10-22 14:03     ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Jasvinder Singh
2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 1/2] qos_sched: fix example modification to use librte_cfgfile Jasvinder Singh
2015-10-22 14:03       ` [dpdk-dev] [PATCH v4 2/2] librte_cfgfile(rte_cfgfile.h): modify the macros values Jasvinder Singh
2015-10-22 16:35       ` [dpdk-dev] [PATCH v4 0/2] cfgfile: " Thomas Monjalon
2015-10-23  8:12         ` Singh, Jasvinder

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).