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 DF031A0C45; Wed, 20 Oct 2021 09:54:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C538741195; Wed, 20 Oct 2021 09:54:00 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by mails.dpdk.org (Postfix) with ESMTP id 0E59B40687 for ; Wed, 20 Oct 2021 09:54:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RSja2kmjTUK+JZwqhI+D29oLen+kBzE+G/xcGhY9lv2Uzlr2vbQsGOQnLuuKTt67YSyVTz7/QasykKDJWlyE5msG2FSji1sPhldWO38EjbpWYqpTZZfMVsVYOPFmSW+prTIhqrq6LIGMXzCdxvu8bJfGc1Iw9fQRDosdM4YdHKdcFpHFc+B5iFhcClsGcM/GuRhDpTGmMjwwN0A3Ff2/L4urv2kBbsmYamyf+83jFBeOAeJBiqj/VeocrvAUwlKoZJnLDeXIFeE3OoKDnvZrZROLduFXLWRJIGrTyAsugin3NCJewhYu1X/MjOEWARC9PtdVZuQUba8Hv2MXXKy9vQ== 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=OoWRtoDjea70ihVTiWWEeyjRvMzn/XdcsTySfqqAn0k=; b=AxzBSPtrRTSVx9pIYi5nW/jCKWsxRTebd3JfDYJWOG1R7DfgvfCzz8zr3SmFHO55uG7XjZFdz0rLR7aqloAU0TyOqbo0ZXQl3QXZ4gZzupnXg5dURblH+6qEgqwnm0Qj44vTx4kha419jyh8X8gFfbRGZ3nqG8VFEJbgdJdD8IgnamrMnOQ/kOgUVoZw+Qat7xH/4F5TfVpOQBBWxlQoHkVhILs2jvLhGPvydmbR0k1R7k3Zvxke4BRyIbdSCJscfCThv3T+AK+g6i6NtX/IVfRtXoIx5IwO3kpDLMAG+7qj647U2hJSNCWi/pop4Aqqw0NxKFwJ0+sEokTxOgowrA== 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=OoWRtoDjea70ihVTiWWEeyjRvMzn/XdcsTySfqqAn0k=; b=TU0DcvPmUgP7BjcVu8AolZ1ZNPYIxK4Q3QZ8Dr+V+yrUeKcHcXF6CfOQ7wHfSHVW++ycR68fAuZG2muezYyHx/MQ7P8URFadMLjdgoF/XUvVhbEKW1YKzRIA1T8TPgVUVzTYqn38Uo8jd2jao8IbSRiQMrjdSMf0FNnXuRRPcr7JgUyWdNTH4XxFlBGAOb+XtcyqEzKnAtn5VaULwdzP/4cKyfNPWGax1iHejXVAAiSqH3iYmLAQZLGMEmvxJed5CQXrNrGFBnltkfl1O8f9TVgbhv+9XT2StgFFZAbgI5uMS/uazDkw6gDR1o2KUh/VRcjDZOQh6PLSVjoXGZ5Itg== Received: from DM6PR06CA0087.namprd06.prod.outlook.com (2603:10b6:5:336::20) by MWHPR1201MB0221.namprd12.prod.outlook.com (2603:10b6:301:56::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Wed, 20 Oct 2021 07:53:58 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::91) by DM6PR06CA0087.outlook.office365.com (2603:10b6:5:336::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18 via Frontend Transport; Wed, 20 Oct 2021 07:53:58 +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 DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Wed, 20 Oct 2021 07:53:57 +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; Wed, 20 Oct 2021 07:53:48 +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: Wed, 20 Oct 2021 15:53:12 +0800 Message-ID: <20211020075319.2397551-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: 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: afcd4b9f-6a04-4c67-94ef-08d9939ec58d X-MS-TrafficTypeDiagnostic: MWHPR1201MB0221: 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: xjNqpisdaMcSdNEHBYggArUYCIkn/+ygMTAL5xhSTXIepS2cNDDJuIuxWHGrnGTOQdxWPjb3ZzltAll6qisN5v2cQaL5m2TUCw3d9rhTvbVXnwIJqFhNcXe8BOh92lMLS0OUi5bzXEkRqATgzzKgR/GodUDeYbR0Xj5ZpsJapWh2sKRdIpxyZoSF9jT0qa91VMcEAB94UUhTRvA/0v+AVGVz8Jg7B/MYxrhlDuO6mcH9A56dCeE+z0vo3q/SoPpyIla1SI4oBxSFAeq0NzYB0qF5qDsWdlZXRMNT400g040CLJ83uyHJ8jWM2qIBmpfipH8W9hepfXsuhed8NgZpwzPzeiCU/B7Yt0/cMM9SWA2DREgyUPPCgDFieL55L2yrjfFQyFnOREOVmW/oISc1mdMz1Qmf4RNfHV27eetMiMlpR0ELmoF1zD6K2hY7HtcbwFE0Ti4VqUzneHAbTf+Y6Ge3rAUAPRm7tyj5/EnhJk4NUwragFHHItahptsdQPDvdQA1GdnYbDyX/tiCnr2KOatQ61IHUxYifHyqeG2MP9+uJSX1clh0Yzjau1+UL8i9H14un1WaYQH45/0nJVK/S2ftYBaEzkaW87rMY++fb4b+AmWUKxnTcfVj9LFc+y5Rv9GRIl8a9qnFJQvO8OOu9rJ8HEm9OrajnUg8zG90CnFrrQvEyulRwuvFx6eWXLc1cJ0r4gDmKPbIfVaInjeuNw== 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)(36860700001)(2906002)(508600001)(8676002)(70206006)(336012)(4326008)(110136005)(54906003)(8936002)(6666004)(82310400003)(36756003)(1076003)(356005)(26005)(55016002)(5660300002)(83380400001)(426003)(186003)(2616005)(47076005)(70586007)(16526019)(7696005)(7636003)(86362001)(316002)(6286002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2021 07:53:57.3004 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afcd4b9f-6a04-4c67-94ef-08d9939ec58d 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: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0221 Subject: [dpdk-dev] [PATCH v11 0/7] 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 v11: - remove macro from device capability name list Xueming Li (7): ethdev: introduce shared Rx queue 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/nics/features.rst | 13 ++ doc/guides/nics/features/default.ini | 1 + .../prog_guide/switch_representation.rst | 11 ++ doc/guides/rel_notes/release_21_11.rst | 6 + doc/guides/testpmd_app_ug/run_app.rst | 8 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +- lib/ethdev/rte_ethdev.c | 33 ++++ lib/ethdev/rte_ethdev.h | 38 +++++ lib/ethdev/version.map | 3 + 16 files changed, 446 insertions(+), 6 deletions(-) create mode 100644 app/test-pmd/shared_rxq_fwd.c -- 2.33.0