summaryrefslogtreecommitdiffstats
path: root/src/dpdk/lib/librte_eal/common
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-07-31 11:16:27 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-07-31 11:21:40 +0300
commitdceb010b01e9f8a0e9c905370d39f149f01cab7e (patch)
tree562201fb20db07440462f27e4d8b95ad3ce84611 /src/dpdk/lib/librte_eal/common
parent81c896604a50486d8b658dc559f7b98492d778e5 (diff)
dpdk 16.07 - merges of final version changes
Diffstat (limited to 'src/dpdk/lib/librte_eal/common')
-rw-r--r--src/dpdk/lib/librte_eal/common/eal_common_memzone.c12
-rw-r--r--src/dpdk/lib/librte_eal/common/eal_common_options.c19
-rw-r--r--src/dpdk/lib/librte_eal/common/include/rte_tailq.h8
-rw-r--r--src/dpdk/lib/librte_eal/common/include/rte_version.h4
4 files changed, 28 insertions, 15 deletions
diff --git a/src/dpdk/lib/librte_eal/common/eal_common_memzone.c b/src/dpdk/lib/librte_eal/common/eal_common_memzone.c
index 5d28341f..1bd0a33d 100644
--- a/src/dpdk/lib/librte_eal/common/eal_common_memzone.c
+++ b/src/dpdk/lib/librte_eal/common/eal_common_memzone.c
@@ -144,16 +144,16 @@ memzone_reserve_aligned_thread_unsafe(const char *name, size_t len,
return NULL;
}
- /* zone already exist */
- if ((memzone_lookup_thread_unsafe(name)) != NULL) {
- RTE_LOG(DEBUG, EAL, "%s(): memzone <%s> already exists\n",
+ if (strlen(name) > sizeof(mz->name) - 1) {
+ RTE_LOG(DEBUG, EAL, "%s(): memzone <%s>: name too long\n",
__func__, name);
- rte_errno = EEXIST;
+ rte_errno = ENAMETOOLONG;
return NULL;
}
- if (strlen(name) >= sizeof(mz->name) - 1) {
- RTE_LOG(DEBUG, EAL, "%s(): memzone <%s>: name too long\n",
+ /* zone already exist */
+ if ((memzone_lookup_thread_unsafe(name)) != NULL) {
+ RTE_LOG(DEBUG, EAL, "%s(): memzone <%s> already exists\n",
__func__, name);
rte_errno = EEXIST;
return NULL;
diff --git a/src/dpdk/lib/librte_eal/common/eal_common_options.c b/src/dpdk/lib/librte_eal/common/eal_common_options.c
index 0a594d7f..1a1bab36 100644
--- a/src/dpdk/lib/librte_eal/common/eal_common_options.c
+++ b/src/dpdk/lib/librte_eal/common/eal_common_options.c
@@ -116,9 +116,9 @@ TAILQ_HEAD_INITIALIZER(solib_list);
static const char *default_solib_dir = RTE_EAL_PMD_PATH;
/*
- * Stringified version of solib path used by pmdinfo.py
+ * Stringified version of solib path used by dpdk-pmdinfo.py
* Note: PLEASE DO NOT ALTER THIS without making a corresponding
- * change to tools/pmdinfo.py
+ * change to tools/dpdk-pmdinfo.py
*/
static const char dpdk_solib_path[] __attribute__((used)) =
"DPDK_PLUGIN_PATH=" RTE_EAL_PMD_PATH;
@@ -530,6 +530,13 @@ eal_parse_set(const char *input, uint16_t set[], unsigned num)
str = end + 1;
} while (*end != '\0' && *end != ')');
+ /*
+ * to avoid failure that tail blank makes end character check fail
+ * in eal_parse_lcores( )
+ */
+ while (isblank(*str))
+ str++;
+
return str - input;
}
@@ -578,13 +585,12 @@ eal_parse_lcores(const char *lcores)
struct rte_config *cfg = rte_eal_get_configuration();
static uint16_t set[RTE_MAX_LCORE];
unsigned idx = 0;
- int i;
unsigned count = 0;
const char *lcore_start = NULL;
const char *end = NULL;
int offset;
rte_cpuset_t cpuset;
- int lflags = 0;
+ int lflags;
int ret = -1;
if (lcores == NULL)
@@ -593,9 +599,6 @@ eal_parse_lcores(const char *lcores)
/* Remove all blank characters ahead and after */
while (isblank(*lcores))
lcores++;
- i = strlen(lcores);
- while ((i > 0) && isblank(lcores[i - 1]))
- i--;
CPU_ZERO(&cpuset);
@@ -613,6 +616,8 @@ eal_parse_lcores(const char *lcores)
if (*lcores == '\0')
goto err;
+ lflags = 0;
+
/* record lcore_set start point */
lcore_start = lcores;
diff --git a/src/dpdk/lib/librte_eal/common/include/rte_tailq.h b/src/dpdk/lib/librte_eal/common/include/rte_tailq.h
index 4a686e68..cc3c0f1d 100644
--- a/src/dpdk/lib/librte_eal/common/include/rte_tailq.h
+++ b/src/dpdk/lib/librte_eal/common/include/rte_tailq.h
@@ -155,6 +155,14 @@ void __attribute__((constructor, used)) tailqinitfn_ ##t(void) \
rte_panic("Cannot initialize tailq: %s\n", t.name); \
}
+/* This macro permits both remove and free var within the loop safely.*/
+#ifndef TAILQ_FOREACH_SAFE
+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = TAILQ_FIRST((head)); \
+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/src/dpdk/lib/librte_eal/common/include/rte_version.h b/src/dpdk/lib/librte_eal/common/include/rte_version.h
index eacc86c1..615deb7f 100644
--- a/src/dpdk/lib/librte_eal/common/include/rte_version.h
+++ b/src/dpdk/lib/librte_eal/common/include/rte_version.h
@@ -70,14 +70,14 @@ extern "C" {
/**
* Extra string to be appended to version number
*/
-#define RTE_VER_SUFFIX "-rc"
+#define RTE_VER_SUFFIX ""
/**
* Patch release number
* 0-15 = release candidates
* 16 = release
*/
-#define RTE_VER_RELEASE 3
+#define RTE_VER_RELEASE 16
/**
* Macro to compute a version number usable for comparisons