From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 866A01B799 for ; Wed, 7 Feb 2018 09:59:57 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3E16020BF9; Wed, 7 Feb 2018 03:59:57 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 07 Feb 2018 03:59:57 -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=fm2; bh=cr+NwwOHjn8ZAyv0d 0hbQomWcX032QMrF9W174ieD+o=; b=bNcEQMi+srWNLrBUtguNX2y7PYHXc2rJ1 QAxzkpA2Zb83lpug/kMeIhi3QDPjudMf5BbrfsZQTjKnLIbRMd0kybnQWD92VpA2 TLN+K4VHx9TRxyr1eM1uHCD31vPcubHRHk3lIhlY7VfYC6V3MbnmvXiVRv32kxZl GTOuxfkjZcDionDk2eagLC57+FWJhnK3q6v8NvMZ8hMWFbZmNNqczFul0qhUeOx4 rdbumRnmbL5lOQuO7U55KVr6++JBybiV4CHHYM402Lv8jNzUmpNB7BPkfFfgxw9h qaUpFacImekZiLMTfpq/X541OQbC0nQRGyyQr4rqWapPTEcgMplRg== 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=cr+NwwOHjn8ZAyv0d0hbQomWcX032QMrF9W174ieD+o=; b=D0vqw9NH u3gPEYXkH5ZoqMP+kNAi/lC/Eg9FglmyE0kEo8gKZk7akI0ckY/Kz16pMVcNjsHI KLDc4yjnPKcGBPCa3Rd7T5rgaF2KlWe+U3uAD73yjhY26iKI5RIeBvUqZ54Pdw+8 sbYFNhjLSFL7Q6gEzrqV7L7G8euOtJSx3t4U4AiyT/qnBmW8//YlCGfPTaxqm61s 4FmizBt8ad7QjIeMqqRYI2unkbO8IylRjvbGMICZsJH1hlikmIBJ2b/6h8Q6BPaD +NUvhp/Bl9+FNnXRdBb3fBh0I3oN1Z7iDnjH3oMRQqNRi+3rzlNgnO1FusTZ0N7y YW7T2uQulveowg== X-ME-Sender: Received: from localhost.localdomain (unknown [182.84.161.100]) by mail.messagingengine.com (Postfix) with ESMTPA id 551D224636; Wed, 7 Feb 2018 03:59:55 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: dpdk stable Date: Wed, 7 Feb 2018 16:57:08 +0800 Message-Id: <1517993838-26692-14-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> References: <1517993838-26692-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'app/testpmd: fix port topology in RSS forward config' has been queued to LTS release 17.11.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: Wed, 07 Feb 2018 08:59:57 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.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 02/09/18. So please shout if anyone has objections. Thanks. --yliu --- >>From 1c5819ed8fb4fbbd675ceafd16b3ad6b2f5eb65a Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Mon, 5 Feb 2018 14:09:22 +0000 Subject: [PATCH] app/testpmd: fix port topology in RSS forward config [ upstream commit 4deefb6f7107dd6a40900be4f1d6a6844a702505 ] The testpmd user can configure port topology mode to define the port topology between the testpmd forward ports(paired, chained and loop). When multi-queue ports are configured by the user, the testpmd streams are created by rss_fwd_config_setup() function, this function doesn't take into account the chained topology mode and configures the forward streams with paired topology mode in this case. Configure the stream Tx port by dedicated function which calculates a valid Tx port index as a function of the topology mode and the Rx port index. Fixes: af75078 ("first public release") Signed-off-by: Matan Azrad --- app/test-pmd/config.c | 49 +++++++++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 24451fc..a0f3c24 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1876,6 +1876,36 @@ setup_fwd_config_of_each_lcore(struct fwd_config *cfg) } } +static portid_t +fwd_topology_tx_port_get(portid_t rxp) +{ + static int warning_once = 1; + + RTE_ASSERT(rxp < cur_fwd_config.nb_fwd_ports); + + switch (port_topology) { + default: + case PORT_TOPOLOGY_PAIRED: + if ((rxp & 0x1) == 0) { + if (rxp + 1 < cur_fwd_config.nb_fwd_ports) + return rxp + 1; + if (warning_once) { + printf("\nWarning! port-topology=paired" + " and odd forward ports number," + " the last port will pair with" + " itself.\n\n"); + warning_once = 0; + } + return rxp; + } + return rxp - 1; + case PORT_TOPOLOGY_CHAINED: + return (rxp + 1) % cur_fwd_config.nb_fwd_ports; + case PORT_TOPOLOGY_LOOP: + return rxp; + } +} + static void simple_fwd_config_setup(void) { @@ -1938,11 +1968,6 @@ simple_fwd_config_setup(void) * For the RSS forwarding test all streams distributed over lcores. Each stream * being composed of a RX queue to poll on a RX port for input messages, * associated with a TX queue of a TX port where to send forwarded packets. - * All packets received on the RX queue of index "RxQj" of the RX port "RxPi" - * are sent on the TX queue "TxQl" of the TX port "TxPk" according to the two - * following rules: - * - TxPk = (RxPi + 1) if RxPi is even, (RxPi - 1) if RxPi is odd - * - TxQl = RxQj */ static void rss_fwd_config_setup(void) @@ -1974,19 +1999,7 @@ rss_fwd_config_setup(void) struct fwd_stream *fs; fs = fwd_streams[sm_id]; - - if ((rxp & 0x1) == 0) - txp = (portid_t) (rxp + 1); - else - txp = (portid_t) (rxp - 1); - /* - * if we are in loopback, simply send stuff out through the - * ingress port - */ - if (port_topology == PORT_TOPOLOGY_LOOP || - txp >= cur_fwd_config.nb_fwd_ports) - txp = rxp; - + txp = fwd_topology_tx_port_get(rxp); fs->rx_port = fwd_ports_ids[rxp]; fs->rx_queue = rxq; fs->tx_port = fwd_ports_ids[txp]; -- 2.7.4