From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 11CAE2AA0 for ; Sun, 20 May 2018 15:08:53 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B4B1621D4F; Sun, 20 May 2018 09:08:52 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 20 May 2018 09:08:52 -0400 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=fm2; bh=i21NJ/jRjevJBv5lV Rxo8moDmXxxULrM6GSHQAgGYIc=; b=hfYyb34JbJ1FBDG26dOaHo5rfNXLaZXH6 YzxkjGTP+uyVs3aRMRi6xLvEnD8g8e3Zv5zybBhgkFQu1JCFuESs4BpBPgYq8gz2 +hOSDDUnY3w+tHdvn6GbowpqR6lXm58ZDePo/xXgG+tUN5c3e5Lm5jPSmIGu00CB /NIWwSUZzubhYs/B70f2hoPOW3bG3ZRUbxS5ypkMDPyLh1dGTpXcm3qr+ykRFW10 Fw3kjFtq+jrGCQeGGC64idhTBnPfvKPhBRHLot6K7gz00UH7a8gVqFnPDAs0ikZj 87d79FBTmfAJo+Lky2W93z4mkOW5tIFWy4IFsAsA6nduLfa4DEiLA== 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= fm2; bh=i21NJ/jRjevJBv5lVRxo8moDmXxxULrM6GSHQAgGYIc=; b=ayhUQPjH CPK3vOQ6hDGAA1sryY/BCT+RrzHzGA+QcNY4qavs2A5LXW2SfJHqyt0iaXjGIi7g w/V5KPVwMFKyqCrw2ZYhWO7zk9RPEN2i6h2gf649VC9ah2mOTxWZ5uzo7kmRyU3D nZw/hW7eVJLLFvdSUD0RHDG+W9zSUJK1qVkhp6Xw3AO+cBtvvNTjkvh4D7YwIr4U 1YU0zM50a9XJRBZfKgOi83m53fgEND2qlgJVJ8ltnUQ6fsGarIfXJw4cbOiIvUKC +ZjpsgSIeyQEQS92RN9f2ZAWS6VANpq6dyb1EAgtN7lDrQnWVLw4MdCGDeRKC14q kpKm5KxBj7tdug== X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from yuanhanliu-NB0.tencent.com (unknown [223.74.148.80]) by mail.messagingengine.com (Postfix) with ESMTPA id 4BD811025C; Sun, 20 May 2018 09:08:51 -0400 (EDT) From: Yuanhan Liu To: Matan Azrad Cc: dpdk stable Date: Sun, 20 May 2018 21:02:27 +0800 Message-Id: <20180520130246.16287-11-yliu@fridaylinux.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180520130246.16287-1-yliu@fridaylinux.org> References: <20180520130246.16287-1-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix forward ports update' has been queued to LTS release 17.11.3 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: Sun, 20 May 2018 13:08:53 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/27/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 0a533fcda52d3b74b19d80f34958efdb2bd3c8ba Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Thu, 3 May 2018 10:31:44 +0000 Subject: [PATCH] app/testpmd: fix forward ports update [ upstream commit 1f84c4695a567edc8cd8dc2572aa320cdeb9c358 ] When the forward ports are changed either by new portlist\portmask configurations or by a port detachment, all the old forward streams are freed and new streams are allocated to be aligned with the new forward ports. If the number of the forward ports drops to 0, there is an attempt to wrongly allocate 0 memory for the streams. Skip the streams memory allocation if no forward ports are configured. Fixes: ce8d561418d4 ("app/testpmd: add port configuration settings") Signed-off-by: Matan Azrad --- app/test-pmd/testpmd.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 03c9aa7f8..254bd9449 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -880,18 +880,23 @@ init_fwd_streams(void) /* init new */ nb_fwd_streams = nb_fwd_streams_new; - fwd_streams = rte_zmalloc("testpmd: fwd_streams", - sizeof(struct fwd_stream *) * nb_fwd_streams, RTE_CACHE_LINE_SIZE); - if (fwd_streams == NULL) - rte_exit(EXIT_FAILURE, "rte_zmalloc(%d (struct fwd_stream *)) " - "failed\n", nb_fwd_streams); - - for (sm_id = 0; sm_id < nb_fwd_streams; sm_id++) { - fwd_streams[sm_id] = rte_zmalloc("testpmd: struct fwd_stream", - sizeof(struct fwd_stream), RTE_CACHE_LINE_SIZE); - if (fwd_streams[sm_id] == NULL) - rte_exit(EXIT_FAILURE, "rte_zmalloc(struct fwd_stream)" - " failed\n"); + if (nb_fwd_streams) { + fwd_streams = rte_zmalloc("testpmd: fwd_streams", + sizeof(struct fwd_stream *) * nb_fwd_streams, + RTE_CACHE_LINE_SIZE); + if (fwd_streams == NULL) + rte_exit(EXIT_FAILURE, "rte_zmalloc(%d" + " (struct fwd_stream *)) failed\n", + nb_fwd_streams); + + for (sm_id = 0; sm_id < nb_fwd_streams; sm_id++) { + fwd_streams[sm_id] = rte_zmalloc("testpmd:" + " struct fwd_stream", sizeof(struct fwd_stream), + RTE_CACHE_LINE_SIZE); + if (fwd_streams[sm_id] == NULL) + rte_exit(EXIT_FAILURE, "rte_zmalloc" + "(struct fwd_stream) failed\n"); + } } return 0; -- 2.11.0