From patchwork Thu Oct 6 11:01:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dariusz Sosnowski X-Patchwork-Id: 117456 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6A65A00C2; Thu, 6 Oct 2022 13:03:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B78542C35; Thu, 6 Oct 2022 13:02:29 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2059.outbound.protection.outlook.com [40.107.92.59]) by mails.dpdk.org (Postfix) with ESMTP id EBA8942C29 for ; Thu, 6 Oct 2022 13:02:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HUrfaE6phxExuG7ouUviL++HImrzc4B4w/dH+Y3s7o/ES01/4QoxssdfbjGeB6ldrnPErsTcQHXugB1FA2fDLFcnIBftT6C+Dot1PMJt+55pFZRG8RvPmc+p4ZsoILVBavx68Fhs3uGSfH2LsBGas91vxp7WRz5g52mKgGj3EWOpcStmCUjKOIqtkIKg+YuJDP21+1juoDBPsPnkOh6vv/IP3kYEMa8DrYg1AE4qBhNPixVK2b5C2D8naqlFUokQjG2K4SMH7f9ueEHgPczF9Z3UmAgA2PYFyaV8PH9O5FTkSNC7zJT7XnoQ467NKwI1j32sszo6kwsxxql4MC7HPw== 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=fHYB31xgq2MvgpDmcBqsp831M3IUNcBYFHGs2nkdDr9+OXvrbvDZjn8HXQyMxClD91DIh12HY2km19q+T8SaVsd67gecANAkNRWXekxpBcpfTfMgQ8euuucVZ0iAM5McWMursyzbaPhv30uFGQx41i/TDPxRVJ5+6UI1BEStzok6B3m6rNV4z+FMJq9rAhG99sxPCvoNbofeN5QZrXByES5lCzYHvdJB2toVMGmr47dPI99S0pb7Ode2CR7rMrRvD+Uuo2KUT50D6hbTZ2lkXAievQL/wnQEGcXUECc/uQRO01qYj2tUc5Pb5u4YOWYqthhiiUoPB1SurcMn4EG0Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=bY9wfAVkRSEhIo1E1rgE8Je/5ERRFUiGzKzEUkn4ZvRZwDiVBg6++xBj2xXGI3O8lCdn9QqWkXZ0QdONGexWeR0wnQ+yicwYRW/nteSma+/A6LRCarw3x1GZl4L1YD1bqoYjOJDdeRRRsJm3HNW8XeG/unXvGZt2xcQbCAdVVvYHf0pSNBiO9VU/Y+yHiUEEtmhXImJeEhKFYrK4emI3ul/CC7HAXql1SdXPn+m3S6yyk+3BC48gpjdox+UFjJOu6dsPVv2NfRm22s75sOIRO9jvw/uBOLTmIopatK5ntCj8x2RA92LW7LRyclUO4rB0fQYHnYeH6AThZztVB2kdkg== Received: from BN1PR12CA0002.namprd12.prod.outlook.com (2603:10b6:408:e1::7) by SA1PR12MB6679.namprd12.prod.outlook.com (2603:10b6:806:252::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 6 Oct 2022 11:02:25 +0000 Received: from BN8NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e1:cafe::3) by BN1PR12CA0002.outlook.office365.com (2603:10b6:408:e1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.29 via Frontend Transport; Thu, 6 Oct 2022 11:02:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT071.mail.protection.outlook.com (10.13.177.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Thu, 6 Oct 2022 11:02:25 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 6 Oct 2022 04:02:09 -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; Thu, 6 Oct 2022 04:02:08 -0700 From: Dariusz Sosnowski To: Wisam Jaddo CC: Subject: [PATCH v2 8/8] app/flow-perf: add hairpin queue memory config Date: Thu, 6 Oct 2022 11:01:05 +0000 Message-ID: <20221006110105.2986966-9-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006110105.2986966-1-dsosnowski@nvidia.com> References: <20221006110105.2986966-1-dsosnowski@nvidia.com> MIME-Version: 1.0 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: BN8NAM11FT071:EE_|SA1PR12MB6679:EE_ X-MS-Office365-Filtering-Correlation-Id: d0d1633a-4c0a-4027-68f0-08daa78a404c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HhWy8zYlv4Vs27I9pY9gEF8S62YlB7IGO2sMTQPj0q9NjCJ6ArKuC5K2LuRn3P3kNHGQeQFpjMjV2E7Eg+jLQuzUdP68K5PuSyOtR61OO93P+SVDZMHE/RoXVIQ9ME+G0lxmmafly5NGeAhl86cLbtrkehuF8b5jI0Cd+YbJSCxV9EPyyp+OEEyLVohtQcZzhL7eExUeREEhT1Yz+pYZ9/wJFYh5/4J7CL/VnpQMcyQ6SSNkuK91ggx6wexxPFjNVRnZAsqrGEnFzuLZIWOO6aBx15P3RU3fu+j6w2wno+YgZlT1Cw24N0apNSKElF9hZ7E2LjnukdmBsjv5Yiy/svXlQgtV3KmniwG5ZLkSJMfJ+xiguoq6Be/QM1pDDIb5v0m9+gkjE9nFzmcR2lJWs5a1FYxJ7rNdV7xYYbeOh/07S2NSMEZDbZo9gAyMMZWfNjkxdJmifa1lQOqlAZ4IQmx8SOxj2Ada8dZ/o7b6VCbx+XsDZ6/OQ1df6JfcsSgSGqLKbghLm14a5DpMRJbKh5j3bgQ9xfNOqWdIoqIviq8/0TbsQSu1TX3NQGzba0OuGM3PXjfGB20oI/U12Zc9hAlSY1jR+I/rFYlVbLKDjOFtdQpuLuown8shmMBOZfj6sQZ7yhJLjw4m9tDHmAyi+Xz9roai4OB4nYwqubxZB1q1TSf54Sr9698xCnhu2JfRF/kwCbuZR5YeXzqepFpLBGqEkITzl6nHNldH823TIJl822WIZEVfClYWL8JrmNfTjjV5dvwbLWr6lSIO7Z48hA== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(136003)(396003)(376002)(346002)(451199015)(46966006)(40470700004)(36840700001)(186003)(82310400005)(1076003)(82740400003)(16526019)(336012)(2616005)(6862004)(7696005)(8936002)(7636003)(55016003)(36860700001)(40460700003)(70206006)(26005)(426003)(40480700001)(47076005)(478600001)(6666004)(6286002)(70586007)(4326008)(2906002)(41300700001)(316002)(8676002)(37006003)(83380400001)(356005)(36756003)(5660300002)(86362001)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 11:02:25.0234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0d1633a-4c0a-4027-68f0-08daa78a404c 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6679 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 Acked-by: Wisam Jaddo --- 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);