[dpdk-dev] [PATCH] devtools: fix symbol check when adding experimental section

2018-12-04 Thread gfree . wind
From: David Marchand 

The incriminated commit did relax the condition to catch all sections
but dropped the + removal which can trigger false detection of the
special EXPERIMENTAL section when adding symbols and the section in the
same patch.

Fixes: 7281cf520f89 ("devtools: relax rule for identifying symbol section")
Cc: sta...@dpdk.org

Signed-off-by: David Marchand 
Acked-by: Neil Horman 
---
 devtools/check-symbol-change.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/devtools/check-symbol-change.sh b/devtools/check-symbol-change.sh
index 4b8d9f3..020da7e 100755
--- a/devtools/check-symbol-change.sh
+++ b/devtools/check-symbol-change.sh
@@ -31,6 +31,7 @@ build_map_changes()
# Triggering this rule sets in_sec to 1, which actives the
# symbol rule below
/^.*{/ {
+   gsub("+", "");
if (in_map == 1) {
sec=$(NF-1); in_sec=1;
}
-- 
2.7.4




[dpdk-dev] [PATCH] eal: fix memleak on mp request error handler

2018-12-04 Thread gfree . wind
From: Gao Feng 

When rte_eal_alarm_set failed, need to free the bundle mem in the
error handler of handle_primary_request and handle_secondary_request.

Signed-off-by: Gao Feng 
---
 lib/librte_eal/common/hotplug_mp.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_eal/common/hotplug_mp.c 
b/lib/librte_eal/common/hotplug_mp.c
index 070e2e0..9d610a8 100644
--- a/lib/librte_eal/common/hotplug_mp.c
+++ b/lib/librte_eal/common/hotplug_mp.c
@@ -208,6 +208,8 @@ static int cmp_dev_name(const struct rte_device *dev, const 
void *_name)
ret = rte_eal_alarm_set(1, __handle_secondary_request, bundle);
if (ret != 0) {
RTE_LOG(ERR, EAL, "failed to add mp task\n");
+   free(bundle->peer);
+   free(bundle);
return send_response_to_secondary(req, ret, peer);
}
return 0;
@@ -332,6 +334,8 @@ static void __handle_primary_request(void *param)
 */
ret = rte_eal_alarm_set(1, __handle_primary_request, bundle);
if (ret != 0) {
+   free(bundle->peer);
+   free(bundle);
resp->result = ret;
ret = rte_mp_reply(&mp_resp, peer);
if  (ret != 0) {
-- 
1.8.3.1




[dpdk-dev] [PATCH] eal: Add the check for null peer pointer in mp request handler

2018-12-04 Thread gfree . wind
From: Gao Feng 

Add the check for null peer pointer like the bundle pointer in the mp request
handler. They should follow same style. And add some logs for nomem cases.

Signed-off-by: Gao Feng 
---
 lib/librte_eal/common/hotplug_mp.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/lib/librte_eal/common/hotplug_mp.c 
b/lib/librte_eal/common/hotplug_mp.c
index 070e2e0..0d2996f 100644
--- a/lib/librte_eal/common/hotplug_mp.c
+++ b/lib/librte_eal/common/hotplug_mp.c
@@ -200,6 +200,11 @@ static int cmp_dev_name(const struct rte_device *dev, 
const void *_name)
 * when it is ready.
 */
bundle->peer = strdup(peer);
+   if (bundle->peer == NULL) {
+   free(bundle);
+   RTE_LOG(ERR, EAL, "not enough memory\n");
+   return send_response_to_secondary(req, -ENOMEM, peer);
+   }
 
/**
 * We are at IPC callback thread, sync IPC is not allowed due to
@@ -311,6 +316,7 @@ static void __handle_primary_request(void *param)
 
bundle = calloc(1, sizeof(*bundle));
if (bundle == NULL) {
+   RTE_LOG(ERR, EAL, "not enough memory\n");
resp->result = -ENOMEM;
ret = rte_mp_reply(&mp_resp, peer);
if (ret)
@@ -325,6 +331,15 @@ static void __handle_primary_request(void *param)
 * when it is ready.
 */
bundle->peer = (void *)strdup(peer);
+   if (bundle->peer == NULL) {
+   RTE_LOG(ERR, EAL, "not enough memory\n");
+   free(bundle);
+   resp->result = -ENOMEM;
+   ret = rte_mp_reply(&mp_resp, peer);
+   if (ret)
+   RTE_LOG(ERR, EAL, "failed to send reply to primary 
request\n");
+   return ret;
+   }
 
/**
 * We are at IPC callback thread, sync IPC is not allowed due to
-- 
1.8.3.1




[dpdk-dev] [PATCH] eal: fix unlock in rte_eal_memzone_init

2018-12-05 Thread gfree . wind
From: Gao Feng 

The RTE_PROC_PRIMARY error handler lost the unlock statement in the
current codes. Now fix it.

Signed-off-by: Gao Feng 
---
 lib/librte_eal/common/eal_common_memzone.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_eal/common/eal_common_memzone.c 
b/lib/librte_eal/common/eal_common_memzone.c
index b7081af..649cad4 100644
--- a/lib/librte_eal/common/eal_common_memzone.c
+++ b/lib/librte_eal/common/eal_common_memzone.c
@@ -375,6 +375,7 @@
rte_fbarray_init(&mcfg->memzones, "memzone",
RTE_MAX_MEMZONE, sizeof(struct rte_memzone))) {
RTE_LOG(ERR, EAL, "Cannot allocate memzone list\n");
+   rte_rwlock_write_unlock(&mcfg->mlock);
return -1;
} else if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
rte_fbarray_attach(&mcfg->memzones)) {
-- 
1.8.3.1