From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D9A6A00C3; Mon, 19 Sep 2022 18:39:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0F09440E0F; Mon, 19 Sep 2022 18:39:46 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2089.outbound.protection.outlook.com [40.107.237.89]) by mails.dpdk.org (Postfix) with ESMTP id E452342B6E for ; Mon, 19 Sep 2022 18:39:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LgA641+DbGgmwKlAP9KqUAH9gWpoyHqaa7SZayu2gnSr73ewcrHWhkNnD/NZfroeJURfBZIJWdLMErMQUzbSIv78nZrdejc2h30LYBJ4S/UtCdZSb8xVgCc/4m0C9+4KwgfW7t632EIfEfpdB6sHCcaYA+9233yiPOzvds6WGB2c+OaU4gxt8jELzxsL+QtiQHa+xm4tIwu1hvy5jeq5NzEdjkvEolSxEbY6JKnagqGxbreCEbmzjGiWXWMxVcOeGurZuBKqpRzqMAxapDFx6ZmBnjnNeOpun31Hekw0n8KdOOAEXGWOQA7sCZ4sO653gAYtkaaw0agMtnTbMpIF0A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cs+71IgRq+KCaj0cU+c08916hQk0hszfWRWdfq0v4p8=; b=Zv+N+gzzzaeJ3Fil9ylcZ062ZsL91/KLPa1KPWSyoDLfvlxYyr5M3lpW/X4KENQ6I6KyS7ec1Ln/pplqrffitw6bdaTZJM56KfxXRFFtYmOgIdJch9ljqilxxgvdEZ+Mp4WombkRnVt1Tl1IPK95smbWQzdur7LtXcSUQ2hUs3F8DH7UhyknZwxmvK83D1q98dChRC6LymWyaMiXSGvnEww7FAmuvUxZX5YtVovdBdDN5d0ssoRSj+1rbDoiPnRY02CKsoA9JH4yiwH6HBvP8+8hy3jo+hSJvt1QR8pcIi5rx+UOn/naJsyBlCHT3EJ7lqWDFwwqti6DLq2iieGBpw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cs+71IgRq+KCaj0cU+c08916hQk0hszfWRWdfq0v4p8=; b=kVO4ww9AFZaSFj2qJe1WNGY7Uj28qHEMhUHW4lo4fIT5QLlgmbSGlh+SQXBjZnlSO6N26eDVP+TR9N2jEW30lMko31zubOJjJlTqazrHncswyOf6/cdu4nkHQyR+BFroorE+HFO83AiIagY9n3CzofsFammvDp8uDYCUM4HYyclx/t2oSOCZ60jrPdPztLq/pmnbWJJr3eyQbLpKYp5XmxF3LYgia0vwkDQY0z1Yb65dk3wpX/aoTbw3XqJIrxUwmfivQjnu5cfjRd8uROOsmBTBSHd0gco5mdP9w5TSNoveAS4w8vL3sqPI6t/2xVQyORUI1gXWJBLFkbROOcawrQ== Received: from DS7PR03CA0021.namprd03.prod.outlook.com (2603:10b6:5:3b8::26) by BY5PR12MB5000.namprd12.prod.outlook.com (2603:10b6:a03:1d7::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.18; Mon, 19 Sep 2022 16:39:41 +0000 Received: from DM6NAM11FT020.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::cc) by DS7PR03CA0021.outlook.office365.com (2603:10b6:5:3b8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 16:39:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT020.mail.protection.outlook.com (10.13.172.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 16:39:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 19 Sep 2022 09:39:31 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 09:39:30 -0700 From: Dariusz Sosnowski To: Wisam Jaddo CC: Subject: [PATCH 7/7] app/flow-perf: add hairpin queue memory config Date: Mon, 19 Sep 2022 16:37:30 +0000 Message-ID: <20220919163731.1540454-8-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220919163731.1540454-1-dsosnowski@nvidia.com> References: <20220919163731.1540454-1-dsosnowski@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT020:EE_|BY5PR12MB5000:EE_ X-MS-Office365-Filtering-Correlation-Id: ed32985f-6ef1-4cfa-feba-08da9a5d8cd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NSMSk51YpxOFHyxhBsyJA8FbWvhHhC0AzQDy4Tx2bGOzvTAqYhTrzLF9PcVRZATId0vnIF5pg6NbGBZ2xxE2GvGBthCN9EKvvIcs1eTLal60tyMD6hnvopNHCtZxlB6L8SIoHlhjKDsHCuyWhy2CVldp7ZwCo+BKnAv4vm4yeO+aY3acmTyRy6wkbr1bEGFlVloUIYrTcq+Ulq7mr35QCh4t08amRzFvp3WMSZSLTO5igoAoXgmCpr4dIvHeqmnQbdMj49/nPglhztUqjGq0dlyjjHvFrDIKW494WYd0EhIKkdzODWr+dSVr60uDACqx8ep6S7/gL5MK9Q3EgLWeMEqiOCseFBovwaZkokGpsFhuMvX/NJWsz3nctsD4odLk8lCzGmIGNccaSSfY6e8YQfIZj9nanUCjpeXbDLDWWUxOuk0AeEfyslmiAGNe7Z4SlrLrOzX/xjNjHhAwpTP55Z1uduaTDh6jhohRtmQTD/vQgp0OBljqgqJuu2qOkjtoCF6nmtYn8A8z7FKLak3DolBDzCO7ZYoF9q9srIBrXfth9iMHjre9hf6/6AG81nr8suJFZW62ijirIjctpWIi6EAcyqu3tEIroeV/lotI/HHkyhdPCKCismQjVzGyXmfQisUmC5S99IOabs3dtMcVszguXegeQbeZ11yBq2gFNDhUGf2kD8lZzaZleumpyUrTrWobMR5aNmIX0uiqjZR36+0W4HzdGgW3c6OP1/aLa6GoO0pGFreCj+Y1pjYnjLKfb0XxAGCK65KOaL3SRPQW/Q== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(346002)(39860400002)(376002)(136003)(396003)(451199015)(40470700004)(36840700001)(46966006)(36860700001)(8676002)(478600001)(36756003)(186003)(6636002)(70206006)(70586007)(37006003)(41300700001)(7696005)(6862004)(86362001)(7636003)(4326008)(8936002)(356005)(82310400005)(26005)(40460700003)(40480700001)(83380400001)(336012)(82740400003)(16526019)(55016003)(5660300002)(2616005)(6286002)(316002)(1076003)(47076005)(426003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 16:39:41.0058 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed32985f-6ef1-4cfa-feba-08da9a5d8cd2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT020.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB5000 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch adds the hairpin-conf command line parameter to flow-perf application. hairpin-conf parameter takes a hexadecimal bitmask with bits having the following meaning: - Bit 0 - Force memory settings of hairpin RX queue. - Bit 1 - Force memory settings of hairpin TX queue. - Bit 4 - Use locked device memory for hairpin RX queue. - Bit 5 - Use RTE memory for hairpin RX queue. - Bit 8 - Use locked device memory for hairpin TX queue. - Bit 9 - Use RTE memory for hairpin TX queue. Signed-off-by: Dariusz Sosnowski --- app/test-flow-perf/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index f375097028..4a9206803a 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -46,6 +46,15 @@ #define DEFAULT_RULES_BATCH 100000 #define DEFAULT_GROUP 0 +#define HAIRPIN_RX_CONF_FORCE_MEMORY (0x0001) +#define HAIRPIN_TX_CONF_FORCE_MEMORY (0x0002) + +#define HAIRPIN_RX_CONF_LOCKED_MEMORY (0x0010) +#define HAIRPIN_RX_CONF_RTE_MEMORY (0x0020) + +#define HAIRPIN_TX_CONF_LOCKED_MEMORY (0x0100) +#define HAIRPIN_TX_CONF_RTE_MEMORY (0x0200) + struct rte_flow *flow; static uint8_t flow_group; @@ -61,6 +70,7 @@ static uint32_t policy_id[MAX_PORTS]; static uint8_t items_idx, actions_idx, attrs_idx; static uint64_t ports_mask; +static uint64_t hairpin_conf_mask; static uint16_t dst_ports[RTE_MAX_ETHPORTS]; static volatile bool force_quit; static bool dump_iterations; @@ -482,6 +492,7 @@ usage(char *progname) printf(" --enable-fwd: To enable packets forwarding" " after insertion\n"); printf(" --portmask=N: hexadecimal bitmask of ports used\n"); + printf(" --hairpin-conf=0xXXXX: hexadecimal bitmask of hairpin queue configuration\n"); printf(" --random-priority=N,S: use random priority levels " "from 0 to (N - 1) for flows " "and S as seed for pseudo-random number generator\n"); @@ -629,6 +640,7 @@ static void args_parse(int argc, char **argv) { uint64_t pm, seed; + uint64_t hp_conf; char **argvopt; uint32_t prio; char *token; @@ -648,6 +660,7 @@ args_parse(int argc, char **argv) { "enable-fwd", 0, 0, 0 }, { "unique-data", 0, 0, 0 }, { "portmask", 1, 0, 0 }, + { "hairpin-conf", 1, 0, 0 }, { "cores", 1, 0, 0 }, { "random-priority", 1, 0, 0 }, { "meter-profile-alg", 1, 0, 0 }, @@ -880,6 +893,13 @@ args_parse(int argc, char **argv) rte_exit(EXIT_FAILURE, "Invalid fwd port mask\n"); ports_mask = pm; } + if (strcmp(lgopts[opt_idx].name, "hairpin-conf") == 0) { + end = NULL; + hp_conf = strtoull(optarg, &end, 16); + if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0')) + rte_exit(EXIT_FAILURE, "Invalid hairpin config mask\n"); + hairpin_conf_mask = hp_conf; + } if (strcmp(lgopts[opt_idx].name, "port-id") == 0) { uint16_t port_idx = 0; @@ -2035,6 +2055,12 @@ init_port(void) hairpin_conf.peers[0].port = port_id; hairpin_conf.peers[0].queue = std_queue + tx_queues_count; + hairpin_conf.use_locked_device_memory = + !!(hairpin_conf_mask & HAIRPIN_RX_CONF_LOCKED_MEMORY); + hairpin_conf.use_rte_memory = + !!(hairpin_conf_mask & HAIRPIN_RX_CONF_RTE_MEMORY); + hairpin_conf.force_memory = + !!(hairpin_conf_mask & HAIRPIN_RX_CONF_FORCE_MEMORY); ret = rte_eth_rx_hairpin_queue_setup( port_id, hairpin_queue, rxd_count, &hairpin_conf); @@ -2050,6 +2076,12 @@ init_port(void) hairpin_conf.peers[0].port = port_id; hairpin_conf.peers[0].queue = std_queue + rx_queues_count; + hairpin_conf.use_locked_device_memory = + !!(hairpin_conf_mask & HAIRPIN_TX_CONF_LOCKED_MEMORY); + hairpin_conf.use_rte_memory = + !!(hairpin_conf_mask & HAIRPIN_TX_CONF_RTE_MEMORY); + hairpin_conf.force_memory = + !!(hairpin_conf_mask & HAIRPIN_TX_CONF_FORCE_MEMORY); ret = rte_eth_tx_hairpin_queue_setup( port_id, hairpin_queue, txd_count, &hairpin_conf); -- 2.25.1