From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3F6AEA04AB; Sun, 30 Aug 2020 13:23:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F121B1C133; Sun, 30 Aug 2020 13:16:40 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00068.outbound.protection.outlook.com [40.107.0.68]) by dpdk.org (Postfix) with ESMTP id 11FBB1C0D7 for ; Sun, 30 Aug 2020 13:16:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YMvx5cOxc9TvpB70b/bulL77cNlhn1QtDNnB39KimqRYtjKpEfG3aTrp6wDupRyXO6nWJ5JqrCn0aprPx4szu3bPlMGqKo1GBNoI4/Ea+QiRjqHGvEZaJghUkyP75ZVbf0/XE74zVG4gCb3+6ofVw35wKzOt3ncJJMB5OByY6FT8xFl2QEV0mg4LUHSUAW988TEgMKt9bKHsu7gEMkKogDGC7xk6WzCO1LF7/gAgO4tE/0sXwPYKgmMpEJFqkpuvl9eUDuO6FtzrOUI1axepOqQ80EkNrryZOiRBoaobuwAGtvdn+ITx+9+tkNU7fzWgOL1Gdh3Y0GCVWvEvuzkJmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9c8iYYG3num3/9IWoj/YIAVnCENKdkQwGt170CBNEjo=; b=VK8d82cjAvbaR6ipkUmi2SWgadUEgyqWHH5ZzxKgvkYZPtvAx52H/DPX/1J/rl7K5mmlv8JoctjrfjVR+ZgS7CVY3F7F/Uo0tgr+/lLHBkMwE5SyxQM0WIVwHRf7xzUWZSbqxuo5rBLhbBxpNteyv/s54h8UAV60uN5VGFXixM+4iIBVJBYSHwP/+TkAgwdCyR/AS5HdfA+cVU1bJWbsEC3Hv38EWuxVvOoC2pT1zkLYLqS1zsfg3385asUA2GP4SIDEjqG8qM7THNztqGOOlIS/37TDNhSrTlHsLv3E3nrFnwNfU0YnS8j8dketjUUosA2gnHKVoNoxVFgrPd0PIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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:X-MS-Exchange-SenderADCheck; bh=9c8iYYG3num3/9IWoj/YIAVnCENKdkQwGt170CBNEjo=; b=cVjdokVmLGuQPnIjKi3wC2w0Z/d6LcJczSoeYLHzF0ouo7R/9UuiPQnDJJXi959a+Lmcj6dMW/CIJ9G6d+tfNjX/0gvfH3lxOvARxrYz787aQzVI+e+FiOcHBiKbhQX3PmIM681enbbHyVFgQVm3YHgIHm7ROcIxErUsJ/UeLhI= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR0502MB3762.eurprd05.prod.outlook.com (2603:10a6:208:1b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Sun, 30 Aug 2020 11:16:34 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598%6]) with mapi id 15.20.3326.025; Sun, 30 Aug 2020 11:16:34 +0000 From: Wisam Jaddo To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com, akozyrev@nvidia.com, akozyrev@mellanox.com, arybchenko@solarflare.com, jackmin@mellanox.com Date: Sun, 30 Aug 2020 11:15:42 +0000 Message-Id: <20200830111544.4190-12-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com> References: <20200830111544.4190-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Sun, 30 Aug 2020 11:16:32 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2151c8df-c857-4a7d-40c6-08d84cd62727 X-MS-TrafficTypeDiagnostic: AM0PR0502MB3762: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KJG7p3+EC436IUtXDJR+KkdY6t85MVknrMGsL3QRG9Nq40xJVzYrQ0Xsoec32drY8lu66YL9zUKjJBYIlIbNVgsQFmSvUAxm0PvSCTDJIRO/HDRe3F+ESpJ9ZZwQIq2n24fBtXxVPbs8kKy2E3S0F9dzk1Bsve6yQer2OWbp5gdv+fKCQF1jtXiqzRPWVtMPrAGBWprnYpLECof/CISresu/1nwhQtN1lcu3GSchNkvieAA9d5ZRvvubzE29OFZgoY0wJ7kb8gzV6Ka2UNyMklMm3ulevqRsBY/O2zggJw8zV5DyBsznJ+C9UY0v1s4y X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(478600001)(316002)(5660300002)(8886007)(2906002)(6636002)(86362001)(36756003)(6666004)(1076003)(55016002)(8936002)(26005)(2616005)(7696005)(66946007)(66556008)(52116002)(83380400001)(16526019)(8676002)(186003)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: MYOwj/x4ImBRnWItDEo+Ig4YJFl8GK3qAFqT8ilrezGn7uYHMUqdJF3PJkcGR0Ry3sOtPJytpF3fE0XTSQh4tOnAOntWN2aKJMbnvcZJPZjcbnadBJBh5ID6bEHopkJuEw4MSDHJxFBYUY4X93j6UNCyclxxaYkOiTeywjS/B+Y2GBg6oZfavKJvDZjhF9HjzK5/8ysa97QJaKoVSlI8RAC4zhwhKTsS+/dqxYKoJbW7ZLpFihUJxXphQonxS2/G7Z9IeEf0iM6lNcqHKeFtKiaAIZYervt/VtnewIk+nnubPm6Tnq54fidWyASAU1HfTDCORmqEEs3E7Mjqi/nlyVYmw+gnUpfkhmPA9y2j7D66sjYMrNW+31XJrVz40atBAjQdSDqBCeHyOfZCKA7dJoc/mKAYNMz5QMoq7dg1yg74+ZfLALuUl89uhP1khUZYb8FVBPbG01AkdoubrkcVevuGmzNzEopR/6Nk7p4s8deXqpdH4or9ItWlzGuVv6eTeIpTR6sjPBhURKONzdSFZVP/NbkA1gGh/3x0vuhCdYN4U4SG5hCPwb7OrTh0Vg6WNSPpnr3UlrxYpyvxMQ9KXMpAp6IC0IvPjmzvCbVEgqHV7/WoYfXkwjYkslqxrEdmwle2R1qC6Vl9zuCMAFqvMw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2151c8df-c857-4a7d-40c6-08d84cd62727 X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2020 11:16:33.8720 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3EeYKzXBwWK1AhncxyBAxgtYKYJ+gqSxUyGcSfajwq/MN6Kb/u7AeNfmz0av+fo5Fcgf9mlxRSmCllq2X+7yZg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3762 Subject: [dpdk-dev] [PATCH 11/13] app/flow-perf: add set port mask to options 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Sometimes you need to check flow performance for certain port and not all ports. Thus a portmask option is needed. Usage: --portmask=N Where N represent the hexadecimal bitmask of ports used. Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- app/test-flow-perf/main.c | 20 ++++++++++++++++++++ doc/guides/rel_notes/release_20_08.rst | 4 +++- doc/guides/tools/flow-perf.rst | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 0a030a462c..18199c6e2e 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -53,6 +53,7 @@ static uint64_t flow_actions[MAX_ACTIONS_NUM]; static uint64_t flow_attrs[MAX_ATTRS_NUM]; static uint8_t items_idx, actions_idx, attrs_idx; +static uint64_t ports_mask; static volatile bool force_quit; static bool dump_iterations; static bool delete_flag; @@ -106,6 +107,7 @@ usage(char *progname) printf(" --dump-socket-mem: To dump all socket memory\n"); printf(" --enable-fwd: To enable packets forwarding" " after insertion\n"); + printf(" --portmask=N: hexadecimal bitmask of ports used\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -189,8 +191,10 @@ usage(char *progname) static void args_parse(int argc, char **argv) { + uint64_t pm; char **argvopt; char *token; + char *end; int n, opt; int opt_idx; size_t i; @@ -514,6 +518,7 @@ args_parse(int argc, char **argv) { "deletion-rate", 0, 0, 0 }, { "dump-socket-mem", 0, 0, 0 }, { "enable-fwd", 0, 0, 0 }, + { "portmask", 1, 0, 0 }, /* Attributes */ { "ingress", 0, 0, 0 }, { "egress", 0, 0, 0 }, @@ -568,6 +573,9 @@ args_parse(int argc, char **argv) { "vxlan-decap", 0, 0, 0 }, }; + RTE_ETH_FOREACH_DEV(i) + ports_mask |= 1 << i; + hairpin_queues_num = 0; argvopt = argv; @@ -703,6 +711,15 @@ args_parse(int argc, char **argv) if (strcmp(lgopts[opt_idx].name, "enable-fwd") == 0) enable_fwd = true; + if (strcmp(lgopts[opt_idx].name, + "portmask") == 0) { + /* parse hexadecimal string */ + end = NULL; + pm = strtoull(optarg, &end, 16); + if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0')) + rte_exit(EXIT_FAILURE, "Invalid fwd port mask\n"); + ports_mask = pm; + } break; default: fprintf(stderr, "Invalid option: %s\n", argv[optind]); @@ -880,6 +897,9 @@ flows_handler(void) rte_exit(EXIT_FAILURE, "No Memory available!"); for (port_id = 0; port_id < nr_ports; port_id++) { + /* If port outside portmask */ + if (!((ports_mask >> port_id) & 0x1)) + continue; cpu_time_used = 0; flow_index = 0; if (flow_group > 0) { diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index c0f7ab6293..b21f0bfb03 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -284,7 +284,9 @@ New Features * Start supporting flag action. * Start supporting raw-encap and raw-decap actions. * Start supporting vxlan-encap and vxlan-decap actions. - + * Add new option to set portmask for insertion/deletion: + ``--portmask=N`` Where N represent the hexadecimal + bitmask of ports used. Removed Items ------------- diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 15b4273cc0..bbefc978c6 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -84,6 +84,9 @@ The command line options are: * ``--enable-fwd`` Enable packets forwarding after insertion/deletion operations. +* ``--portmask=N`` + hexadecimal bitmask of ports to be used. + Attributes: -- 2.17.1