From patchwork Fri Feb 3 13:33:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiawei Wang X-Patchwork-Id: 123036 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D548C41BBD; Fri, 3 Feb 2023 14:34:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9DCD4067B; Fri, 3 Feb 2023 14:34:10 +0100 (CET) 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 E903D4021E for ; Fri, 3 Feb 2023 14:34:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m74nJ/uBx+ZSmy77QYM6k7pS+Mu/8CesOMstWvRHn/4SZYEPuoeVMxWVy03vqSSCKHRKcD/4nHxk80hUxpSNoAukpi75C77plY1VAo6fmGbY99in0AYImBiLIlbg94zZ7cxRhxvbpRAATii9Epgbla0g2cUhJt1cfS/01DJeM+gvp1U8zPU5iJQ9GsSlxTnL9x0zwcHpPwyjIacJsjnbKikgFjdaeboDBQwDHwURPcU3RVURVrfDSQKXJIdBBSkYiEQssjYXP1V92OkqpQhH+wdsEKnT1IsNqX0wJL8zqIzeQ5/lIqi7RGV8JNyFehnvv1/5KYTGwBfHoTTBrU4s9w== 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=KenRrASuO76onBosZM6uPL451p7l7Dt1u7xaw2m/dXg=; b=etLJi/LwhcfJoL205dboDbvmIeaX2utcjm/cIQ2TYWiVcYiRvdl6TvKT24svVs7YuAEzCmsqqTI7WqZCQbabpqnhBv9p8QUwRmwX9uBYFTLGOij9dMvjAdto/yHnOgzl+2/wPwvCVRca8+tDZZ4RUbTPaFzq8qjGS4laltqjU8IiNvaqc7GDEf0AYYKINplsgmQ60LWQEGNCctkoBHko/vtRrfb8TYG3tP7ev08Zi8+ktiI2Wigy7Trd5VJ8jfs0xdAeGEoSYaomiZ7z2GTW8eTdHlD9cJ3na9Jn9zYOmjBq094W+tHs7hHXHcOUS/vHQcZQzjn0qlNUPetncatGmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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=KenRrASuO76onBosZM6uPL451p7l7Dt1u7xaw2m/dXg=; b=c+6iEL97ghZmM9mF3M2e564R3O6KHmN62KESyK92FM0QBTKAhoeydqOBouF1cvMk3IEpkY856rc3tXF/AyDGnI3Y1AhfCSjWqbS6BaVdtJT8qG7BU+j8Lbujqo+fY9bTLDR1HC0fUqTD7OFFh1GoH71JrDjW1ErW0MoTOmnKcvarz+/qt7kiFsHyGhKY2v81lXyWxHxn4KzhhfI2xU+d9lfvFD0tIdO1lNvpEAQn3R2ElhNlMKEvCV0FvL/hPXoLA8cT6iF7fbhDRsXNKWiqOJ+4HlWUX+e5HyPEM7iNae1PIgp/Mc/fAbWQwNFrzGESAaruetGRFCf6lj/xxHKAfg== Received: from DS7PR03CA0356.namprd03.prod.outlook.com (2603:10b6:8:55::22) by PH8PR12MB7109.namprd12.prod.outlook.com (2603:10b6:510:22f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31; Fri, 3 Feb 2023 13:34:06 +0000 Received: from DM6NAM11FT082.eop-nam11.prod.protection.outlook.com (2603:10b6:8:55:cafe::4f) by DS7PR03CA0356.outlook.office365.com (2603:10b6:8:55::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31 via Frontend Transport; Fri, 3 Feb 2023 13:34:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT082.mail.protection.outlook.com (10.13.173.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.28 via Frontend Transport; Fri, 3 Feb 2023 13:34:05 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Fri, 3 Feb 2023 05:33: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; Fri, 3 Feb 2023 05:33:53 -0800 From: Jiawei Wang To: , , , CC: , Subject: [PATCH v4 0/2] add new PHY affinity in the flow item and Tx queue API Date: Fri, 3 Feb 2023 15:33:37 +0200 Message-ID: <20230203133339.30271-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 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: DM6NAM11FT082:EE_|PH8PR12MB7109:EE_ X-MS-Office365-Filtering-Correlation-Id: 09ea287a-bd94-49a2-3d02-08db05eb5225 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: l2f8wkphuZjWuHp5wdZUG9YdXRn2OM3/jAX4r53f1ZTimr977JUTezB6/4mstY19E0wSB0S52Ig3JtxyOjUGp5SSq91P8rl8HVQ48QuhBDUnkGEpswHM3jAXW9204JlxOh9tXVrcQKAVS7tjP+FhgfFrVnIeofcHmmpvTGJ2bCrbZinVXggliYYnrF01N+TCqZjc0aszT8yJY8PGqPINOGRoS9JGh/0QdEys1PgXxO4uMq4I6Wrl1k1ftYpslqNZaqQUNxfb3+9h1NqHhCVs/nf5yOB6VNnbbBUcdI8NnDUs/pliUcB/BUfu5YasGui2Yx8/wWqGZAXUOANXukPm3AJ6OrFvqo9am8edylmWbcZ2imkA2BfRxB2T7n7jIdU2PC7NXkODCnHK9BYVJG36neRQrL+yVPix0wZdzNATqIyLkRNWS91J5bHPrmzPqyf/jerwE4sv/KFvHdeDqxj57qT5Elr37pWY094aNEKxPSUiAZIngD/7osI2pQJ/8uTn0OHINs/7FYCxcjvpAhuR+UNr3PnHkO0yD66WKWOzbWMDtNkMuemVCAk7P90FcVlnN5RW3TfOXebQNdvS9Mbo0wGBvPVHz7xTVW4IWI/Ia4TdDyU5OFN/2jwnEgVyLR5fxFIzqpsqN76e/0KNnzOg+t+qd+pR7h0HkcfnqugjSjRLMECkRAe6GAcsXAE6b33AP0sAZOB0F7BdVTnD1P7uN/kjEFjKtP05kdwgezqNmJRZVqZWqLPLIh9yP9bCA25coorLoJM8WmPVSPyuEH//X8KOujzhfNweqjtkwGlRNMs= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199018)(46966006)(40470700004)(36840700001)(2906002)(5660300002)(47076005)(40480700001)(55016003)(83380400001)(336012)(426003)(7636003)(356005)(86362001)(36860700001)(82740400003)(4326008)(8676002)(316002)(110136005)(54906003)(41300700001)(8936002)(2616005)(70206006)(70586007)(40460700003)(36756003)(26005)(1076003)(478600001)(107886003)(6666004)(6286002)(7696005)(186003)(16526019)(966005)(82310400005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 13:34:05.5120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09ea287a-bd94-49a2-3d02-08db05eb5225 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT082.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7109 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 physical ports are connected to a single DPDK port, (example: kernel bonding, DPDK bonding, failsafe, etc.), we want to know which physical port is used for Rx and Tx. This patch maps a DPDK Tx queue with a physical port, by adding tx_phy_affinity setting in Tx queue. The affinity number is the physical port ID where packets will be sent. Value 0 means no affinity and traffic could be routed to any connected physical ports, this is the default current behavior. The number of physical ports is reported with rte_eth_dev_info_get(). This patch allows to map a Rx queue with a physical port by using a flow rule. The new item is called RTE_FLOW_ITEM_TYPE_PHY_AFFINITY. While uses the phy affinity as a matching item in the flow rule, and sets the same phy_affinity value on the Tx queue, then the packet can be sent from the same physical port as the receiving one. The physical affinity numbering starts from 1, then trying to match on phy_affinity 0 will result in an error. RFC: http://patches.dpdk.org/project/dpdk/cover/20221221102934.13822-1-jiaweiw@nvidia.com/ 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 PHY affinity field in Tx queue API ethdev: add PHY affinity match item app/test-pmd/cmdline.c | 100 ++++++++++++++++++++ app/test-pmd/cmdline_flow.c | 28 ++++++ app/test-pmd/config.c | 1 + devtools/libabigail.abignore | 5 + doc/guides/prog_guide/rte_flow.rst | 8 ++ doc/guides/rel_notes/release_23_03.rst | 5 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 17 ++++ lib/ethdev/rte_ethdev.h | 10 ++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 35 +++++++ 10 files changed, 210 insertions(+)