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 869A341C96; Tue, 14 Feb 2023 16:49:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EFDE410EF; Tue, 14 Feb 2023 16:49:10 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2043.outbound.protection.outlook.com [40.107.223.43]) by mails.dpdk.org (Postfix) with ESMTP id AA347410D1 for ; Tue, 14 Feb 2023 16:49:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nBfYxyOg0mOecoIisQrRJdfzHi4/c9lWCjubFUR32m2j6Dq9WgsrcBxlaBfQhABy0x41MHyv8zSpeW9dligQpU7ogQcaxZyY7Of7CNL+sk8qcfkaniW78beUdVzQc10PH7Nkry+S2GbfFlshk3FFGyuP9hhYWAGXf0KCxbW58CxwOGp3T5rgrEUHtZkt8I7gjlwC1x1d+M+WRWNs+ArPiO0yDJFNEtDFfagDxg5MwFufhnLm4F9h2d8FtRcGil/VDzMEyk9vVU8q8v+8vstCYhiEWydEv67jE5xJTcrsqtLG8D4cBTlj1EjN0zlP89UMKrn1I5htM0MPrSrncc+IvQ== 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=eNnskK9i/c+r8FLZV9qNy9kCrSOosveBSR2GtTeiXT4=; b=E2YNnkEM1sUzeumqgxnL2SWdvWzTym2htjht2QNN6GHIfpeUgvE52jSlQhkvsBstANvxXHkcKYI77w4Tvz4JXROvmLVrtEgs1X3HkWMjY//qiRLt6Uoxl/Ce+7zI/tqzAPT2dmdryhYJwFZ56ak+CHFc4+hc7+wueAaH2OkP5EBG7N9eVaBqCs0TWxHj3MDi79bV6mC8pRzkyqvIC/Or/ketFPEPmKG3dbk/9KoLrx+OuT0nbtaKBm1TDkKW95nD/2kE9i6L8W+jN3KkBFfjxICE47MxsgjW30OY7FP5tDxO69ZDkIwF/xyC7gDL3Lg8iBreeQCb00CSSyPecQHBCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=eNnskK9i/c+r8FLZV9qNy9kCrSOosveBSR2GtTeiXT4=; b=iJ+5/7ixJNpEmqijtrkUsfm9GmNGOXqblLhHXeepahsAnSMGQCTeBnMzTXMvfs3zIZ7xI6BbNPi8uEnUCCbbIbhGCDc+rTnFkKR028uufO3NlVVnck/y0Vr65mFfpSRnWm8glQjhrt33nyQMnCdks/b24b0MEg7LfLPgMf/0voE+RkIzZd79IgrH9Ir2a6dYJKDDnkqpbyyaeuiDtoFStweE7ECSiJp6ivRSgsCMtzEktZQ+FVRQzgoMINYZW65j7jICW6fldaugpMKpuGRVon6lbuLyL2OOBu1nWBLOzudGN0Nvc1QHlpXXHkv5hC6JoSdaGcC1hN0z57/ToSxRCA== Received: from CY5P221CA0059.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:4::44) by PH7PR12MB5998.namprd12.prod.outlook.com (2603:10b6:510:1da::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.22; Tue, 14 Feb 2023 15:49:06 +0000 Received: from CY4PEPF0000C96F.namprd02.prod.outlook.com (2603:10b6:930:4:cafe::4) by CY5P221CA0059.outlook.office365.com (2603:10b6:930:4::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26 via Frontend Transport; Tue, 14 Feb 2023 15:49:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CY4PEPF0000C96F.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.9 via Frontend Transport; Tue, 14 Feb 2023 15:49:06 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 14 Feb 2023 07:48:55 -0800 Received: from nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 14 Feb 2023 07:48:53 -0800 From: Jiawei Wang To: , , , CC: , Subject: [PATCH v5 0/2] Added support for Tx queue mapping with an aggregated port Date: Tue, 14 Feb 2023 17:48:34 +0200 Message-ID: <20230214154836.9681-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20230203050717.46914-1-jiaweiw@nvidia.com> References: <20230203050717.46914-1-jiaweiw@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000C96F:EE_|PH7PR12MB5998:EE_ X-MS-Office365-Filtering-Correlation-Id: 8ff80453-0d76-4545-b700-08db0ea3012c X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D4SZBzRIlPrnW+luXzyximJTrx9Vo5mF+KVDRk10r3nF1BLSc9jY8NIfKPQdcvhJQHmO2Du9nbEEmRDqM6IZjnr+GTTxAng72HGoK3k6EyWgXFsmRU166TSBgJoiJpHA57sVnfjN7p/9JwNnUMg5xB21FHiJexFwODsEgv+7XpxPff3bnat8u3kwbioC76LX0/JB0hk5CpuRquI5kLkpBhdKqQfCr6tJ8h5cGfO4Cvf7ftL44t2evp/dl6Et+j0JynFQYjncJOmRSzzFSVIagaeA4b5OVTlVtnWTmJKnPeGg6nnHS60SbsL6KLAqDUasAIDtFMH+CeOxe0IPqZ+xqw9LI7pLTyNmalEpgTVd0gyNWb5RtLeCmLYWz78cUGmzTLuSVPr07JTVy70M3UPUkoCDCrkgONNYyIj7ibl1WX1Gir4F8gUhtA9y0WKhcl3KLWGZTSx5kDOQIPkuNGBN6az94NPKyYrHfBHnBM377LlmEwPhMPHEIU2XF15J6b52iulyEHEqlj7EaEMlWpRpdWKAToB7T3Ukd6O3kARAGOxNzmavFQKuqqpUErrX1l5Yel0yvbiYMbj5L1IIoRMf6Ugq+jmwmTzDVN993s14u8EV5AK1sHg4ED9wixsnY7dbuS5o/2tmMgc+qd26ZrCuNvkv44TwbabDPT8oFYTZbPOOys6kCJNbroaQmK6zesPi4pTzkrttDqVPoLdTrEx19CEgMdZDEZx4hUJWy4UmJWrxJHiQr+HQdx+rahocimbe X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(346002)(39860400002)(376002)(396003)(136003)(451199018)(40470700004)(36840700001)(46966006)(426003)(47076005)(83380400001)(40480700001)(7636003)(86362001)(55016003)(82310400005)(356005)(36860700001)(82740400003)(2906002)(40460700003)(110136005)(316002)(54906003)(70586007)(8936002)(5660300002)(8676002)(70206006)(4326008)(41300700001)(1076003)(16526019)(6286002)(186003)(336012)(26005)(2616005)(478600001)(966005)(7696005)(36756003)(107886003)(6666004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 15:49:06.3816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ff80453-0d76-4545-b700-08db0ea3012c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000C96F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5998 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 When multiple ports are aggregated into a single DPDK port, (example: Linux bonding, DPDK bonding, failsafe, etc.), we want to know which port is used for Rx and Tx. This patch introduces the new ethdev API rte_eth_dev_map_aggr_tx_affinity(), it's used to map a Tx queue with an aggregated port of the DPDK port (specified with port_id), The affinity is the number of the aggregated port. Value 0 means no affinity and traffic could be routed to any aggregated port, this is the default current behavior. The maximum number of affinity is given by rte_eth_dev_count_aggr_ports(). This patch allows to map a Rx queue with an aggregated port by using a flow rule. The new item is called RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY. While uses the aggregated affinity as a matching item in the flow rule, and sets the same affinity value by call rte_eth_dev_map_aggr_tx_affinity(), then the packet can be sent from the same port as the receiving one. The affinity numbering starts from 1, then trying to match on aggr_affinity 0 will result in an error. RFC: http://patches.dpdk.org/project/dpdk/cover/20221221102934.13822-1-jiaweiw@nvidia.com/ v5: * Adds rte_eth_dev_map_aggr_tx_affinity() to map a Tx queue to an aggregated port. * Adds rte_eth_dev_count_aggr_ports() to get the number of aggregated ports. * Updates the flow item RTE_FLOW_ITEM_TYPE_AGGR_AFFINITY. v4: * Rebase the latest code * Update new field description * Update release release note * Reword the commit log to make clear v3: * Update exception rule * Update the commit log * Add the description for PHY affinity and numbering definition * Add the number of physical ports into device info * Change the patch order v2: Update based on the comments Jiawei Wang (2): ethdev: introduce the Tx map API for aggregated ports ethdev: add Aggregated affinity match item app/test-pmd/cmdline.c | 96 +++++++++++++++++++++ app/test-pmd/cmdline_flow.c | 28 ++++++ doc/guides/prog_guide/rte_flow.rst | 9 ++ doc/guides/rel_notes/release_23_03.rst | 8 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 18 ++++ lib/ethdev/ethdev_driver.h | 39 +++++++++ lib/ethdev/ethdev_trace.h | 17 ++++ lib/ethdev/ethdev_trace_points.c | 6 ++ lib/ethdev/rte_ethdev.c | 49 +++++++++++ lib/ethdev/rte_ethdev.h | 46 ++++++++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 35 ++++++++ lib/ethdev/version.map | 2 + 13 files changed, 354 insertions(+) -- 2.18.1