From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10049.outbound.protection.outlook.com [40.107.1.49]) by dpdk.org (Postfix) with ESMTP id 97A2D1B3BE; Mon, 5 Feb 2018 15:10:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6HrrvNfjg1+PHDkfmgIxlQGgoNd07z5Ip5P+jygiA4c=; b=wx+CJTEsnmF2jVs+Loc43GK8duYYfoa5+YNTAbTBBvTkjV6vBv4cMiS5CB/8mlqajymhMO1BgDPSjCO9cEjCs9JsIw+OPJ4BGe0fPFaSFreOIk0oANju+Pl+SmgRYlwB4mtDyp7ry/ICbOYeIiLRq3yh1Dw5//Rd6m+mAZsbkJE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Mon, 5 Feb 2018 14:10:17 +0000 From: Matan Azrad To: Wenzhuo Lu Cc: dev@dpdk.org, stable@dpdk.org Date: Mon, 5 Feb 2018 14:09:22 +0000 Message-Id: <1517839763-24122-3-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1517839763-24122-1-git-send-email-matan@mellanox.com> References: <1517765225-11117-1-git-send-email-matan@mellanox.com> <1517839763-24122-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR02CA0061.eurprd02.prod.outlook.com (2603:10a6:802:14::32) To HE1PR0501MB2666.eurprd05.prod.outlook.com (2603:10a6:3:cb::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 20426a41-8996-4723-21a3-08d56ca22fbe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0501MB2666; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 3:iV9W5R5CgwIQLplRFOcoYCTIOouuOb+6MxUoTYTEpvZx+hxClH53MiVdzM2MUc/ngcfIv4mfcjRL+FzNKVSpdYgYJVtZJ7HK8lEI1AmKEt2Ds3NtsiIfEL9AOLhholxuPOcWOR3Wvo3J2AmrXEmWgmPp51gDU66/Vkx09+FJ/EcMMmUqy4ZI5pPJTIyMoXu23fdzlK316vR5gssM65WysGmuD3bygD+KsBGriE0o9u5nCcTTFFVf7rdSWhILq521; 25:UikdSTd5IDadvvMlK+I6n+mE+9PFre9uLjAfOzm9F17/ZhFDynL9l/j0Hki/VHvrlDyC35GyxbrlDUU/r+VYazejfIAVsIHixMB2+E8NKg9dw4neqHjTDzgxXjItEjwpVm7UlaOpIToHIH5fq9UMnA9ys/hbfKT2gkAnzmQnyo4+DCqIXYwDit+CSBDXEd/kjUeOlQE3vKrDUbI1PW9/UVsIaAPwu/xPeeA+5ueq3/DsFVUcTmoyb2nv/t+AwOgsgBN9uO/wwqhGREOYNjxdwh4qUUd7TA2AOylFrL8FMPK+jGu23dKtQQC67DkaYBYc1BLvqCZ5WQk+tprYezzSuQ==; 31:bZCppwZL05oKQq+2qIia+s/lnaQUYk4wM1s5lnRINgwKDjh+jpnSpGNLPSAfm4JLYP0fNYUIkmCxeFteDueZBx+4APA3hWk99SNp3hwe10zX9SyBNDTSmpGYe1IT7YRc7R2BjdfaH2h99UEYC3oWAa2vM01IG//XZxdkI7Uo3LxsCptFESbbOEroUQ2p3OysL1adocIEj94mHhp8IkdgWUzm+cn2r+5U8rl6cUxmIVo= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2666: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 20:p4elmWwioIQW1c7y/Chf/qB+dlwNJsuiupPMltVYgC10Sig5BmX/x36d9rv6oMM0zBmhIOjNiu3FBcQSudW7kQ6SP59oi2lVqxxP9WAEM5qlS14/wfcSOomLD6ZnCxQfmUZR5dMxAYf0cJoHYHIa9v0qM5FzXty/TWN4gFeRawVB8EdCWhKliCY09LSknEvi7okytoGhP97g6KQMzuYo4I1urP24rBOxS2r84uDawQrS95Ixo/y5vqawYHnvKyz1Gx1lv2mxtOljMm4ILxm6oJCUEDccb/T0Z5+mkBHr+l/BIUZxMGDBSzkrvwDmij0dGsz8adX1KmeYXJtuyQrJNbAQKxKbcGNKtEUIeWWGjqgzV1xeeD/Wdmm3+S+7wgQWkXkDeojcxHH2qnuCdM2SDZCfDaSbtH0OUmheZpgknCySiP0aCM2j5ZyZa/hTFuvTBlyc5gAHjw7HJ7E7UavT5W71srdhz/eYRLOwg+WrdFHNPiTgPsODTXE/h5X4WA0j; 4:B0mnoHNm45WGfgUKruhrxOTtmNv0nXwl1QTdOCtfH35JvksVWAlW+crUFn3iMpiKA3xz5P3rPodIJ0EfmWcHtma02wUkBsAWNJE4T80phQ4YR0t1sFe3nMg975OxGpFBhnn75lcgCdeSZXErcXT8x1oUsYXh7h4Fv2PFoPSZAHSBmQ9ResYDG6AuhdhDZY70pvuS18PBoqx9SGUDSGD+oMhxIwms3Vm6kmJIz3h/G7OjPE1kPdeA2gKK2+Z3Ve1Pz3n84N1lwvUndp+FyKxASQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231101)(2400082)(944501161)(6055026)(6041288)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011); SRVR:HE1PR0501MB2666; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2666; X-Forefront-PRVS: 0574D4712B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(39380400002)(376002)(366004)(189003)(199004)(3846002)(6116002)(316002)(59450400001)(26005)(305945005)(7736002)(8676002)(81166006)(6916009)(2950100002)(50466002)(5660300001)(6666003)(4720700003)(53936002)(8936002)(36756003)(33026002)(48376002)(68736007)(50226002)(106356001)(55016002)(51416003)(478600001)(25786009)(105586002)(47776003)(81156014)(21086003)(4326008)(66066001)(86362001)(76176011)(16526019)(2906002)(7696005)(52116002)(69596002)(386003)(97736004)(16586007)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2666; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2666; 23:ZUFDiy8Ff8uIj4NJOkwBQJFSW6t0xaN6Z2jJuk9?= =?us-ascii?Q?aXBaxgy0z4rEzjqNJEb7BL5FC84SfBwasDBMkmJEIFtUBtXECpR1gRL3bpjJ?= =?us-ascii?Q?J86bt6i8kBZ+z7KfLDpsMF6dHOi4BbYNbHMcyxoVdkWmuZ445wwmvW/Vr6cL?= =?us-ascii?Q?RY3VTxTxzAjsnLsuBGaEDTkTwEWvLykUqYUJZWa+DHVaCicFcsHDYkn1ivGb?= =?us-ascii?Q?mPHivZyDuFlDov+EvNhJqxoRk1OwPoP4hhsRn1roWbW4wis/H4psx9SD6qLk?= =?us-ascii?Q?jwoYuTzUSbyGYkFHhIqahy5ZOeXi0BVosJENBgN4ON7MX3195c2e1VFgVcdA?= =?us-ascii?Q?jH4ClB/fs2iZjZEk5F/3/lPnDczBwspZi1zQp/G65RMXxkXLZhPnjiRcBECH?= =?us-ascii?Q?J1TTakoJX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0rKoFUCaht8uAfvrb/gApbup0532VXtVbxk31dmR2vWzhq1osdA3cAvJfLPsiBL8wjwMESEXXlO/3oLMYTIJ8A+DB4e6jo/EeiCgg26NFfCxm0FU0V0JlzrdfyGUuzQi6gw3Dc6pESkbqo4DrGFctfoF8e5Kcxfz68TpVdNc127wzB75HvFfxxqUNMCQcUpUjEyLcSNW83XVVtaNa496soOmJLRX2QyOVpQ1yEOv8laTcYW2bFpn9JcGCJG+cpz4f1IlXzbkeB1+mc93KaBBZQip19fZL5hhk0CURJPsOvorB4gSor3b1x/WkGqXjvVmteyHkM=; 5:r+KCB2IM/8Jg682FjZZOJxo3LN2xSrQo/TZV8aJBcAagcLxqbWszbPZZulXSiXsYlk0QpsmAX+1Nzq79ATrNVYujCXUqxOFarJaRed3n57c1yRmXEa28jHNIMyho5UaxxvL6N9tirZgrxyE1y3Gdja6aZ6Al/R8swGHO3r+u1Dk=; 24:yyFjaHz2JE8zgrpo2CWWerMmpQ0UrasE1KPnhN/w2B1MlM8eykHstzuvGkojhKhMjwxIM+bgpwR4AbAYNNvm6Rk9uD9GqZtK9ePBl1a6n3Q=; 7:IEuyPHHld9rgBieyFWJ3AXQhqxiWK/LEpBzgJoO7zL2RLfiWErJ03FDltL5UDfHg2mrSO73wOiafY1h0BQgdFO0sTUsn59qztU2EqXGimLLDKPE/TX+wWp7txGEGsGxkXycrOmLarPudnw9BkLZ4jmXADsxk8eRwcx+77MVFeVmd7hSxrOBqDi0f9NTCx0aXYxUX0NmgTGWSd9GlK6sEIhqFGp6U4BBYzuaH72vl0SE3IaQSwM52U4xFExclRDdj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2018 14:10:17.6784 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20426a41-8996-4723-21a3-08d56ca22fbe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2666 Subject: [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix port topology in RSS fwd config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Feb 2018 14:10:19 -0000 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") Cc: stable@dpdk.org 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 3053b56..02ab1e3 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1882,6 +1882,36 @@ struct igb_ring_desc_16_bytes { } } +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) { @@ -1944,11 +1974,6 @@ struct igb_ring_desc_16_bytes { * 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) @@ -1980,19 +2005,7 @@ struct igb_ring_desc_16_bytes { 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]; -- 1.8.3.1