From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10065.outbound.protection.outlook.com [40.107.1.65]) by dpdk.org (Postfix) with ESMTP id 7C2951B3D3 for ; Mon, 5 Feb 2018 15:10:20 +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=La/4HcpliITTiqP17TSB3FFbDOx4IjpwtAImWPte3r8=; b=ZB86A16cUh3FFkvbvrYMn3S3MQY49QmCL4sKt3JslxK7Whr9JXHSiqyQcjAEzLj/3iCBCCybRoy5vn8JeV1bQkQGkyW3wjOrAnx3t4jPExyLjqKJvPaf5umToNfkd5cIbnFuvDY8ew2rIfl3V9xWvPZxR169n5JZDMq4p3UENgg= 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:18 +0000 From: Matan Azrad To: Wenzhuo Lu Cc: dev@dpdk.org Date: Mon, 5 Feb 2018 14:09:23 +0000 Message-Id: <1517839763-24122-4-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: ea083b9c-d91b-4c7e-3ff8-08d56ca23060 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:6QLfekldxyfdzN4Oxq4t2xy58fbXacXvaQ/g42aCGSCYfWtbAUhbNOp+tcWUkYeeRlrq9J9aHzVJs3MQKS85imh0sF0fl5/zR6bobmhwzZr6hIK0o4N3CSd6ixJVZWioriS11vSfmnqwJFq1qps9A25Hune4I+12G1MHTv6ecrNKSGijbzklZ9sjq0GFVmAfXw9yjyw3jcWGoEYcYIax9NFGvAkSBz8pTh83J4dSnD2CB2oTfbJUECVOcv4uMTwC; 25:QF5sKdMYZbCqu9C+fcKGoajeG658QvlUbaBvdh0SPqSwiD3Ks5bfW4n8wglvtGef9Jfb8lYvJfhjxt6/rX8mnhcJzwVfVXK65Ddgq3IdiDxA4n+AaMVGfxFwjD6UGF6/Qce2sCyX3icvGWC2X5dIQ+RaL6OjtzW4nvLPaFvF+gbuMOc1AUkyiQ3oAIqUc8lu/+41dTNA/FfXtTgZ8nJqVKbrQO7/KSaZ0fGv6W90ETV5s/ByxpGRh5Z3RwCw1Uef1x/O96n5H/Y/qcykdtFghCMKL/yx3Y/7a5uohMi+AB/d/WEmNqwOR2QsT0HYs/1xoLQQcdz3bOtGptXIdj3c0w==; 31:+xi7f4aJLWLuAO5aKwCK5RGS7sEP2hwRbNWPOjWlELp2bPlMwmjJMSHfSiXNHgHK5fLoeHSXPyNClgzBMDVkNjasHPBg8/nGYrGZnOZ2hXh6iq5ECalWEUr1gr9VJNHOBW2Sy/LcM6/XohlhgA9uL9dVjdJYm9dW3UGG0YBAdCKtpKjC43/QWEu8ZCtJQAQoIzIhZAxAeNwsCy8ATVOpQdpER5OXM2UJ5XbD2AtCxU0= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2666: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2666; 20:CWjH3N4qA47QHfrdX/QJ8A11FhCvsn7CzxrOXluTEU9VJdgi/Ub38/ulc6+lZ4kLXE+HvCo3kXK+URTh3ODWGTdgDNXejpCf3A88XBnO2S5jw0TflgYteN5U6Uyc/7DCgNg+F/ErVVCyksMbm6PljY3+ia85HLN9k1IAvokFoIDMsqgb+3yA5/RRA0OH0viYWP4giDJzUzl6cTnzip7kG7iyv69Yxg+mcgan0EztUAGt8eCzt9b03051R3GVyfvLhxkjVVm3whFQZebJIM1AANIXQVzUjNlBL0g0ET6R/XYVbImrGYN/qUbrkVN8X/A4ONqOJDlQWo0IwNTToy0atRG5Now4Y7/Tw8yAz62N7CnCl5/ARyLi6mB3kisopguexfSvcAa6DS+uqqVmjFtMu2zboCtaCrmlnl5uln9AQFGwNhZM+OfW6b/ZbaR+JGktCFj5KUCv57wNgX2YnJG1JVz1CXjlaZnxajA++UUJTvzNagJZE7gwUTAafh4ffgfn; 4:0hhtcBzCOyItjrVAG71KMX174y5LSKmjJBAiE2qVLZoc1P5zJldIWSooUX1kyB9Fz4cG6jVGAtMSiTEunwNKwH2cwq7uzeT+qoo1/usRCLn3XO5j0nYi6PhlXGqaj5BJ45814hDEm40oEbSkSxBg+aPL/cYmW0Mm6loyrRUxvT/+h83UMQfgwjaUY61Q22LfI4gEYmvhLquxQAWGZQ+kcR9f421j4s3YjhgPh/BGNr5F8INETNqb1s+LMQDhZLZ1TZQVTw/9gBDKtNa8dNBR/w== 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)(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:gpEJLENZbIsBPcuBVCT/2a1KFA/yjH8s92NEqQ4?= =?us-ascii?Q?Yo9s4ZK0CNu+e3S/xjVTAj/ypf24WD0VLItL6lwaUOoq4oFbPhrQHWVpeb0X?= =?us-ascii?Q?6PXlLuIA+WfCnffOD588cn/OBy87z1RXDE4qYUz69jowk2fgXxrNPydXXor7?= =?us-ascii?Q?hI1ysAs9tNT48tWDTkfzHm9cI/G8mB68HTa6wIzMOvjVz0Ih1azrXzN0X4cB?= =?us-ascii?Q?G1VdqgNmrlmIKBi+P9fJ1YX1a3Q/hWEM+NjViXN7kmhX2FemAw6qq+zIYI4S?= =?us-ascii?Q?9b/op5EF3L1vx/vhs0ZJKD3RYR+Wa+GZdRpWDAAOL1BZ303TxdTErmVgLD3N?= =?us-ascii?Q?rfrogYyYyAzmhvQXNDsk2x3kHV9fuJEHi9Rtq5a0bF3qp0lTo2PJIvR6IwBa?= =?us-ascii?Q?UdwYIEusb3vYidzt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DXEfz68jv1G4lRnN7WrhNwIEGkIYPtR2jIkDk5Tb/4yAnBm0QVdrXBne6Dd9VQ7S+/D7iuwTsAL6Wkb35QwNdVC1UfEBwdOFh/Zc7zsFQJhanvSP/hesS8C/GGeDvUPOq3fbQq0zlWtxAqq1t+aVcmsvOfzD8GoWotgxUnZubre30NIc6PQgerTDpaaXKyurrPvLLjDH1SgXeh2Vu6cs/xotEIhFVkLHyREqu26apnX4B7IQhSRxs6Osl1+0q722JKE5hVgOtAdWcuug/6Jr2M08Abmtt3O4QPg=; 5:QG8JpwGLNZOonvf0CQ4Zp7Cpd2zo1rs5V1+7+NdtCOdAZB4yg2/BJ4EDLIENtMKycY+pgVKVCuv506z+L+f45D/7ykocph9xsFE38W4VSJZ/tf22rS94TRVB9uru54A0tZiMvTBzW9CzwYDmfx0sOsRGgtjvzePcXcTso06uJeA=; 24:VC19UKebItW1q6x8w7QMPDirVs4GkZfBfAWlZskTWWtpQaQrWGF6Y1vb2ZEn8UJ2v6hb5M4zQcDTpJhlAqE906D0BfREGs2ceL6VVsm7knA=; 7:W84ZCrPoikvjxdoX+Ad0zQhHuOiq8HtnqvlbcNhspVyTDieTwwwLOvTmsNuFAWas5qoxS3shAxSP2dwPmCJ0NdNY2WEbBNUaOOfX1c82uVhuVlL6FrR4a67EkA+smZTWVKtuAH1VXwUk+9RCjRBljquoKcLColSMtWiFgx2Vk2dTnc9Ez+igrx5NUJR2WOQwJiechoMM8WQokoTPNBmJlk9RvcE7bxYJBhiPIeS57Cft2HOjJ1ZD6CiIsVdAyiJ7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2018 14:10:18.8971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea083b9c-d91b-4c7e-3ff8-08d56ca23060 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 3/3] app/testpmd: use dedicated function to get Tx port 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:20 -0000 A new function was added to get a Tx port index as a function of the topology mode and the Rx port index. Use this function to get the Tx port index of simple stream. Signed-off-by: Matan Azrad --- app/test-pmd/config.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 02ab1e3..4bb255c 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1916,19 +1916,6 @@ struct igb_ring_desc_16_bytes { simple_fwd_config_setup(void) { portid_t i; - portid_t j; - portid_t inc = 2; - - if (port_topology == PORT_TOPOLOGY_CHAINED || - port_topology == PORT_TOPOLOGY_LOOP) { - 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; cur_fwd_config.nb_fwd_streams = @@ -1947,26 +1934,14 @@ struct igb_ring_desc_16_bytes { (lcoreid_t) cur_fwd_config.nb_fwd_ports; setup_fwd_config_of_each_lcore(&cur_fwd_config); - for (i = 0; i < cur_fwd_config.nb_fwd_ports; i = (portid_t) (i + inc)) { - if (port_topology != PORT_TOPOLOGY_LOOP) - j = (portid_t) ((i + 1) % cur_fwd_config.nb_fwd_ports); - else - j = i; + for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { fwd_streams[i]->rx_port = fwd_ports_ids[i]; fwd_streams[i]->rx_queue = 0; - fwd_streams[i]->tx_port = fwd_ports_ids[j]; + fwd_streams[i]->tx_port = + fwd_ports_ids[fwd_topology_tx_port_get(i)]; fwd_streams[i]->tx_queue = 0; fwd_streams[i]->peer_addr = fwd_streams[i]->tx_port; fwd_streams[i]->retry_enabled = retry_enabled; - - if (port_topology == PORT_TOPOLOGY_PAIRED) { - fwd_streams[j]->rx_port = fwd_ports_ids[j]; - fwd_streams[j]->rx_queue = 0; - fwd_streams[j]->tx_port = fwd_ports_ids[i]; - fwd_streams[j]->tx_queue = 0; - fwd_streams[j]->peer_addr = fwd_streams[j]->tx_port; - fwd_streams[j]->retry_enabled = retry_enabled; - } } } -- 1.8.3.1