From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) by dpdk.org (Postfix) with ESMTP id 8AAFE1B738 for ; Wed, 7 Feb 2018 17:47:58 +0100 (CET) Received: by mail-wr0-f177.google.com with SMTP id b52so1753718wrd.10 for ; Wed, 07 Feb 2018 08:47:58 -0800 (PST) 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=1k0NkNDx56jYMAkzXgO2vJxILl3ESQy4AphL0RDnKDI=; b=r2bW5uuTsLpf6s7gLRqBDlne8T3lFPCMyRvDCn2dAlxmyrFiujou+IzYNNqTt0sacs RJWDHQUS7LZgUJdxuzYdp3Zboi6EVygB0fzVL512Hv5qMQGM3kjUshnbrhzUxyBkv1GO oQdznSjXGfbGjKZCmD9g2b5xoK7zQJwAQYek1JYHnuABtjgzpw9kPujZkv3DmH49jcb4 nyLYUBp7OKV11WsMxcJPvwAKLXMdmlT60ffcmB0U+WENP7pT+gUyB7pu1sd/yxcYAbaS IkXamUYmLaF55wm60dc2ngOLCgp+2agXFkMk8pb9PPPL3f1xYkh4CAG/lAIWcIIDUwRG SaUg== 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=1k0NkNDx56jYMAkzXgO2vJxILl3ESQy4AphL0RDnKDI=; b=EIr/HksCvxMFAGB9Ac1tJv7S9gBBfpoXkfKcqusG31j7v2kRJ2vA6p/H+W3Y0bf1zC RjbChDM+UVQje1ynIV9dRnxFhtwDIHvxqweUc1KqQTcUhX9fMIXke6yHce9EgebA7/Pv Q2I3KNQ13SLJUXPGUz49ogdihTJJTvl4Vvs7za2mxAVxxWeEnMBY4NILQrMh83+KIyQz yxR1a/u83PlvhXQ0VBxIo8WoalvblT5JWD29XBe76W4dpktg9CBNNoomJ17tSi2nglE0 oNRL8j/+kvwryfLdHFSSF+3Ywf7JkzXJBJ7ZVGuUri9qXlpZEsgFWDyjvQkgyRye9rOE Q6Dg== X-Gm-Message-State: APf1xPBThjhJcA+MjBgInKsVp79Sa4NoMa93kQ8gKb8/FhuVhfTsibKC uW2n2P0OW8wrAKMsse9/y9w= X-Google-Smtp-Source: AH8x2270xFDxuQkkuy98UtTmFQg3cyVk8AXUuwx3DNfVBPGtY0yu4d0NRAn8+6HZexjhN2jvTKaxcw== X-Received: by 10.223.135.115 with SMTP id 48mr6746756wrz.212.1518022078257; Wed, 07 Feb 2018 08:47:58 -0800 (PST) Received: from localhost ([2a00:23c5:bef3:400:9531:588b:44ae:bec4]) by smtp.gmail.com with ESMTPSA id 19sm3974019wrv.0.2018.02.07.08.47.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 08:47:57 -0800 (PST) From: luca.boccassi@gmail.com To: Matan Azrad Cc: dpdk stable Date: Wed, 7 Feb 2018 16:46:59 +0000 Message-Id: <20180207164705.29052-28-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180207164705.29052-1-luca.boccassi@gmail.com> References: <20180126131332.15346-62-luca.boccassi@gmail.com> <20180207164705.29052-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'app/testpmd: fix port topology in RSS forward config' has been queued to LTS release 16.11.5 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 16:47:58 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.5 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. Luca Boccassi --- >>From 00f5e2b202092bfec2dad0bf6a7a98a331d40fc8 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 351df5715..69fa04be4 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1155,6 +1155,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) { @@ -1217,11 +1247,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) @@ -1253,19 +1278,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.14.2