From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by dpdk.org (Postfix) with ESMTP id BB6681B703 for ; Tue, 15 May 2018 19:20:10 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id y72-v6so1405873lfd.2 for ; Tue, 15 May 2018 10:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8zph10y8CSV+ycNf0POVT6I8CLen1ftI83STODMEB7U=; b=ghf4V48deoVFR4Logm7Q/Ma/5yUnxkFH5lCmN0hScbHfABNJM7+wTffhqPhUXB0/VY Zfi2iJd8tmV8n6s2USOqTteO7dAOSYvivx+DROIzofIfgFGGOZ8VKI/TJ6JjD4XZL01t qK8omtP0lZ75kXPZ8IAYz0xiroY6nbWL/fyvo410y5UUaFC928TjiNazyIqiDAChqL31 OTlM4U0hOyisbUZmPoMwzVKlMjNp8c3ZHPqD6OuycWYr7+1x0Eiu99mtOwpqFN+QAg0c oCfVtsM8hSLXYSrqQpmv23L9RnJLK1oOPPxUdBJRAmLd2xKekGK2OZ5fviw36Jgh/2fI hOlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8zph10y8CSV+ycNf0POVT6I8CLen1ftI83STODMEB7U=; b=LjdalHOCfcCUnMLHcBfoBc9xwHjkPecm6JJzWlIIGACVQyb8uHIo1IUtm+KWqLc1fW cZs/aqEqWxjWxebQcjL2ymqsZ3UmijaNlhattzYVDmO+hYhP8FJ8nZPbReCAVXGfJWqA mhaOD69AeHtlTfuGvym/vqaXyi+4UbR1M0hCTtL/tu2liyCl905c3CawtkbpjgjB3+zP bN67oG+M8MM69OfjulYh3gnMElsfWW+8d7Ifkd61Sh2USF0Nn3yn5FqCaLtrC/CC8kn9 3XfeNTRH35O8EdYzJUnTXgz5D9WiJTOexHcHAr3BqNC5lkpPXU//sFOz59G2RW4cNomm icFA== X-Gm-Message-State: ALKqPwcZ8MBz4wR0GKATOG3Zqf3509BqxOF/UeAVl+73hnlPvnnEODN0 l4K6t8e0H69aprnEvF3X8h8= X-Google-Smtp-Source: AB8JxZpnrBBgusRL+F50iYE34q+lmm3Dkkf2k+KIMt9GyhybCIXdQ3NibO8+S97yJ5GGt/GYrpO9Tw== X-Received: by 2002:a19:6d02:: with SMTP id i2-v6mr13032418lfc.81.1526404810339; Tue, 15 May 2018 10:20:10 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id m25-v6sm121792lfc.83.2018.05.15.10.20.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 10:20:09 -0700 (PDT) From: luca.boccassi@gmail.com To: Matan Azrad Cc: dpdk stable Date: Tue, 15 May 2018 18:19:17 +0100 Message-Id: <20180515171933.12882-16-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515171933.12882-1-luca.boccassi@gmail.com> References: <20180501104509.17238-46-luca.boccassi@gmail.com> <20180515171933.12882-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'app/testpmd: fix forward ports update' has been queued to LTS release 16.11.7 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, 15 May 2018 17:20:10 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.7 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/16/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From f2728e66cb2f8e6bc106f4a1d34884cf4fc39e45 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 | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9313d0bbc..978606252 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -675,18 +675,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); + 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"); + 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.14.2