[dpdk-dev,v2] examples/l2fwd_fork: fix message pool init

Message ID 1505489841-71452-1-git-send-email-xuemingl@mellanox.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xueming Li Sept. 15, 2017, 3:37 p.m. UTC
  Some invalid callback functions are provided to rte_pktmbuf_pool_init()
without their associated data causing a segmentation fault when the
function tries to use it. In this example, those callbacks are not
necessary, they can be safely replaced by NULL pointers.

Fixes: 95e8005a56e8 ("examples/l2fwd_fork: new app")

Cc: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 examples/multi_process/l2fwd_fork/main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Thomas Monjalon Oct. 13, 2017, 10:33 p.m. UTC | #1
15/09/2017 17:37, Xueming Li:
> Some invalid callback functions are provided to rte_pktmbuf_pool_init()
> without their associated data causing a segmentation fault when the
> function tries to use it. In this example, those callbacks are not
> necessary, they can be safely replaced by NULL pointers.
> 
> Fixes: 95e8005a56e8 ("examples/l2fwd_fork: new app")
> 
> Cc: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>

Applied, thanks
  

Patch

diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c
index f8a626b..2e70c2f 100644
--- a/examples/multi_process/l2fwd_fork/main.c
+++ b/examples/multi_process/l2fwd_fork/main.c
@@ -1204,10 +1204,7 @@  struct l2fwd_port_statistics {
 	message_pool = rte_mempool_create("ms_msg_pool",
 			   NB_CORE_MSGBUF * RTE_MAX_LCORE,
 			   sizeof(enum l2fwd_cmd), NB_CORE_MSGBUF / 2,
-			   0,
-			   rte_pktmbuf_pool_init, NULL,
-			   rte_pktmbuf_init, NULL,
-			   rte_socket_id(), 0);
+			   0, NULL, NULL, NULL, NULL, rte_socket_id(), 0);
 
 	if (message_pool == NULL)
 		rte_exit(EXIT_FAILURE, "Create msg mempool failed\n");