From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id CF0DF237 for ; Tue, 21 Nov 2017 14:30:03 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 832CD20921; Tue, 21 Nov 2017 08:30:03 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:30:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=w+vcG4+v3tfSaYKTO nAHUKi5tosRZV6QEjSA/UVhT74=; b=cDHfam6YS4cXaRGTLFxYHoihDFYfXyWce 89Dfr2buDjkJBdKi+m+8CFWVKDDEsJUMD72qs85n9LqwxhiQZsuBMDbWz4ceOTj7 BFOtV26LuhnTaiwxDWGgjILcBlqkdR/ap3IkQgFOLHTMJSvM45x33BEzfQMW4G2i VSadLXwPTg5r5HbXEZgz4dI7D5S5YCDMx4jloeQ/exe8qBnxzF+cE9XdESD+OvB4 YTzmOs6qK8a5Ubs1gCLy47My31yaTtcyFgXO4nKd9BsdRCtbeojS8aoh7g8iRl71 kc11BFLc1PmruDSiyvLXv5esG3wJMZ51ph++S5d2b3ljF+IdfUypA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=w+vcG4+v3tfSaYKTOnAHUKi5tosRZV6QEjSA/UVhT74=; b=ijesI0Pb FZ4k+uTJdkPSEs/1kWRzJNBlwBdZ3n5j+tj6DzDUjH+v6iBKZjuzyjVWLA7SgPHw 890yivsKxJ2zoP+FTbWXFwvrGC7sAwKY0Jb1kjJUKgqgdeTIE3BsJhuzeJb/4359 Aotsq11/5YjafonWgx6U9BL2QeyTvQVIjrgUTA+tNW5kWn3HCeb69/OcBPNoUJlB 1sLdCC+eOITHiZkqUMzydaF8kx0QN9hDI43WZFPcb93z/CtQ0D9UePYnKdP4hqY5 YtKJe3zBs3VaDPiv3A3yX9rIpiPlbKIp7iWczxWeJzIC+DoanLhjQXxu+ciMUBXl iojHYjKGU5llVQ== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id 2544C243B9; Tue, 21 Nov 2017 08:30:00 -0500 (EST) From: Yuanhan Liu To: Xueming Li Cc: dpdk stable Date: Tue, 21 Nov 2017 21:18:29 +0800 Message-Id: <1511270333-31002-167-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'examples/multi_process: fix received message length' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:30:04 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 69289ee30af469d5fd0d55d1d37cd41fea2621fe Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Thu, 26 Oct 2017 16:29:23 +0800 Subject: [PATCH] examples/multi_process: fix received message length [ upstream commit 0acd8ed3330a629658e3864d78a6bd4b78de321e ] Simple_mp example receives message size less than 64 chars while send side accepts chars less than 128, this leads to different result when sending text length larger than 64. This patch uses same buffer length on both message pool and command line. Fixes: af75078fece3 ("first public release") Signed-off-by: Xueming Li --- examples/multi_process/simple_mp/main.c | 4 ++-- examples/multi_process/simple_mp/mp_commands.c | 2 +- examples/multi_process/simple_mp/mp_commands.h | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c index 2843d94..53b87c5 100644 --- a/examples/multi_process/simple_mp/main.c +++ b/examples/multi_process/simple_mp/main.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include "mp_commands.h" @@ -76,7 +77,6 @@ static const char *_MSG_POOL = "MSG_POOL"; static const char *_SEC_2_PRI = "SEC_2_PRI"; static const char *_PRI_2_SEC = "PRI_2_SEC"; -const unsigned string_size = 64; struct rte_ring *send_ring, *recv_ring; struct rte_mempool *message_pool; @@ -121,7 +121,7 @@ main(int argc, char **argv) send_ring = rte_ring_create(_PRI_2_SEC, ring_size, rte_socket_id(), flags); recv_ring = rte_ring_create(_SEC_2_PRI, ring_size, rte_socket_id(), flags); message_pool = rte_mempool_create(_MSG_POOL, pool_size, - string_size, pool_cache, priv_data_sz, + STR_TOKEN_SIZE, pool_cache, priv_data_sz, NULL, NULL, NULL, NULL, rte_socket_id(), flags); } else { diff --git a/examples/multi_process/simple_mp/mp_commands.c b/examples/multi_process/simple_mp/mp_commands.c index 8da244b..cde3abd 100644 --- a/examples/multi_process/simple_mp/mp_commands.c +++ b/examples/multi_process/simple_mp/mp_commands.c @@ -78,7 +78,7 @@ static void cmd_send_parsed(void *parsed_result, if (rte_mempool_get(message_pool, &msg) < 0) rte_panic("Failed to get message buffer\n"); - snprintf((char *)msg, string_size, "%s", res->message); + snprintf((char *)msg, STR_TOKEN_SIZE, "%s", res->message); if (rte_ring_enqueue(send_ring, msg) < 0) { printf("Failed to send message - message discarded\n"); rte_mempool_put(message_pool, msg); diff --git a/examples/multi_process/simple_mp/mp_commands.h b/examples/multi_process/simple_mp/mp_commands.h index 7e9a4ab..452b364 100644 --- a/examples/multi_process/simple_mp/mp_commands.h +++ b/examples/multi_process/simple_mp/mp_commands.h @@ -34,7 +34,6 @@ #ifndef _SIMPLE_MP_COMMANDS_H_ #define _SIMPLE_MP_COMMANDS_H_ -extern const unsigned string_size; extern struct rte_ring *send_ring; extern struct rte_mempool *message_pool; extern volatile int quit; -- 2.7.4