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 256CFA034F; Mon, 11 Oct 2021 14:38:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9AC240E0F; Mon, 11 Oct 2021 14:38:27 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2055.outbound.protection.outlook.com [40.107.93.55]) by mails.dpdk.org (Postfix) with ESMTP id 3616840E01 for ; Mon, 11 Oct 2021 14:38:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4CP5+FdzpNE+kM5niJGNHZpBQP9Jckjj94VfBIAdFFm0nAkADG6DCPlaKVlshZCRL/LHilIY0GrEUYYAEVkVvK4YiT8eX5IrhwW82uoYl+YnHe7AnZgwVbvE7vVsj2VdCDXACdgpJsmrDQGN8KoHv26lV9+wUw0X3HTjk7UzawYOTT8nDCNjD67X7Hba0z7nFhB7EU2hz/RpLMwEW9+cwMzLdNKs8ZrCX6xUT7kcSq72YwFOACkl+SNs0p2VYeRpXOd4Y6ifkxIklgletL5YWf6O5Tl/4OOZ7Hl9JmS4z4AaPQfAHKhVGznLBb8cQpLx/koJ1Hr4Ffb9U5dqr3nog== 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=uNDQl0dMSKpexgyatwyd0WBG1tYBW6JDPQJFGQAN7cM=; b=W8vgnVwPizfTWqh1nXl8n35fmyqVXKM+rudvYpaB+0y23vAlrzgqET0rCrdJYJj4mZ3dH7bm7lP+DQnhpWmL7/bq0iuSpQTVbQyDyMuMvTofSktQd+uul1yAoXWAEFztdsl9CcETbSU65/db8EowHVIx9z62PIiEOpD7E1FFjs/dAPNMUobBcXErpEGnIp3yE5g5k0A5bPctgbezPKdcxQYe77fRRmpUWAuW0yuPr/qKNM/oaTQm5LvgTw/tr/2X0OttSYXBWeF3l+qEb95fuPu5PdPOBTk9M+B5sY9Pulh+aDt6hx2Qgv+fM9xGVAbVo3mMgVQSVw6XmXNNNuT8VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=oktetlabs.ru 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=uNDQl0dMSKpexgyatwyd0WBG1tYBW6JDPQJFGQAN7cM=; b=Thqb1iuXBRZrBCLqsciHJ1aRXqDcn4w1DcSpE965NvO+3YMST6f6Xck+QeWAQKiT4JiohlGdYHbWZxFqn0Mh8q+hgKvowsihBlIwV72Asu3ay8hX5gXDlGddk00OPj8WoYfrZjQ9CJ/U8ntD8T/gKDw+7c0CGYPH1pClm2XZ8DPXEsdgI0LyyOs2He/6k6d67NhTb7qEjok6YbeRZyAoa43l7uH/WvTWMgyHbyrMQUXYLHZ1uPyDVEd8AG6SIAVx4CEiM++JSsRi6I0s/0iqS8qAYNmjbzKkCCR28sZ5selAyx8TXIfiCl4n4CC3Lu7qfnfVjvvN6wMN9I3lG/bxiA== Received: from DM6PR10CA0009.namprd10.prod.outlook.com (2603:10b6:5:60::22) by DM5PR1201MB0186.namprd12.prod.outlook.com (2603:10b6:4:4d::20) 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:24 +0000 Received: from DM6NAM11FT038.eop-nam11.prod.protection.outlook.com (2603:10b6:5:60:cafe::9f) by DM6PR10CA0009.outlook.office365.com (2603:10b6:5:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18 via Frontend Transport; Mon, 11 Oct 2021 12:38:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; oktetlabs.ru; dkim=none (message not signed) header.d=none;oktetlabs.ru; 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 DM6NAM11FT038.mail.protection.outlook.com (10.13.173.137) 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:23 +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:20 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" Date: Mon, 11 Oct 2021 20:37:27 +0800 Message-ID: <20211011123733.961222-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.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: f3f70ca2-40d7-4c34-a272-08d98cb403eb X-MS-TrafficTypeDiagnostic: DM5PR1201MB0186: 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: o4YMpuJygsjopsJu2ywl6dt9KkWbtVLXi/twt0rLR0qPKPiIFxGddNJ3nO9tuIoEfuh8Igp4B03YzORmPUBHjU3j9eF7A9hl9UawMs2lEbDqWjviGAZDWG2o6HF3qDYuY8S3COxqCo/aiX4MV0OwMk42t/cPQp22B9cSXrf+Z7qeO5O+rFWm69oNaFWDYULzt9ypYa8Li/2ZlI7Hm4O4zjNIM0lLKSdtuzKrgkBaZd34i2S7UIFoC6fzUWNIroWGt/mD2tKZnic+yfQuJa1u9yCUSnGAeJO1VVHpuEU5r1NlISANllvAxfk0H5rZTE6BptqJ2z7rK0FZY44kXNb5zX+rS8rh25LQ5ycFz0/wzxIiOun0b7k6SYsQvwvY8i1yGuY5Wi7kMCFoOgjd27Hyp1TVHNRTNiQPoFtd1kT0JRRvdnhhkvu5SscJHhBKq+l0iIEJGn3X/o2zmPXE3Q5TqUx28zmRJCMmI0xaRvXYBEDAQZrfXpOGVn12TfNlTEBbvrke8FkXUo14Knj+iIaqXaWAama1HWOWiETjKHy0bIGfZGbWxO6BmyMr3OQumkKrd5azhMitfmg1tzxX/6k0Rut2e6WWhNFWRCJr7L6Zas6fGj7p9PXQ+QQs3KVdjEkYo04iJPitu5PPMkSdjRjPNrN8+O3nMcsSClXaWdSeXwfzU30YN9jlo6eYQgsaEdUuEPidJz/k4nRiMPHJgnYsmg== 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)(336012)(6286002)(1076003)(47076005)(316002)(8676002)(26005)(2616005)(426003)(70206006)(36756003)(55016002)(70586007)(83380400001)(8936002)(7696005)(86362001)(2906002)(6916009)(186003)(16526019)(82310400003)(356005)(4326008)(7636003)(54906003)(36860700001)(5660300002)(508600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2021 12:38:23.6342 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3f70ca2-40d7-4c34-a272-08d98cb403eb 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: DM6NAM11FT038.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0186 Subject: [dpdk-dev] [PATCH v5 0/5] 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 with same configuration in same switch domain could share Rx queue set by specifying shared Rx queue offloading flag and sharing group. All ports that Shared Rx queue actually shares One Rx queue and only pre-load mbufs to one Rx queue, 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: Group0, 4 shared Rx queues per member port: PF, repr0, repr1 Group1, 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 Xueming Li (5): ethdev: introduce shared Rx queue 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 | 102 +++++++++++- 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 | 23 ++- app/test-pmd/testpmd.h | 5 + app/test-pmd/util.c | 3 + doc/guides/nics/features.rst | 11 ++ doc/guides/nics/features/default.ini | 1 + .../prog_guide/switch_representation.rst | 10 ++ doc/guides/rel_notes/release_21_11.rst | 4 + doc/guides/testpmd_app_ug/run_app.rst | 8 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +- lib/ethdev/rte_ethdev.c | 1 + lib/ethdev/rte_ethdev.h | 7 + 15 files changed, 339 insertions(+), 3 deletions(-) create mode 100644 app/test-pmd/shared_rxq_fwd.c -- 2.33.0