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 4EBF4A0C4B; Thu, 21 Oct 2021 12:42:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D8B1C41209; Thu, 21 Oct 2021 12:42:18 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2077.outbound.protection.outlook.com [40.107.223.77]) by mails.dpdk.org (Postfix) with ESMTP id 44BE941202 for ; Thu, 21 Oct 2021 12:42:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aGeCPllKkbKUKNzw5o1Vx0ypogHrn9+MQtfVOpRdIRTZQbWlKMuIERGS6HEoERWBXYLExUKgjQZOaxP9NjZLwhp61JbAyisXRwy3HwYEL6rbqnxA3Li0wNjTMvIB4ZSZYFOUlVFBr9vsyDDPox28376U0SYEpZpjvH+sOVZjB09lwvZWNY2Sak1zFjrGVg0b6/bPhVqKAUP+0E0++naSzp9zM2xNcfy/q2rFDSnOcG/v682/Vhgw2dUOLkb0uMFcXS3MvusltlrIptlpHj6WXSaxGPGKye1MdrzmxMZzi6TU8T6HfKe1ZoYC2wcYDuC9RTYVF2B+3iGI8MgbnQhNkA== 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=IamTpJJWxtKBCiQc1K9ygy0DotiMPyitrTfs4DU69bA=; b=bb+IRlf7sX4cYTTPT3iScHHzpvh35ba+FbQtf+r2KT1oYbl/b6GadzQtB2s3qdI55JpN36clGw39c7lgc6ZsQl0xmxkeccmWL6HHkvEuZeqhfA0HjIR95zLThnxJ0ztJ2NE0ZUXHxZle0jDdPSlqF+GxLXYpa9HqpBehfCuzc13TLeOJWj3cvZrD/bjYu57crSn7Npp34Xuczz/lET8j6uGRkhP1AY6tQfX61V5NYUwLf0uM4TvwtYfNkEggxXvmRzgA848zShuOhSP4Q2ECUxjWwJx0H8HYaZ/V64bnLFl63L29+hVGX0EVRMjFJqkR2A/l7bdQcUVTqZy9TeiC9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=IamTpJJWxtKBCiQc1K9ygy0DotiMPyitrTfs4DU69bA=; b=tEjkRxqz0pP+1UtmznkIeFf+F6T3HMb8wbyI0fbBmLg8uqr54g/c1Dmz7rE0BdLe+/ovLrnLhBUeDpKuFbC//DGJxqJkjcJhpuLD2iWivQnM+4xsZlRCdxPhHir0KLjr1Hs/vXafxrBL/9jdKDwVsAqYdDPqfpd5wrAOnOSAnxavbimdUwI3Y/cTnFSM56USERAXvWAKUiE/7KkRqYJS7mjKIyASKo+BD6ZaJqCSZ7esxT6cj4qGxwLeKCK/GkEuvQrBLTis1sY4nIfRgfPaOHmx8gLh2sTIzAsT35SLevTd49spuyDbcfKsbCgO07b/4feoOhNYeQC7Y6PMbNdIPA== Received: from BN9PR03CA0407.namprd03.prod.outlook.com (2603:10b6:408:111::22) by BL0PR12MB5523.namprd12.prod.outlook.com (2603:10b6:208:1ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Thu, 21 Oct 2021 10:42:13 +0000 Received: from BN8NAM11FT011.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::f9) by BN9PR03CA0407.outlook.office365.com (2603:10b6:408:111::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18 via Frontend Transport; Thu, 21 Oct 2021 10:42:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; monjalon.net; dkim=none (message not signed) header.d=none;monjalon.net; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT011.mail.protection.outlook.com (10.13.176.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Thu, 21 Oct 2021 10:42:12 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 21 Oct 2021 10:42:08 +0000 From: Xueming Li To: , Zhang Yuying , Li Xiaoyun CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Ajit Khaparde Date: Thu, 21 Oct 2021 18:41:39 +0800 Message-ID: <20211021104142.2649060-5-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211021104142.2649060-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20211021104142.2649060-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52cd5ee2-59e1-4acf-342c-08d9947f711c X-MS-TrafficTypeDiagnostic: BL0PR12MB5523: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lOrE+lnpa6TXQjX34sgrZm8uDSm3gvgMLi0uHtcJKHpedRAK3ggm/DrsGAa7mHWJWsHvBJpjg3qz54fRNWpXkNuKtVWistqRk1NJb5WkPfxGRKSB0bGPvVzLkoSGPFQ6+0IltaDGij17B4mPlQOfLWQRi9hE70aMQuSQbPYRQXVf94WnS+Y7/mspzuDcEft6OBHPvlSs655lNembqNdbVR7hzfYPSW+az9gWGLqswyUC7CVU7dw+oyXuOf0ViCpPlnB+muJhMJTWCWEnnb+ndAvKR5z98E4O/RKlfogi4UdhZagADCKbILliUvFJyBIsl2pXvTU4UyiM/XgkNY1ZM68tQxcrLTWNHToGbtNl4VxD88OHUbCu2tFN6aJCujwDhTYHh5iB6j1r2cGVwTST6sTYSn4ROaxNIprgtE0jv1BZsc/rL0y//DKGQPy2eSEKoZFvpnR2fPcWVUs7dCkEtdHCnSAcTUx2Hjk7K/rzITRR8rSeVZQVzIhm2ALC35UPLcyIZAhabb3wL5/sVWXMZpgg9txjh6OCIkDV2rOWFXjxBfk3QGHOPsSpqw0uc8BI3I1IfS41MuEZiJPzBNn7kvrrz30NmoTc6MkhN/AuC6FuCWY0G/3eWnJcQeF4PmeWDmz9Ymzkufhxpp5O9kruKy4d7tQVg6RsW9laTxrDOk3If34jp1LlT1OByW9q0fvNYjl4SwGkLOHNBB5mNSCibQ== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(7696005)(2616005)(36860700001)(2906002)(83380400001)(26005)(336012)(426003)(70586007)(70206006)(36756003)(55016002)(6286002)(82310400003)(110136005)(7636003)(186003)(47076005)(16526019)(4326008)(356005)(8676002)(86362001)(6666004)(316002)(54906003)(1076003)(508600001)(8936002)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 10:42:12.5688 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52cd5ee2-59e1-4acf-342c-08d9947f711c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT011.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5523 Subject: [dpdk-dev] [PATCH v13 4/7] app/testpmd: new parameter to enable shared Rx queue 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 Sender: "dev" Adds "--rxq-share=X" parameter to enable shared RxQ. Rx queue is shared if device supports, otherwise fallback to standard RxQ. Shared Rx queues are grouped per X ports. X defaults to UINT32_MAX, implies all ports join share group 1. Queue ID is mapped equally with shared Rx queue ID. Signed-off-by: Xueming Li Acked-by: Thomas Monjalon --- app/test-pmd/config.c | 7 ++++++- app/test-pmd/parameters.c | 13 +++++++++++++ app/test-pmd/testpmd.c | 20 +++++++++++++++++--- app/test-pmd/testpmd.h | 2 ++ doc/guides/testpmd_app_ug/run_app.rst | 6 ++++++ 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index db36ca41b94..e4bbf457916 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2890,7 +2890,12 @@ rxtx_config_display(void) printf(" RX threshold registers: pthresh=%d hthresh=%d " " wthresh=%d\n", pthresh_tmp, hthresh_tmp, wthresh_tmp); - printf(" RX Offloads=0x%"PRIx64"\n", offloads_tmp); + printf(" RX Offloads=0x%"PRIx64, offloads_tmp); + if (rx_conf->share_group > 0) + printf(" share_group=%u share_qid=%u", + rx_conf->share_group, + rx_conf->share_qid); + printf("\n"); } /* per tx queue config only for first queue to be less verbose */ diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 779a721fa05..afc75f6bd21 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -171,6 +171,7 @@ usage(char* progname) printf(" --tx-ip=src,dst: IP addresses in Tx-only mode\n"); printf(" --tx-udp=src[,dst]: UDP ports in Tx-only mode\n"); printf(" --eth-link-speed: force link speed.\n"); + printf(" --rxq-share=X: number of ports per shared Rx queue groups, defaults to UINT32_MAX (1 group)\n"); printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); printf(" --disable-device-start: do not automatically start port\n"); @@ -678,6 +679,7 @@ launch_args_parse(int argc, char** argv) { "rxpkts", 1, 0, 0 }, { "txpkts", 1, 0, 0 }, { "txonly-multi-flow", 0, 0, 0 }, + { "rxq-share", 2, 0, 0 }, { "eth-link-speed", 1, 0, 0 }, { "disable-link-check", 0, 0, 0 }, { "disable-device-start", 0, 0, 0 }, @@ -1352,6 +1354,17 @@ launch_args_parse(int argc, char** argv) } if (!strcmp(lgopts[opt_idx].name, "txonly-multi-flow")) txonly_multi_flow = 1; + if (!strcmp(lgopts[opt_idx].name, "rxq-share")) { + if (optarg == NULL) { + rxq_share = UINT32_MAX; + } else { + n = atoi(optarg); + if (n >= 0) + rxq_share = (uint32_t)n; + else + rte_exit(EXIT_FAILURE, "rxq-share must be >= 0\n"); + } + } if (!strcmp(lgopts[opt_idx].name, "no-flush-rx")) no_flush_rx = 1; if (!strcmp(lgopts[opt_idx].name, "eth-link-speed")) { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index af0e79fe6d5..80337bad382 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -502,6 +502,11 @@ uint8_t record_core_cycles; */ uint8_t record_burst_stats; +/* + * Number of ports per shared Rx queue group, 0 disable. + */ +uint32_t rxq_share; + unsigned int num_sockets = 0; unsigned int socket_ids[RTE_MAX_NUMA_NODES]; @@ -3629,14 +3634,23 @@ dev_event_callback(const char *device_name, enum rte_dev_event_type type, } static void -rxtx_port_config(struct rte_port *port) +rxtx_port_config(portid_t pid) { uint16_t qid; uint64_t offloads; + struct rte_port *port = &ports[pid]; for (qid = 0; qid < nb_rxq; qid++) { offloads = port->rx_conf[qid].offloads; port->rx_conf[qid] = port->dev_info.default_rxconf; + + if (rxq_share > 0 && + (port->dev_info.dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE)) { + /* Non-zero share group to enable RxQ share. */ + port->rx_conf[qid].share_group = pid / rxq_share + 1; + port->rx_conf[qid].share_qid = qid; /* Equal mapping. */ + } + if (offloads != 0) port->rx_conf[qid].offloads = offloads; @@ -3765,7 +3779,7 @@ init_port_config(void) } } - rxtx_port_config(port); + rxtx_port_config(pid); ret = eth_macaddr_get_print_err(pid, &port->eth_addr); if (ret != 0) @@ -3977,7 +3991,7 @@ init_port_dcb_config(portid_t pid, memcpy(&rte_port->dev_conf, &port_conf, sizeof(struct rte_eth_conf)); - rxtx_port_config(rte_port); + rxtx_port_config(pid); /* VLAN filter */ rte_port->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER; for (i = 0; i < RTE_DIM(vlan_tags); i++) diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e3995d24ab5..63f9913deb6 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -524,6 +524,8 @@ extern enum tx_pkt_split tx_pkt_split; extern uint8_t txonly_multi_flow; +extern uint32_t rxq_share; + extern uint16_t nb_pkt_per_burst; extern uint16_t nb_pkt_flowgen_clones; extern int nb_flows_flowgen; diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst index 8ff7ab85369..faa3efb902c 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -395,6 +395,12 @@ The command line options are: Generate multiple flows in txonly mode. +* ``--rxq-share=[X]`` + + Create queues in shared Rx queue mode if device supports. + Shared Rx queues are grouped per X ports. X defaults to UINT32_MAX, + implies all ports join share group 1. + * ``--eth-link-speed`` Set a forced link speed to the ethernet port:: -- 2.33.0