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 8AAF5235 for ; Tue, 21 Nov 2017 14:25:35 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E716420AFD; Tue, 21 Nov 2017 08:25:34 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:25:34 -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=ErieQpQCmYe+/fnlB 52DLOw91FuW7rTqXKrVhtQlIWo=; b=VByJBIWfrLxS+lRn1MwIvtNo/rzAhObSY kpWLO8Iqmg8D6Q9PHO8i+7L7kTHiF3t+F3dEBRW5Oa1eSoO3NhSKThBEijs78lp1 Dt/xuKEY8BEWJcIqF2RgAJwWUiwZTWk2UtJ5K8sneNHcRRj7dKkj43SUB//cx83q CFcI7WLVVYkcHoCz8FH1dx47ClJ5ZlWHNQnZK+IhrIBDPfci893UI4BdesEESgfZ x2ylac+tCEDh1LycpRkGzNCzm93OOJH+p2/el2EGsGx54VNTRv4RQQbvnKY8SjrX n60zTGt/UahzIGw6TTr5lzoJ35IfF5pVWBtfHcpWwj9JZYhlXsK2Q== 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=ErieQpQCmYe+/fnlB52DLOw91FuW7rTqXKrVhtQlIWo=; b=PCCZqweh Epj/ClbC4pzVL/vI4qMAhN2Sp2rLXun5Oi8Jc5PVT7fabe1FJpOokZ8QzZCjgYP7 XQemlm/ki9Wez6IUotjxqXWlvCn1HhIRrLK/wB34GRGjBZLSKw6rxYV3GMy3Uo1D u0YnwpcLJOBJ1Y2yHFUcr/ro5spDfNOlrb3QJBbpzK7UdhRkvaP/OyRfkcx9uozO +qAZlbCbalAOLZhhwKHZUNxiY2z56F+Cj70RPiAHolbb1U991RbHJAtL4Wzf6scg e7O3CB6Wwa/xFllFWzlESrPIJhaZWkHATifdTabW9NC1UFoj8i22lBMjGAeFwAWI QDOv6f4qC0BXmA== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id EA22A247A9; Tue, 21 Nov 2017 08:25:31 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: Jingjing Wu , dpdk stable Date: Tue, 21 Nov 2017 21:17:20 +0800 Message-Id: <1511270333-31002-98-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 'app/testpmd: fix forward port ids setting' 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:25:35 -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 11f0bc180d9fc683fd2b39de8d49f4285a61af72 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Sun, 3 Sep 2017 16:19:07 +0300 Subject: [PATCH] app/testpmd: fix forward port ids setting [ upstream commit 65a7360cc3378f5b3edd59f230141462dd98cfe9 ] The corrupted code didn't check the port availability when it was trying to set the forward port IDs array. However, when it was counting the number of ports, the availability was checked by RTE_ETH_FOREACH_DEV iterator. Hence, even when ETH devices ports were not in ATTACHED state, the testpmd tried to forward traffic by them and got segmentation fault at queue access time. For example: When EAL command line parameters include two devices, the first is failsafe with two sub devices and the second is any device, testpmd gets two devices by the iterator and sets for forwarding both, the failsafe device and the failsafe first sub device (instead of the second sub device). After the first failsafe sub device state was changed to DEFERRED, testpmd tries to forward traffic through the deferred device because it didn't check the port availability in setting time. The fix uses the RTE_ETH_FOREACH_DEV iterator for the forward port IDs default setting. Fixes: cb894d99eceb ("ethdev: add deferred intermediate device state") Signed-off-by: Matan Azrad Acked-by: Jingjing Wu --- app/test-pmd/testpmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 7d40139..f9bdbf8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -463,9 +463,10 @@ static void set_default_fwd_ports_config(void) { portid_t pt_id; + int i = 0; - for (pt_id = 0; pt_id < nb_ports; pt_id++) - fwd_ports_ids[pt_id] = pt_id; + RTE_ETH_FOREACH_DEV(pt_id) + fwd_ports_ids[i++] = pt_id; nb_cfg_ports = nb_ports; nb_fwd_ports = nb_ports; -- 2.7.4