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 8CFF7A0C41; Thu, 30 Sep 2021 16:56:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30F7E410E5; Thu, 30 Sep 2021 16:56:37 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2088.outbound.protection.outlook.com [40.107.95.88]) by mails.dpdk.org (Postfix) with ESMTP id 8384A40DDA for ; Thu, 30 Sep 2021 16:56:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZPL2MlN6eH6sACn+bxZ7H9TXsn/wZc9mTfFsAlvGd2orco0d+k1gMB2ZY6kXVvOLTsgRALirn20+wwYXfgBMEXGKCo+UmETTVdAviUT44C99E8Vz6zH7Qx8titGOfK3aipOHICoinYZUXKHn+fzG/Xh8JMxs/aYa1HKOrbA/D5RDhl20RUHAd1P79bRYAyMMBP32SilSOtp6fOKeonj1Zsssj/B3kQ4g14w2FtQmgeZ4RMwcCVDX3062WQQGZB03ZhGlg6LJO0OdjQKGv4y9NUT/vkYmF0q8UnEZlHpV35D93Xj0VYv1cJYXTGab8QGKQaDt/AOvmvldCOfrSydbGg== 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=ka+VnaRnD8BihVHjixOGafgWLCmSewePssG8+Ab3xno=; b=I9/DbEX5TLlN3lvGvsf3WQUB1t9BXb+Z9OTpypPJeu7U6DH8y2ozjSAorJa86TDleXsp++/M25G7N+tUI5FCuxLZGtVNtISqkbMg1BPQ71pYmIXhgPd2ftrc4yAl/oz9txIMrewfWgWhMtu9VxC8YEdtLfu8kh8/MiOGvuOOSEfA75vQOXcnxXSB9ewi/TbsKeMYgw7yyczTQqY9i8B+Oxx+AG0EOrZ341ZFqZG3xdofc/sD9q3b7lG/17CqOzgbNIQ2vIV6cujDd3QLveHA6Yrok1/2VrRmD5DJxcUytMnL1wb3A+tQ0gcR12iscEl/rDoCtiJYi4fvHjn35U5bnw== 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=ka+VnaRnD8BihVHjixOGafgWLCmSewePssG8+Ab3xno=; b=j0d475wzomiCCbjfTXEjXIXVRauK6ImgP77P74RM+cNsEV+xCPSbUHsTmDe/HRKPfvmsg8u7QoHgEBSCc1hfPMRrK+OW8IzjuY9ps8wzW9JWvm/VtP6TBk9wuxeMJ7EAC0y1xNo8OFSCDpkgwKdMbKHb8tKCedCvsike8V6DQ4JCI5nonagsW4vvDi9LnWtDXc9Jw1k+rVN3XhVjai2T4a6n6jtVOSWilc841tznJrgQnN/eFGeVORbjKn30IGr9jfxnTtAIFZ6ZpzfR/4ZZaryu/PfpIldFyRevZFlOQ1zKf1TpIOLWCWDYOB7odZQ3VMEy+NS7m5IKKGMKksw/Lw== Received: from MW3PR06CA0018.namprd06.prod.outlook.com (2603:10b6:303:2a::23) by CH2PR12MB3750.namprd12.prod.outlook.com (2603:10b6:610:14::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Thu, 30 Sep 2021 14:56:34 +0000 Received: from CO1NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2a:cafe::70) by MW3PR06CA0018.outlook.office365.com (2603:10b6:303:2a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.17 via Frontend Transport; Thu, 30 Sep 2021 14:56:34 +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 CO1NAM11FT029.mail.protection.outlook.com (10.13.174.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Thu, 30 Sep 2021 14:56: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; Thu, 30 Sep 2021 14:56:29 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" Date: Thu, 30 Sep 2021 22:55:56 +0800 Message-ID: <20210930145602.763969-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: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 28a42388-769b-4993-0860-08d984227df5 X-MS-TrafficTypeDiagnostic: CH2PR12MB3750: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GrhVeufsVrdSkbVx9CGA2iperFD7+7YlHN6CJgLVwNX5AG+fWmj+74525v1AqZHSSkcu81pTcj97h5XulqUvQbk4RiYvto0AfvH1PSLlah51AvcO7g+46a+vHuT8PR7NzWYJRFBasgH/XO/bhXgkl8kzsnHRU1hTnElW7UCWF1e65Gwup6zO78f4zRXyCsaO08MW1pnuqQZWE+LMLRBSVEcUgMToLlz63nyI4PdJhN/g3rmF7sXajaW8XVKEqYfV5rKl3dnfbR/009rRPwbeAJGVb/y4+Z9K6TbXH2xKEHqlGyDbCyX7/NuSKKuiUykQfnyrax0i1td9qmX5tyYegzthc3anTLiMovrgt1xYquBIDfsZ96TN3Hokd7jSgC9/nOp7AnhRa2RPFBzQdVPOEwBgl2JFMa4Aj1gOOkMo44DmR8JKvVEPLyDhRtZOrvkGJ/5qJyHlSk3AdNcuuX4nm04Jav2KoIQAVLqp1SVCjajV3bIIdVkyjWC3vbhVg96Mba2kpeuVlUXfPpTViIxoFlWUKmF/42MilKxR6umrj1mQrkAJn1GqUOiEWB5d5Da+chFqx+pXhr/qzxYjvRM8HeJi4LWKIyG0xAqB8INePNagyfQne1E7sIcDAQdkWkSs4Xh6lvBky3xtjMmPnKoe2B7yti4HiKmTRZV9vww7rn803bwcbAxPySYxK6ud+CwSXF5uH9l3965KQTowT76a4g== 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)(36906005)(55016002)(8936002)(508600001)(316002)(26005)(8676002)(2906002)(1076003)(356005)(186003)(54906003)(7636003)(2616005)(36756003)(336012)(426003)(36860700001)(70206006)(82310400003)(7696005)(6916009)(6286002)(47076005)(6666004)(70586007)(4326008)(86362001)(5660300002)(16526019)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2021 14:56:32.5572 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 28a42388-769b-4993-0860-08d984227df5 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: CO1NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3750 Subject: [dpdk-dev] [PATCH v4 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 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 polling two share groups: core group queue 0 0 0 1 0 1 2 0 2 3 0 3 4 1 0 5 1 1 6 1 2 7 1 3 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. 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 aggerate shared rxq group v4: - spelling fixes - remove shared-rxq support for all forwarding engines - add dedicate shared-rxq forwarding engine Xueming Li (6): ethdev: introduce shared Rx queue ethdev: new API to aggregate shared Rx queue group 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/testpmd_app_ug/run_app.rst | 8 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +- lib/ethdev/ethdev_driver.h | 23 ++- lib/ethdev/rte_ethdev.c | 23 +++ lib/ethdev/rte_ethdev.h | 23 +++ lib/ethdev/version.map | 3 + 16 files changed, 398 insertions(+), 4 deletions(-) create mode 100644 app/test-pmd/shared_rxq_fwd.c -- 2.33.0