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 0902AA0C46; Fri, 17 Sep 2021 10:02:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6BC941109; Fri, 17 Sep 2021 10:02:34 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by mails.dpdk.org (Postfix) with ESMTP id 6182841102 for ; Fri, 17 Sep 2021 10:02:32 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d+rg5KueG6z5FRtoJyDkVRP3ZHpIbDcXL5UFT1kfMUSwq5OPoo+DFN5gmr+bD6gF6yzUHxQ+xXBV8nylZBJ6fB/80YyflS6JHIryfgoznu+EeSFrh3EFgkHWbAQeq8z3QPnof8BL0Jey9r0m0WhuF5LnUCfjTtHHhiuMzTgqOZqNP17iVgEXZyjBIaCmfTwg4T2Effn7lEEC6STbsVhl3gVVBo0nTjufJcx412AO3zZRo6yb43QyrOs5Dqc9XZru9Z9mbFtSTq6BNMIOvHrwPPIhNplhF8iR0jBPqN462bGCmS9ZmiEbExkOatNtldH1dIQMdwTyIPg2Z/THSppfgA== 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=pmD9t5AoNm1cxjj8wZBp9TUlOUezUmBlAHluUaCArsk=; b=Xujxi8pvY0gZC8BI9ze5+tnq7Adu8ddDEo4Z4jtFvix3Pd57XWlf38wDs3dEgsE8xByWRRuNYmCF+d2zzOouU5AAVlEOO2ntyCGyyBO8LdrEQpaXOK2xR5+4tnzNcyN0SbtCoPq4F3qqiXN84g2PmO2k9PwNE9miZjhGAw6JhThPj5+xu3iop+9czcsiIhiIs/9awr4gL+jOED39irJEqyueuvkPikndeYYQAROgnVPisUzXqXihFuRIilkV0wIEKk6VthLCgCnN6gQpvprOarr3YE2lzg+cODahOW0AB0c698ay/CSDP+5v+0jXhYERoAXMH/Jg8k/ugHrJ2iC9NQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=pmD9t5AoNm1cxjj8wZBp9TUlOUezUmBlAHluUaCArsk=; b=FoJ9KtGfoRGnC9YUbdgU70vYqiHn2pjVCN1pGgiO948eH+Nk0sWsk3hqvvIhSPeDKHd1G3Y6LYf3oxNXqIctjsYNf8iz69T1qFsA6BvzfzEOHoEqcK+Lv67ypB3QQv721oUd4E6r31A2VGZfplBmRk/huCP9PaCp64mlAOFHo0DVeDdB0WZAAbNYE/wQ4BaJH1A8bhMrRlxk8ie+BODybWaIgajKkPxGnhATvldLGHxLmVrkAuBpLAM0pmvIXn8DVY66nbm9ja+DZo0Byudibf48z1SgGzUscARK2qnN9Uzu9PCv5K50+whAQjdGBB9NyO+8WUAwRsBmkD61DDCX2A== Received: from DM5PR19CA0006.namprd19.prod.outlook.com (2603:10b6:3:151::16) by SA0PR12MB4525.namprd12.prod.outlook.com (2603:10b6:806:92::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Fri, 17 Sep 2021 08:02:29 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:3:151:cafe::46) by DM5PR19CA0006.outlook.office365.com (2603:10b6:3:151::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14 via Frontend Transport; Fri, 17 Sep 2021 08:02:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4523.14 via Frontend Transport; Fri, 17 Sep 2021 08:02:29 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 17 Sep 2021 08:02:28 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 17 Sep 2021 08:02:26 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , Xiaoyun Li Date: Fri, 17 Sep 2021 16:01:17 +0800 Message-ID: <20210917080121.329373-5-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210917080121.329373-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20210917080121.329373-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 DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5734225c-7479-47c3-5703-08d979b17efe X-MS-TrafficTypeDiagnostic: SA0PR12MB4525: 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: SlyIQJgrJIdyy9jIwycLKRHR+L4cHgY6B8DdbAU/7pG3jumT1H22J/IqfuaB40qSvcsuewEUl5g1ba9yYg3PV4xmHMuPSIpdFZ+uvBvgJlkxsJm4iTWZ6jwOxx5viNMd4YPgHNqI2EkaNBuYetLd9dksP+fWvxumHpfORZmR/vQ3eOn/0VinffkWWDxEL+MOGGnxLIl3QcsG+4QWYbwUv5acEnp3hxhp7V9ozrcaVv1fst49J1y3ywr+UMB+jxDjzHOVYbQNo1Uxumkyue7Pb23PPCKv8B5I8fgLnOyllN0dmY9By5pVIwnHMIVKYup7xFK10fsR00sEu8I0fls44bZfFY53m6mHaCcn9DD7UsdVTT2ARW21ynkxzPWECj+bnOye5Jv1CuqSbAGq8Nlx7wVn90O+3OMFTflGcBSDRVL2d5jYVH6YGR6yLbOa1kx9A9Z470NHaqjAdtnCDOwmpBDmaGj6VzKFgWA67VrcYLS66cCCa+s5lotNAOrCvBOtZsFk6F1hb31J21gqF83nrrbYUgiyCxGv5b82/ro7BJ7Ze7vZYNcylCBjUigHrGKqmOHSFpNvmZygkIbX3Ny28LnFXUbQyWcvBFtqAv1TEPqkAc4NdRw1wvN2ocgAWLqjbU4IqYAF9zElD40DnFdHWzr0R8ZNiINFgKNdTemqy8fctBaL+zj4QlylRc6iyeOo0Xp/aZ53UYV438tXIXQRxw== 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)(346002)(396003)(136003)(376002)(39860400002)(36840700001)(46966006)(36756003)(54906003)(86362001)(82740400003)(1076003)(83380400001)(8676002)(7696005)(6666004)(5660300002)(6286002)(7636003)(26005)(426003)(186003)(16526019)(36860700001)(2616005)(70586007)(47076005)(70206006)(82310400003)(4326008)(6916009)(2906002)(316002)(36906005)(8936002)(356005)(55016002)(478600001)(336012); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2021 08:02:29.5106 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5734225c-7479-47c3-5703-08d979b17efe 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: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4525 Subject: [dpdk-dev] [PATCH v3 4/8] 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 | 5 +++++ 5 files changed, 43 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f5765b34f7..8ec5f87ef3 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -2707,7 +2707,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 3f94a82e32..de0f1d28cc 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\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", 0, 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 97ae52e17e..417e92ade1 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 5863b2f43f..3dfaaad94c 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 640eadeff7..1b9f715608 100644 --- a/doc/guides/testpmd_app_ug/run_app.rst +++ b/doc/guides/testpmd_app_ug/run_app.rst @@ -389,6 +389,11 @@ The command line options are: Generate multiple flows in txonly mode. +* ``--rxq-share=[X]`` + + Create all queues in shared RX queue mode if device supports. + Group number grows per X ports, default to group 0 if X not specified. + * ``--eth-link-speed`` Set a forced link speed to the ethernet port:: -- 2.33.0