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 81E4FA0C41; Thu, 30 Sep 2021 16:57:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 994F44114B; Thu, 30 Sep 2021 16:56:56 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by mails.dpdk.org (Postfix) with ESMTP id CAC7D4114A for ; Thu, 30 Sep 2021 16:56:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e7wYThv2ZOfqjOT1AA6TOAvat0Qk2s2WZVbn59HhesilxsKyn++yMkl5Y74F2U71cDeLsHSU4NgSq7RtLKSnphGE9C3VkHq6sarUXlxj+7ncT9q7PL7Xk80wb9CJKRY6HUe+fHDHr5CX7yfPdxWeL5VmfUf63wrUh/kQq324qTJScDmDzSL/DYs2WYD7HmYNPa7i4nTXMG9J2lC2u8bUmr3US+NzI7yCUsH3CFNaYV+WkXbbdT1Z6ODByOHTu5iqWRSNbMBbJ6DGj+tpvrfj//CXyUIWQtzTX4E8e9LDCJ9Woezxv1TB8BmgLI2QxIMnigeC9oArulhAEkE+okHxNg== 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; bh=TYiJxjrqvQUxeUlIZMBM3r8utN4UXwr8ER/ufAaEjr8=; b=bcoc9spjxBm7aAzZj58yvMk7itzXqJT+kQo2A6EL35SBCYcVKT0p3CuRpQ0Rl4eurjJpC5SmFrNt07skLSeGKfUa2BhJGloeLqfL2kTTfFpHXeioX0LISrYU2tF1Y4TATmM0EXIrJw+bwj3i6dVy2SNzjWzUH84cVJMTo4yTIUi+/e8L80r7U3DV8+JZWFiFSL7zEIVuIojXU3m6IL0BhUAm0it+7E0pkKEm1qCYTV8XoyRA7ata/eLuBeTUfy+esc3Bt3eWRLJZKlEgR3gEst4E9XR4D/TvP6r6bNOgtJMU+rSZOvl4bshflhIkDaSq7Xm0BfIssKFCfHpw2YJUvg== 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=none 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=TYiJxjrqvQUxeUlIZMBM3r8utN4UXwr8ER/ufAaEjr8=; b=HBHCtAm9VIcH24OAFx0cc4MkCrfMMVhV8DDFf0ol0YoPqQAXdPyKJFbYnrZoR9FlQKylQy4JvOdF1NFLnI/Vsoc+0uZjVHEL/6DP9VDMA9Hu4bJVCFj4Lz6g6WvIvF2A0OvVHE9qUVbzWJ2iecRvsqKrF90fbvqlbbm/K8UR/kvu7PZMByA/MISjS++egOk/GKN8nYxYbv4m8/sOSeSkESodgfmaRAhftN5EQwd0S9qUqRNBLdUuOx0Xx0SuLMUN523j6WTK8DQTuLCsR4EUkz5M41APs/Q5c4N77VHM16+YNFbP3fjMe/kb4QJmDB4JUzYJfdld07JW5x8mMjjQpQ== Received: from MWHPR22CA0026.namprd22.prod.outlook.com (2603:10b6:300:69::12) by BN6PR12MB1619.namprd12.prod.outlook.com (2603:10b6:405:f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18; Thu, 30 Sep 2021 14:56:52 +0000 Received: from CO1NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:300:69:cafe::7) by MWHPR22CA0026.outlook.office365.com (2603:10b6:300:69::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:56:52 +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 CO1NAM11FT028.mail.protection.outlook.com (10.13.175.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:56:51 +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, 30 Sep 2021 14:56:47 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Xiaoyun Li Date: Thu, 30 Sep 2021 22:55:59 +0800 Message-ID: <20210930145602.763969-4-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210930145602.763969-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210930145602.763969-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: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10361bd5-f9cf-4858-83c5-08d98422894b X-MS-TrafficTypeDiagnostic: BN6PR12MB1619: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: 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: 4YXoySdejZWyu2kcQB9e4wbUKtrAW90ILDZBvSfFqGFkyJohJOCNZZa4bffW9YrHWxcAdOUolLWI4POVjINOw0N6Qf9pBMVUX13BO2L1156P3wHFW8p9CehizyqAIF+WV0lCI0UVijcVWRVSqUP/uH7wMF2ICigoSXtQc6ZIt++YULoE2FtunDBqLEL+gbzs0p9/VS2nyNok4rSkq/hqsHlUAodUWIslIGvEhYEBMtOZ+hkidgEXGolrZAGpCDdGi9LmPJ+XXz1y1j2YQ5qy2k0xLh3b4ffJR3KmsUNdV+mosN1AHMGLWmk/3s+sHroe8r47Pzr+ek+hcO6NORJbLua61dptzWvGh/WmPUkT+R0bFhnONMfWo5Rlkj62RKKrUHEcGSc5+HJvn1y0hhMJcvqUUWnkbZ3jPe8ffittdieGWdghiuW0ziDAdFBtnWdenWXpFmqQRTe3fj5TLcHyx/2BODlSz8MwORzVI1j4mDAH17dbNA19t9q6vSG6p+ZSGPtXEevzeAgOECIVjS3KCnsffH64NkaXKoaXYx2VEbD65XCIyhBEPXWDB8m62smRecy+PoL3kpw7d3qsE9L4WI26lRH4cSGFEzjnuouCRt7KSuupYzvLuIhps4VQ0HGy7WItpASAQwAyBNmzoe+/uVuGbHE4Vb5Sh3eMGZc9g+fRTiEndvXyZjBTQ0irjVVmuwpgCX/K9SmmV4iiSjBhtA== 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)(36840700001)(46966006)(2906002)(5660300002)(82310400003)(6286002)(55016002)(36860700001)(7696005)(86362001)(8676002)(36756003)(47076005)(356005)(6916009)(2616005)(186003)(83380400001)(54906003)(1076003)(7636003)(16526019)(316002)(6666004)(26005)(8936002)(70206006)(426003)(508600001)(70586007)(336012)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 14:56:51.5768 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10361bd5-f9cf-4858-83c5-08d98422894b 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: CO1NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1619 Subject: [dpdk-dev] [PATCH v4 3/6] 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" parameter to enable shared rxq for each rxq. Default shared rxq group 0 is used, RX queues in same switch domain shares same rxq according to queue index. Shared Rx queue is enabled only if device support offloading flag RTE_ETH_RX_OFFLOAD_SHARED_RXQ. Signed-off-by: Xueming Li --- app/test-pmd/config.c | 6 +++++- app/test-pmd/parameters.c | 13 +++++++++++++ app/test-pmd/testpmd.c | 18 ++++++++++++++++++ app/test-pmd/testpmd.h | 2 ++ doc/guides/testpmd_app_ug/run_app.rst | 7 +++++++ 5 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 9c66329e96e..6c7f9dee065 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2709,7 +2709,11 @@ 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->offloads & RTE_ETH_RX_OFFLOAD_SHARED_RXQ) + printf(" share group=%u", + rx_conf->shared_group); + 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 3f94a82e321..30dae326310 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -167,6 +167,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: number of ports per shared rxq groups, defaults to 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"); @@ -607,6 +608,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 }, @@ -1271,6 +1273,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 97ae52e17ec..417e92ade11 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -498,6 +498,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]; @@ -1506,6 +1511,11 @@ init_config_port_offloads(portid_t pid, uint32_t socket_id) port->dev_conf.txmode.offloads &= ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; + if (rxq_share > 0 && + (port->dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_SHARED_RXQ)) + port->dev_conf.rxmode.offloads |= + RTE_ETH_RX_OFFLOAD_SHARED_RXQ; + /* Apply Rx offloads configuration */ for (i = 0; i < port->dev_info.max_rx_queues; i++) port->rx_conf[i].offloads = port->dev_conf.rxmode.offloads; @@ -3401,6 +3411,14 @@ rxtx_port_config(struct rte_port *port) 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.rx_offload_capa & + RTE_ETH_RX_OFFLOAD_SHARED_RXQ)) { + offloads |= RTE_ETH_RX_OFFLOAD_SHARED_RXQ; + port->rx_conf[qid].shared_group = nb_ports / rxq_share; + } + if (offloads != 0) port->rx_conf[qid].offloads = offloads; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 5863b2f43f3..3dfaaad94c0 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -477,6 +477,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 640eadeff73..43c85959e0b 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -389,6 +389,13 @@ The command line options are: Generate multiple flows in txonly mode. +* ``--rxq-share=[X]`` + + Create queues in shared RX queue mode if device supports. + Group number grows per X ports, default to group 0 if X not specified. + Only "shared-rxq" forwarding engine suppose to resolve source stream + correctly. + * ``--eth-link-speed`` Set a forced link speed to the ethernet port:: -- 2.33.0