From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by dpdk.org (Postfix) with ESMTP id 126554BFE for ; Wed, 20 Mar 2013 17:07:37 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id l10so1183496eei.3 for ; Wed, 20 Mar 2013 09:06:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=+nBiKm9OGokerVIDcP78utwHW5QXp0Z7g9xKlvYYJvI=; b=oYjg3a0uw27HD3Z7jfv2eAj8y7jFP+8ADPfzkakCjW1ItIagVNBORNmr6jgequJ/Sq mP/HFe7Bngf5hzOFTFXnGz9YRUBJUJyLqZMLokZ1bimvqywba/GbZwWgvw+VRtVPs0og 0P3bwtDq1hbYGJKPG/TzWOZjmrzD0n/iKSg0vGbdrMi13Q9tVgX6Ez55uPxcVBX08KOD Acc012xzpAbaORfoKlrMAZGH9hOoUE/1fFt+aD5aNhzxWj7fok9jw3PE3DSyXHgNs1v2 DxEHb5f4P0cLx/SYGQitAN47RvKbD04uAzbhuTfNFhEkPn1fK0k2/2aLY5aEMq/OBbAD Qotw== X-Received: by 10.15.34.198 with SMTP id e46mr72778009eev.27.1363795599028; Wed, 20 Mar 2013 09:06:39 -0700 (PDT) Received: from 6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPS id q5sm3466588eeo.17.2013.03.20.09.06.36 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 20 Mar 2013 09:06:38 -0700 (PDT) Received: by 6wind.com (sSMTP sendmail emulation); Wed, 20 Mar 2013 17:06:36 +0100 From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 20 Mar 2013 17:04:58 +0100 Message-Id: <84063df992e33fa79e1a3b7de978e39a0f709697.1363795499.git.thomas.monjalon@6wind.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQmX2OopyqaRnOTgYyix/dRT2a5uXcKRiX8BzQicSYensCfhyzg4KDCA3xYn9V743P9Pt2IM Subject: [dpdk-dev] [PATCH 10/22] app: fix config crash in testpmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Mar 2013 16:07:38 -0000 From: Damien Millescamps A chained topology must always have an increment of 1. Here, it was 2 if ports number is even. Acked-by: Ivan Boule Acked-by: Thomas Monjalon Signed-off-by: Damien Millescamps --- app/test-pmd/config.c | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 10cf699..708ebad 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2,6 +2,7 @@ * BSD LICENSE * * Copyright(c) 2010-2012 Intel Corporation. All rights reserved. + * Copyright(c) 2012-2013 6WIND. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -547,17 +548,14 @@ simple_fwd_config_setup(void) portid_t j; portid_t inc = 2; - if (nb_fwd_ports % 2) { - if (port_topology == PORT_TOPOLOGY_CHAINED) { - inc = 1; - } - else { - printf("\nWarning! Cannot handle an odd number of ports " - "with the current port topology. Configuration " - "must be changed to have an even number of ports, " - "or relaunch application with " - "--port-topology=chained\n\n"); - } + if (port_topology == PORT_TOPOLOGY_CHAINED) { + inc = 1; + } else if (nb_fwd_ports % 2) { + printf("\nWarning! Cannot handle an odd number of ports " + "with the current port topology. Configuration " + "must be changed to have an even number of ports, " + "or relaunch application with " + "--port-topology=chained\n\n"); } cur_fwd_config.nb_fwd_ports = (portid_t) nb_fwd_ports; -- 1.7.2.5