From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 3C5E51B873 for ; Tue, 15 May 2018 15:48:38 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id p5-v6so199461wre.12 for ; Tue, 15 May 2018 06:48:38 -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=sLAMr2htI17mcjR3/I1dFGqsX933ndksu8uCkfHmJX0=; b=YtUNGi3pc/Th5UeMd8SiLhmy13dA6mzNu5HcKlfCbg2y3A0FB5EP9epQ+ClrZ0cY8O IDWI3+9U8Gi6HlDS0R29Y6THAn0aQz1Z1bf5jPy4aogtMZ3K0IJlgyahR9ygKt7fJUW3 +/Qf9TOaXf2SfNjAdrTV7pG3AbdZN5XOUcStcHX0/QbUnu2VETIw5CPYaoMyPrsHFyin P6bio1jtp78QtRQxszrUQpIVgjRzYgEtoyomRyqfQpbVuflPGoWDV/qNI7ZH7PXwAbO8 N7yADc+Z2Newcd45gS7UUhIMNHMGZ5HaaAB6O0Zgrm1mqSud47ZGzXUJNu70K6IoGan2 zZ9Q== 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=sLAMr2htI17mcjR3/I1dFGqsX933ndksu8uCkfHmJX0=; b=lJyANBYU+6SqSpU6UTTuaiGJKczRD8AJK3K6/iudNeXAM4TvuzVT9lmIJWpCTyc24z SuQsuqp2IrZnorNvGejcEWD08owUW0e8sCDkbNHV4MA3HqnMP8CgyTqCi+zAnJnYRXZm 83lWy7NJ5I/xCJ6ilrO3dgPEO0kFeZSU9z61d0IEDMzbm5UKAmbtmTeUP2yPzFSvwSWc UbBiK1wSonpKC9niJOsivo9T11DuvbVVObr+UalBcGbUtM+uQ+0RFjUchVmn76RRxNaW 4K+oEoBUOoGD1qVr083Cd3E6dYjCMqvMDedGRMiv4LX/YxD/ktpyvA3BwXYxHPsoKKJ3 AA/Q== X-Gm-Message-State: ALKqPwfIgo27wY6wqQ2ciB9LfJH/mZfcoNuajVfJd8fwTuIdlJUEwVZk HNMMvfcB1N+jknDw4iCA3QQ= X-Google-Smtp-Source: AB8JxZoc5YxFE7lG5YIM87hTq49hX+qCyhEADs1N91FGF2lgohjloPWDfWMoILshvZeDW9XCKsqyOw== X-Received: by 2002:adf:e985:: with SMTP id h5-v6mr11165923wrm.137.1526392117951; Tue, 15 May 2018 06:48:37 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id l1-v6sm112384wre.54.2018.05.15.06.48.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 06:48:37 -0700 (PDT) From: luca.boccassi@gmail.com To: Matan Azrad Cc: dpdk stable Date: Tue, 15 May 2018 14:46:44 +0100 Message-Id: <20180515134731.9337-33-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515134731.9337-1-luca.boccassi@gmail.com> References: <20180503110612.12146-2-luca.boccassi@gmail.com> <20180515134731.9337-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'app/testpmd: fix forward ports update' has been queued to stable release 18.02.2 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 13:48:38 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 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 e103ed9a228dff5b7362abfc835c1d53f6acc9e9 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 d168805d8..2f54d22c4 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -871,18 +871,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