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 4A3F8A0C47; Tue, 12 Oct 2021 16:40:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9404741198; Tue, 12 Oct 2021 16:40:19 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2056.outbound.protection.outlook.com [40.107.237.56]) by mails.dpdk.org (Postfix) with ESMTP id 03C0D41193 for ; Tue, 12 Oct 2021 16:40:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NPloxUf+aN/e95aGOhe9mak52RNMOqIx4M5I0qfnMmB0J9y7nfN7M3Azn/7rh95IOq87eRJ6DfxK1ggxcp93jwusfCoNr8TRycPnIOKxl3kr2Y081HhkPEnwLyddfIu+xKbZuSsiSfs5FrMUUFBQm/hmjlnM0YTksTW44zhCJHYHR0blD1dvazNQ4VQOrPMkQ9IizjezaXnYz+xlZRK75DXEooxe63m8ZzN3TYwS2LBGKu1IX8Qa+uns3IpUm7h7+yvFe1NYHiBTckhy+yrMRfqGWdPNnaqw1EqHG3aYp98tqJ+KoNHjvi/av6NuzvZmeEkdUzEkhaXmekNt9bBirQ== 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=jKMMVrjX7r3awXpBMEg0+cMTrwwDtwfUKqsbM4O+WqA=; b=mtHX6obIETcy/azgFreKVBqr2Q3MSAZw4kZnT2nWSt3T2kARFUq7nbxQec1u88dttH0japToFDlLg2SqqsnLI5yshDePYaM3X3meL31+4uv+ys9Veofd4p4HnHj5C5w/pbBZBYe0vtfU8vwZCTYmgzOd2hn4RlSSSxCorz6Zi55hkU2G/3ILtCVm5SnwBq/tPn6I6vp25Ggl2HyH8Qvb2HlAabDLexSgR6IAwrTSEZgQX99kDkucSx2Op/A15OtoEUm54hwhsd5qQ2paLI6oYdO1XXkp0z3tEm22IiH0JzJIW9kiXOVSzkTD2rm3Kxgm1oTjGwFjn4KF/iGqbRCQTQ== 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=jKMMVrjX7r3awXpBMEg0+cMTrwwDtwfUKqsbM4O+WqA=; b=grNl+1f6E1wdgGDtHe9fjUvHoote0y6UhIjIt5gAmkZjRaU6/2qjVtQ6jeIdF8UNsgbPdwaiVVEc1uFVklqd+ZJkR1wwG43liLkdM6VlY8Thq2ny5nXmGOm+hG9WuMbPsOYrGTKu3jkXmbqcfvgii+hZ738zt8fq0aCyUvLV2xcG0kupX5iHdiq1/4WSa2zUiyJLk2v+7GY3bmyTGLmAsll1LCnBG1QQrVstgjnALXX5FqBVoLlsa1mWdb2QLLBJ9FnddPY7JPZ+0rwtQFCWaFOfu6tloRYtQcZ3qC7pFw5t0sdhQn7HGfJzvtjqII5x+psgZKWBIFEEOyN7Sb7tKQ== Received: from MW4PR03CA0222.namprd03.prod.outlook.com (2603:10b6:303:b9::17) by CY4PR1201MB0024.namprd12.prod.outlook.com (2603:10b6:910:1b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.24; Tue, 12 Oct 2021 14:40:14 +0000 Received: from CO1NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::ad) by MW4PR03CA0222.outlook.office365.com (2603:10b6:303:b9::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.25 via Frontend Transport; Tue, 12 Oct 2021 14:40:14 +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 CO1NAM11FT012.mail.protection.outlook.com (10.13.175.192) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Tue, 12 Oct 2021 14:40:13 +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; Tue, 12 Oct 2021 14:40:08 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Xiaoyun Li Date: Tue, 12 Oct 2021 22:39:39 +0800 Message-ID: <20211012143942.1133718-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211012143942.1133718-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20211012143942.1133718-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: 9230d37b-3114-43c3-aa29-08d98d8e335c X-MS-TrafficTypeDiagnostic: CY4PR1201MB0024: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LUlAbOWwJf71Cg+55ftXCMfZNm+VFo1oHMrCR4zlGIyOkhKQq+6NpCE2yHfU7qeePj4WRqe+EwxBHy5nPAqnTvTn2zRC7TrPyKvI+NhuH4gPQ3ZsGIu6wW226BLn3Wc9O39jAVtPtqMDRZGvsdgo6pwQ2o9dEQhSgei/4DREXTI6Xe3jVg+hXEo91u4bCTKPuMExBC/KDwPUYnVu6nc/F8JqZXyzqm8Xq1LXlkOnH6PZAi2ID2r2hWg5fiGAPHP6jY+gf3gRbrUKJMW15zxSK8UY0aeZLWfOM76Vmyj39eCTcDPMaUKPKfGxDQFoRGO5ipLQhFGAk+Jy35Xyy0CiH4xq+9PeL1VEaHU7fPS1UJe6BpcqUUkF5ryN8Hc4e41NJK+kDWnDfaaAP6Lmp1kmZJY5zgedIoZk3b6omTE1p3numOZvcJjAS2A9wK1R6FuJGMvkgNKHU0pzGW/ek3Fqc0Dq02ulgryY9+QMHSt0B1uSo6JY4A+tI8J8wEnq7v78st9TPlARddmuOM/OCUxl5brVKmV4uIF9wxStF+p1Wcocr/+vm0lT6L1zoeWjiq5A03ifcskBkastIGFO9KJKyC5XK4/Q/uryez0J81JJdVXQQ6wIWKD5Mmn1CwnTUqxfOy1XdZc/nCJQWjIVWoAJIzqoABE/frN6z/7hBHjp+enMKBrr2tUHJPNKrKB9YxAbbNoaNEU1LnyK93qhxrZrBA== 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)(508600001)(7636003)(1076003)(82310400003)(5660300002)(8936002)(55016002)(8676002)(83380400001)(6666004)(7696005)(54906003)(47076005)(336012)(86362001)(4326008)(6916009)(356005)(16526019)(2616005)(426003)(316002)(26005)(70206006)(6286002)(70586007)(36860700001)(36756003)(186003)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2021 14:40:13.5069 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9230d37b-3114-43c3-aa29-08d98d8e335c 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: CO1NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0024 Subject: [dpdk-dev] [PATCH v6 2/5] 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, share if device supports, otherwise fallback to standard RxQ. Share group number grows per X ports. X defaults to MAX, implies all ports join share group 1. Forwarding engine "shared-rxq" should be used which Rx only and update stream statistics correctly. Signed-off-by: Xueming Li --- app/test-pmd/config.c | 6 +++++- app/test-pmd/parameters.c | 13 +++++++++++++ app/test-pmd/testpmd.c | 12 ++++++++++++ app/test-pmd/testpmd.h | 2 ++ doc/guides/testpmd_app_ug/run_app.rst | 7 +++++++ 5 files changed, 39 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 9c66329e96e..96fc2ab888b 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->share_group > 0) + printf(" share group=%u", + rx_conf->share_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..9c26301d397 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]; @@ -3401,6 +3406,13 @@ 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.dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE)) + /* Non-zero share group to enable RxQ share. */ + port->rx_conf[qid].share_group = nb_ports / rxq_share + + 1; + 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..ff5908dcd50 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. X defaults to MAX, implies all ports + join share group 1. Forwarding engine "shared-rxq" should be used + which Rx only and update stream statistics correctly. + * ``--eth-link-speed`` Set a forced link speed to the ethernet port:: -- 2.33.0