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 7BDABA034F; Mon, 11 Oct 2021 14:38:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2709F410F5; Mon, 11 Oct 2021 14:38:37 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2047.outbound.protection.outlook.com [40.107.95.47]) by mails.dpdk.org (Postfix) with ESMTP id D0D29410F2 for ; Mon, 11 Oct 2021 14:38:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TCJ6WiMqQoKvO/mDpy3d36AT3XRceisgKA8hkb02VSMaQWShoMJLgV/8DsWmAV+Mz/0rjYH8uGe5Y23zjqDdjVuprayZh/qOcPoEtXcuRaAA7ID0iXB861VG0NLPtgQVCpIESbox6hBG+F7XsC1SSL22pwztUE5gGG7Pr9qvXWTv9H5L0AGzDFiYxAat8uNJKIr8Rd3H7P1sgKdRK1mg6idkNZ4gVIF4ImQ28qNFIt9RfBLSTjUkLyUTzyxzvw6Bi7PnXgMsz6uPbGgbnsYRZIEJxRdUf1s25RWFDXHx7I7bxHrhoYFyOjXcWBksT1c84xQ2bftexU0FGp9krT/FoA== 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=DWKJGg2RL+TJjhVPTxYZI5xeiHHCMQaSjw1Wr0moCgg=; b=T32Zhz3Dsr6KyGIYiDMs4A14vfW83NGBbtLoigQbvt7GHg9VjydjSESRMeohOA+fki27f5x0XeqafvVHKc+fyKyFdhBQjj38OGsDEDPMSdLqmKyypZYOKRGq0d3/4BvEfMyp6d5N/nMZzVN9X9aJvjlyzkHjqXfgI7LSEQGAVB5+FqS5wRl0o00p+fwMuv7oV/xqnaRiv7B1PG3G8heFY4dPXzn08XC4KoOfiY/zksG09YYX+RrUV62K4yl9safVIPR9/ArLRi18opWOkgLc3ceItLMJU2tBEF4j1h5oDdf5sey5isUPqsCL6vRwUzbEMSmtPTJG1VCDM9dTXtIntA== 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=DWKJGg2RL+TJjhVPTxYZI5xeiHHCMQaSjw1Wr0moCgg=; b=IOkPiHiqy3o4ijDGzfZPbbSyfy5HJSB3htMJwZ0GDT3zlPVZZi4q8MzKZBUoVYwwpcQMcswSYScHHP2IxcXH9Mss1ihQz8TkD6WEU7sZysRIIL8Y9ZQ275OIEPvor0kItUEV8ORQNDQhR3X0Jf6nLykMFdz7TNXj8bxO2p+5gMrki3u36yA9X33LCfc1c5P7WBPGgFc5zX/Rl3v2Ow5AYKX7XJp2CIjje9fwqQkCDSLp6Xb0Qb+s0pN+b/lCm3FcD8Brukt3J0Hxlu/WRvVzcaoPTBIV97V6fd721uqtw8hqyy7iHQpdC2RJNMe+59d3Id/1roovMe2sxD+iwgT20A== Received: from DM6PR02CA0038.namprd02.prod.outlook.com (2603:10b6:5:177::15) by BYAPR12MB4709.namprd12.prod.outlook.com (2603:10b6:a03:98::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Mon, 11 Oct 2021 12:38:33 +0000 Received: from DM6NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::4) by DM6PR02CA0038.outlook.office365.com (2603:10b6:5:177::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20 via Frontend Transport; Mon, 11 Oct 2021 12:38:33 +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 DM6NAM11FT039.mail.protection.outlook.com (10.13.172.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 12:38:32 +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; Mon, 11 Oct 2021 12:38:29 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Xiaoyun Li Date: Mon, 11 Oct 2021 20:37:29 +0800 Message-ID: <20211011123733.961222-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211011123733.961222-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> <20211011123733.961222-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: fab3f109-9eb8-4791-a045-08d98cb4095a X-MS-TrafficTypeDiagnostic: BYAPR12MB4709: 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: PlDV2YZaIDA6OdGkt/NZpguuAbf0VJUJul1gWCLl7p7mry8Duzwe1qJ4INQ60ffSqZtut1FOKxqz8fiLep6Y7km0GbnZYw8Q0zSMhUk4AZ265NGbi+TTPu+WwpgliC/fGs3CuTMmuSFN/M35dam+VYWIxeaEGKNu+jjwLeHplIuXLRgO2w3iB7lJsY5I209nngKRmIgwPk51WhqK6JJRuo68W7pKj2gMaT+EH4oBf1Fi1DOWXYkiWe+4ibti2Lzv5zz0sAQ2WXc1TTvJMzAn3XK+w2iOd9mgfc/5BJQPHLSCE4wV247g5Jt2ShYCNexmrS3vlmeKEA24Oa6ivlLL7VIah8zCd1txYHrAhC0zLnW7gmFR5WHs1V1kbUY51Df52DYJPF3P7hUxAw9SVh2JjzIQkTH8cJZYJW2L1qpCc5qFCpdZd7Ot1uGVHPdovDWyWow9vc2p4DuiPgC5L9C8SWE8YHCPxtwdkJ7W3UrgsoE9bd0PZt3fBRVladTN04Ofv5CWcEYkcGNHwnt5H7Lu3hYplZ/v/Ai2uBv6BinUzFpEllsvWdCKmYVCCbAMikInr6zFiyzmNK4SoRahdO5b8iWRhbefly4LVLKUsmp0ahRogPc03F2teOnFajkbmSSRi0lGPGToxPa4IbWSIBFD0amxcFoVnRYjBIYBkeLBFYtRb77jagOoIQuTTdifA8nxz11PQpB7fX03amVYm6Fibg== 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)(508600001)(7696005)(8936002)(356005)(2906002)(186003)(7636003)(6916009)(82310400003)(16526019)(86362001)(426003)(36756003)(4326008)(8676002)(55016002)(336012)(36906005)(1076003)(83380400001)(316002)(26005)(2616005)(70586007)(70206006)(5660300002)(54906003)(6286002)(47076005)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 12:38:32.7512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fab3f109-9eb8-4791-a045-08d98cb4095a 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: DM6NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4709 Subject: [dpdk-dev] [PATCH v5 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" 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..6cfe88951f7 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