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 2D21BA034F; Sat, 16 Oct 2021 10:43:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ED95940141; Sat, 16 Oct 2021 10:43:09 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2076.outbound.protection.outlook.com [40.107.96.76]) by mails.dpdk.org (Postfix) with ESMTP id F18F84003F for ; Sat, 16 Oct 2021 10:43:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ADPxBocXRki3zc5W9diiNbt41muJsIEd6s1QAbnu0voE5kik5d5+Y2Qr04YLY24TfVDlQqZ8tHTRltSAQX2Jn5U7O9u2Nnxh8pOrolMJwgIeLizNGGt/+nxEzyFBlwjnllu26vX8YwOBOv29Khhok0A3VZ6SoABQ2M2LLJ96u2GT802hUlaMafVGTJjY6te1oXsjKRJCIEumH4uedVNWCfvITpgI+kpSGBhdq81mkU7i28O6561WVI838qCkjise7Eg7oz2DUHxUM9kcImbDrm5XLtMDgev8qPD+GkOY6hx8u2fEu5EK4T09Sp/PwIc6kqE4qQefbGjdqqgnOcxoUQ== 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=L1TEKnDQeAbqk91UYgl5sPQHdBb4euZmfou+9yX/Hes=; b=DD/SBvxZFz6ZCFlOOZh/nPxyy4/qe0BSqfuUZvfrp9/hneDiElqbI2omQsOVlxrhvpQb6woCiqmi8bpX1e7TOA0uvylzY2JmyDgpzFP/484Z6ed77rsfxxi0ZPCXicba0JANaOunSGYLczaUvOqesR0VYlO2bL6AEAE/DLBKTvf9FrwVNVAzkMGO9zuAdARRzvGnmCkrSpdPw12T2vw/mfFgHaHPHfEBOCkvsqWwxQzVLu72VyQEGeLjIBzH/ZDQD9W/Qqt9IvLPlGuPNp0106en7qF+8s2y1Bkjt5tbK2IOIh8q3orJypMNSXC9EiotKcDtuFh+D30Lz1YYd+0epg== 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=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=L1TEKnDQeAbqk91UYgl5sPQHdBb4euZmfou+9yX/Hes=; b=LTJwF9l9yYfHZqINolBOhcTmGdkD+O7Fn0NA5hIbQ1j5vGe/8NB6Ps6essy8w9Sj1J/eQwmKzlPMnpBoKeIjGOlsI5zmgDKURq+IPViQaiV3nnaKVW4CQm20LjdoXuPTPQB/XndD+55Ma0J3dFNQbdyHRcNNCDiWJBmwvqHSeU9/KgO2YcIuNvm4yk4KXC7CgN56rxUz2d4ZjQ3eEEEhaXbvYyU38lOJGjAFUHQzki11SfH+EF7lvmXpk19Sts3izmM8SZamtqMKlFDybcGDklQp++7V0J5s32aSaJsOGi2lodGLxMt2wnVzEJxnhfSuMH0w1I+HZ2Pg+W2v2SAxFQ== Received: from MW4P221CA0025.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::30) by MN2PR12MB4302.namprd12.prod.outlook.com (2603:10b6:208:1de::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Sat, 16 Oct 2021 08:43:04 +0000 Received: from CO1NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8b:cafe::a5) by MW4P221CA0025.outlook.office365.com (2603:10b6:303:8b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Sat, 16 Oct 2021 08:43:04 +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 CO1NAM11FT046.mail.protection.outlook.com (10.13.174.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sat, 16 Oct 2021 08:43:02 +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; Sat, 16 Oct 2021 08:42:59 +0000 From: Xueming Li To: CC: , Jerin Jacob , Ferruh Yigit , Andrew Rybchenko , Viacheslav Ovsiienko , Thomas Monjalon , Lior Margalit , "Ananyev Konstantin" Date: Sat, 16 Oct 2021 16:42:32 +0800 Message-ID: <20211016084237.1808161-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: d11ca91f-769c-45f0-48b2-08d99080f740 X-MS-TrafficTypeDiagnostic: MN2PR12MB4302: 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: zkyxW2p1pXaDOy+f7QFJYtYGpcWGsAK8t0vrUnHqjZrYNoHIBv6smlMbJIBXG9F0YiuuhBwkmc/P3VWhVE73lKRYbFxl6wIn8J+Stp1qJhA75Gh9MphH7mmOCGXfJI5kDeRfEtoPZaUTY+ShHFisEBvwPZdKIYwgxQJJYlhUaggKll4xsdI2bxC6RqqemVORE2htdT/7r6TylV+8JTeVBPPpvePlUCjc+WAoGJ9noNNuceDmQkW8y1+O8g09/kzQ3lNCh2XaG3cuudcl30jyoW7yMaf2vWHluh5FleKXghVEuSciwlaE/wGj5SFYxSyozaqDwWZx/cBmzlc3s+xy7oQM7L7vRatbkmmPl83XUqYAAI9mMmI3uyfnXjNsd/2oRkpD6A4Mw1zPh5gw+zH7gXxgpxDZvnEt/lRBcFhhNZpz2KqZ8UnlmKnxqS/s+KUOaZMOGuRVRyRvY7mcBndFSMu8SuY2PSph2Hh9pOGAxPf9vjeRPKWuqJMF4GrB9ZniVRB09g4OCIt5rEywaheICFVMpW2nCCzl66xoQU4uHKZpNXd/IRC4ZpTqQvGtSQ2qRA1WegHNtB1SDsFWIJszeCrQUOv4BKW1eac9MolQjScVuH5K1ye/rfuuRuXHYzdRPx0aMa3T8HwBikt7aVtdWzoEbUdJNZt/csLZ5/QDDfOOARd8vOBUpclLm6H2UabG5U4z3mPG27k8TeTOpksPaA== 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)(186003)(356005)(16526019)(6286002)(6666004)(36756003)(26005)(55016002)(5660300002)(8936002)(2906002)(7636003)(8676002)(70206006)(70586007)(4326008)(508600001)(316002)(336012)(2616005)(1076003)(36860700001)(82310400003)(86362001)(47076005)(54906003)(6916009)(426003)(83380400001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2021 08:43:02.6015 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d11ca91f-769c-45f0-48b2-08d99080f740 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: CO1NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4302 Subject: [dpdk-dev] [PATCH v7 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 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 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 | 106 ++++++++++++- 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 | 13 ++ doc/guides/nics/features/default.ini | 1 + .../prog_guide/switch_representation.rst | 10 ++ 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 | 8 + lib/ethdev/rte_ethdev.h | 21 +++ 15 files changed, 365 insertions(+), 6 deletions(-) create mode 100644 app/test-pmd/shared_rxq_fwd.c -- 2.33.0