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 EEFD9A0C41; Tue, 19 Oct 2021 17:20:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E17D5411C1; Tue, 19 Oct 2021 17:20:47 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2071.outbound.protection.outlook.com [40.107.237.71]) by mails.dpdk.org (Postfix) with ESMTP id DAEB841171 for ; Tue, 19 Oct 2021 17:20:46 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oK+SW6LdbjB4eRkygxXaBHMJosM3pV/hIAZmIqGskngHYEWGZEh0gmOkubJRBrtVsK0ZtOXyoD9CaXccvGd+hYgS/yNkP0wgOd+vfEg7YlKt+v+9ODBzpYCvRplEtgQVlwTb/SlADXJK4ue4cqRc6aEnKw0DB5azjs4jjASTVyyHENezzpZeWav7+sBLBlLd9WsPX5X8/6DZKEAUfElXyXLJxJSePzDc04Wf5Xrp/a4cqkdSU/jwHM9q8euiX6ybvajEGU5F/GEA1leCcmt+vH1uC/euc8QdoHz8xyJEpfN7NC/hivMEqfuy+EdTHu4ueFxyoqSsD9V+k1tvZa16BQ== 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=BKGzrq8qwGxhVjXNMhaOi8l9p/pxkbMrg8tU1wxKo/k=; b=a8Ux2JPhUkTUQCyFcjjg5JDx/73/QrihA1JBAAy1BV+JtMgx/Y/2Qmsb4q4k61J40Y3WKFWGRcs7Zzt70FRteEn0x38VYrXqC04cWg81+laWJ4erCJtfXO34KZwan3ZlyZL8Itv4uOFZeDFmAwnDUp9dDVXkBHEBe8OvILSzsAbqRoeGrJPy7JNL/HQz6iVPjiho899xJoPtcOVRKcpTu1sx9fYHZaJjsOpZC8llyiWXlFb0Ij94DurpTIvJEkyQnGEUbUK4P0D+fAqnCIjL+9W0wXKTgUJTDj+miI5F34FXZ1u5ngJ3G+s0p0XHct5D7bDa2oG6TgatqqUeDyM4xQ== 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=BKGzrq8qwGxhVjXNMhaOi8l9p/pxkbMrg8tU1wxKo/k=; b=IX4gN24p9bs8cEmu7BbRBH5uj3NwsTq7pMm55gg9Fjll+EfROQWtFisK63uEFDoaed4R6Jj+mH2a14r6HQUGpblJAm17obRVX2RJaa+sTkJhLO1SkrYRNWxF9OJrJDmLaNPVEvkCWe7da8SICj1de83+1GPydGBNNO1e3CrJbj0kP9AWE1prxi0EJg2iO5T51OdO3Kr0GywhodyrQJhixg8MpmMRqzHbUKzJflcOO1jd6tOxwnrseByt3w7JaBuUuQDPItOqLpDF8u7mSM7pUOJvJww7jm6IftWa31hdc86jsE3p5hhtOee0+MAxZPGK7a591GkYNyxSxAlbEY7SuA== Received: from DS7PR03CA0204.namprd03.prod.outlook.com (2603:10b6:5:3b6::29) by SN6PR12MB2720.namprd12.prod.outlook.com (2603:10b6:805:70::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Tue, 19 Oct 2021 15:20:44 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b6:cafe::dd) by DS7PR03CA0204.outlook.office365.com (2603:10b6:5:3b6::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.15 via Frontend Transport; Tue, 19 Oct 2021 15:20:44 +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 DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Tue, 19 Oct 2021 15:20:44 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 19 Oct 2021 15:20:37 +0000 From: Xueming Li To: , Zhang Yuying CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" , Ajit Khaparde Date: Tue, 19 Oct 2021 23:20:18 +0800 Message-ID: <20211019152024.2277527-1-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210727034204.20649-1-xuemingl@nvidia.com> References: <20210727034204.20649-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c7e42a1-44fe-4767-fcb3-08d993140552 X-MS-TrafficTypeDiagnostic: SN6PR12MB2720: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ILdsnVXn3z1pRVWH11dXLz4CU91fAhXX7LP8kF05qjCU2RhwPcW3F0gzB2y23BEg+rNW6G/Js45j71pKvkO8mSsvcEKCl2iFqN3jJ9jPU9hx2oP2g5Dy2BItOc9rdu3rqqadLWrQZ1JTpJ6PIbNPsNdneSFyxJk1EtHShjFHxufyHTcyTDBQ1LLgjVMuKKZKxuFv8khdjIDYaujNi77O34Wg2j1ULAY7MGiKM+HDqn9HfwH98XlLy5BdDAmC7awIDW5HRiORGa/06AlXBilkVtuOytdsS+uKus5tH+umxtMLtvpKBo3Flh4ynZQfRfqneCESc1MphDEVI3GBee2OFo9h0kSvhuXMmva170ihVQ4RNp/p0zV7hMMEe5rn3y8mLWxCh45BPISdEJHcmFJ3Em1UVRDhF3MEQO8wnCSOJhuGMCTGrpK9OpuU7QEvto1BLmBbEhzOsgky0yz8N5HK0f9j9lN7LI9X4Fm3zyCrzVup3n0nksD8SSmCTUtyN04VPh31G5PCZlaYkaDxbwef3EFrLIuh9SLhtb/0LUnf2VrzrcmqqfRvy9Vz72QQ3/NcbO06+gxI120H5UIWfealCiO50/vjtvqbMEUykBYv7/KZDUE7HfMw1eP1iGnRRCbJc4YGFRX/Avar8QtKdRqL6gOI3Y+xACbulebf2mQY4n1N1i7VgZCtYTLsshV4loTVH0jUqgh+sPj2m5s4r80Tbw== 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)(55016002)(86362001)(36906005)(6666004)(7696005)(36860700001)(70586007)(83380400001)(8936002)(2616005)(36756003)(186003)(6286002)(4326008)(8676002)(82310400003)(5660300002)(47076005)(426003)(508600001)(7636003)(1076003)(26005)(54906003)(336012)(316002)(70206006)(16526019)(356005)(110136005)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2021 15:20:44.2202 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c7e42a1-44fe-4767-fcb3-08d993140552 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: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2720 Subject: [dpdk-dev] [PATCH v10 0/6] ethdev: introduce 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" In current DPDK framework, all Rx queues is pre-loaded with mbufs for incoming packets. When number of representors scale out in a switch domain, the memory consumption became significant. Further more, polling all ports leads to high cache miss, high latency and low throughputs. This patch introduces shared Rx queue. PF and representors in same Rx domain and switch domain could share Rx queue set by specifying non-zero share group value in Rx queue configuration. All ports that share Rx queue actually shares hardware descriptor queue and feed all Rx queues with one descriptor supply, memory is saved. Polling any queue using same shared Rx queue receives packets from all member ports. Source port is identified by mbuf->port. Multiple groups is supported by group ID. Port queue number in a shared group should be identical. Queue index is 1:1 mapped in shared group. An example of two share groups: Group1, 4 shared Rx queues per member port: PF, repr0, repr1 Group2, 2 shared Rx queues per member port: repr2, repr3, ... repr127 Poll first port for each group: core port queue 0 0 0 1 0 1 2 0 2 3 0 3 4 2 0 5 2 1 Shared Rx queue must be polled on single thread or core. If both PF0 and representor0 joined same share group, can't poll pf0rxq0 on core1 and rep0rxq0 on core2. Actually, polling one port within share group is sufficient since polling any port in group will return packets for any port in group. There was some discussion to aggregate member ports in same group into a dummy port, several ways to achieve it. Since it optional, need to collect more feedback and requirement from user, make better decision later. v1: - initial version v2: - add testpmd patches v3: - change common forwarding api to macro for performance, thanks Jerin. - save global variable accessed in forwarding to flowstream to minimize cache miss - combined patches for each forwarding engine - support multiple groups in testpmd "--share-rxq" parameter - new api to aggregate shared rxq group v4: - spelling fixes - remove shared-rxq support for all forwarding engines - add dedicate shared-rxq forwarding engine v5: - fix grammars - remove aggregate api and leave it for later discussion - add release notes - add deployment example v6: - replace RxQ offload flag with device offload capability flag - add Rx domain - RxQ is shared when share group > 0 - update testpmd accordingly v7: - fix testpmd share group id allocation - change rx_domain to 16bits v8: - add new patch for testpmd to show device Rx domain ID and capability - new share_qid in RxQ configuration v9: - fix some spelling v10: - add device capability name api Xueming Li (6): ethdev: new API to resolve device capability name app/testpmd: dump device capability and Rx domain info app/testpmd: new parameter to enable shared Rx queue app/testpmd: dump port info for shared Rx queue app/testpmd: force shared Rx queue polled on same core app/testpmd: add forwarding engine for shared Rx queue app/test-pmd/config.c | 139 +++++++++++++++++- app/test-pmd/meson.build | 1 + app/test-pmd/parameters.c | 13 ++ app/test-pmd/shared_rxq_fwd.c | 148 ++++++++++++++++++++ app/test-pmd/testpmd.c | 25 +++- app/test-pmd/testpmd.h | 5 + app/test-pmd/util.c | 3 + doc/guides/testpmd_app_ug/run_app.rst | 8 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +- lib/ethdev/rte_ethdev.c | 30 ++++ lib/ethdev/rte_ethdev.h | 14 ++ lib/ethdev/version.map | 3 + 12 files changed, 388 insertions(+), 6 deletions(-) create mode 100644 app/test-pmd/shared_rxq_fwd.c -- 2.33.0