Skip to contentSkip to conversation

vdev: free reply.msgs memory for secondary process

PATCH In review Paul Luse 3 participants 4 messages Sep 21, 2018 – Oct 25, 2018

lore
Share & tools
lore

Paul Luse

author
#0 lore raw

PATCH 1/1 vdev: free reply.msgs memory for secondary process

From: paul luse <[email protected]>

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

---
 drivers/bus/vdev/vdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/vdev/vdev.c +1 -0
index 69dee89a8..2566d6c0d 100644
@@ -423,6 +423,7 @@ vdev_scan(void)
 			mp_rep = &mp_reply.msgs[0];
 			resp = (struct vdev_param *)mp_rep->param;
 			VDEV_LOG(INFO, "Received %d vdevs", resp->num);
+			free(mp_reply.msgs);
 		} else
 			VDEV_LOG(ERR, "Failed to request vdev from primary");
 
Signature · 1 line
2.14.4
#1 lore raw
Quoted 6 lines · Paul Luse

From: paul luse <[email protected]>

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

Hi Paul,

Is this different from below patch, which seems already acked:
https://patches.dpdk.org/patch/45079/

Quoted 17 lines
---
 drivers/bus/vdev/vdev.c | 1 +
 1 file changed, 1 insertion(+)
drivers/bus/vdev/vdev.c +1 -0
index 69dee89a8..2566d6c0d 100644
@@ -423,6 +423,7 @@ vdev_scan(void)
 			mp_rep = &mp_reply.msgs[0];
 			resp = (struct vdev_param *)mp_rep->param;
 			VDEV_LOG(INFO, "Received %d vdevs", resp->num);
+			free(mp_reply.msgs);
 		} else
 			VDEV_LOG(ERR, "Failed to request vdev from primary");
 
Acked-by Anatoly Burakov Acked-by on v1 1/1
#2 lore raw
In reply to Paul Luse
Quoted 6 lines · Paul Luse

From: paul luse <[email protected]>

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

(carry from Anatoly's ack from other thread)

@Anatoly, what do you think about:
diff --git a/lib/librte_eal/common/include/rte_eal.h
b/lib/librte_eal/common/include/rte_eal.h
index e114dcbdc..e1a554f5a 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -309,7 +309,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);
* This function sends a request message to the peer process, and will
* block until receiving reply message from the peer process. *
- * @note The caller is responsible to free reply->replies.
+ * @note The caller is responsible to free reply->msgs.
*
* @param req
* The req argument contains the customized request message.

#3 lore raw

27/09/2018 15:28, Ferruh Yigit:

Quoted 6 lines · Paul Luse
Quoted 5 lines

From: paul luse <[email protected]>

This patch fixes an issue caught with ASAN where a vdev_scan() to a secondary bus was failing to free some memory.

Quoted 6 lines
Quoted 1 line

(carry from Anatoly's ack from other thread)

Adding Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: [email protected]

Quoted 7 lines

@Anatoly, what do you think about:
diff --git a/lib/librte_eal/common/include/rte_eal.h
b/lib/librte_eal/common/include/rte_eal.h
index e114dcbdc..e1a554f5a 100644
--- a/lib/librte_eal/common/include/rte_eal.h
+++ b/lib/librte_eal/common/include/rte_eal.h
@@ -309,7 +309,7 @@ rte_mp_sendmsg(struct rte_mp_msg *msg);

Quoted 8 lines

* This function sends a request message to the peer process, and will
* block until receiving reply message from the peer process. *
- * @note The caller is responsible to free reply->replies.
+ * @note The caller is responsible to free reply->msgs.
*
* @param req
* The req argument contains the customized request message.

Adding this change to the commit.

Fixes 783b6e54971d ("eal: add synchronous multi-process communication")

All applied, thanks