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 A4629426D6; Sat, 7 Oct 2023 03:35:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2B2CC4064C; Sat, 7 Oct 2023 03:35:09 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2118.outbound.protection.outlook.com [40.107.94.118]) by mails.dpdk.org (Postfix) with ESMTP id 49A6A402E7 for ; Sat, 7 Oct 2023 03:35:06 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QdD4Lcat6guB5UUgVjIPTK8JN5eLYLP4QfszQF07PKxDpr6DQTfVl7x49lII1zHobltdziBeBSlIe/DShdmO5EdA9HyfhKqaYSVLbu28OXv6ASuo6r0h9K2xPuGrb8n6dHzKIzp/OSJxB+9KrgRewE7Dg3llUDBy+ymejKrjKPO/jb+Hn6cysWE61Ptnb9DqWnAfyWo+UNTKzV6Ju3hoUs/RCcLn+uzB14N5XW3IGcTBySRR/TpII01L2GYepTxjHkXrpkNWrgj8P5jXRqz02CGQfxqGKD8TrbhVqUjXl6E/UMkBZaX72jcAd8fMxSXv8EvzafKtrNFqHJOa+178Hg== 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=IfqR6DGSQd7qEcvBIdqE3D4xBmxRaU6y9JGuHqBER6U=; b=EcUO07Pdt2TPY0gPzlQMmT+V8jNNMum3E8hByt2lK/F36NHiDTCN60AwXJef/Q5MPlN9aIAOD9x3fMq1fxakyuIjUSzUatD7wmlvWkhEjuTLTaw/MtZumELBoCRUOUo0Xh39hokO9rx1i8GT9a0JxFc9X5vuitC64c+xsA6BJpaaVK86TJ3Av+SOYh6u7vlUgbEs7wOVuPP69Bh0eBYEDqIxqFQAuPitt2fyq8/ET4imXZRJeBrMjhMfL9yMoxFabJKMPqpukbTaBOEXFkjVzYt5cot3nHB4YCJySC2mW/3h/cWwQGKlxeo2eobwtW8I++3xMvBzHgr+St+0rd8wIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IfqR6DGSQd7qEcvBIdqE3D4xBmxRaU6y9JGuHqBER6U=; b=QF6OQL+YyvvwbQ4YJGuzNxge5POMaVNvzpt/p1jrNFDLE8lT5Xaaj8nTJ89ShGdqQtL5Lb0b7+azLuyja0vNDeed05JIxBJcIYT/DrJAMspwFJh5bwkUJgoBjYum/tdIPnNdjH99eKXKJhbXgZS7eSVEMGCEqapRdLNRB6KEAlI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BY3PR13MB4913.namprd13.prod.outlook.com (2603:10b6:a03:364::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Sat, 7 Oct 2023 01:35:04 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Sat, 7 Oct 2023 01:35:04 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v2 2/8] ethdev: add API to get hardware creation of bonding port Date: Sat, 7 Oct 2023 09:34:34 +0800 Message-Id: <20231007013440.1309422-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231007013440.1309422-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> <20231007013440.1309422-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH8PR20CA0008.namprd20.prod.outlook.com (2603:10b6:510:23c::18) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY3PR13MB4913:EE_ X-MS-Office365-Filtering-Correlation-Id: 898f7123-71ea-4861-b1be-08dbc6d5a17d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HkwD3qTKaPkRnaJ84gNkZhn7eRcbfos2rlbkow1rWlq4iiU/tRO6c413u1ypQo/FYiJOT7Nagn6q1lbrFAOXKUUV9le54YPSv9Jr6x4jpSWs2iAki7BFxmrHyfU30FUkNGy6hzLJz8nszmzaXoGCEIkMM45kbCZpDVHODvcv6Q5W78gHs164XeAzCBtSbLC20ClVIBRrE/JsdkH0NlZzc6tale8oNNQO1vazlpNz+Wu8XM0ySE+Spk081KyAr/1Ntpi+ybOdgs17rsKugaws0BfSGoAD3k+SDS/hiPJcqaNEnvQW9Nw2dwYzh2eiZld3NCBHh2LXIvIDSW0LNd92GTY3lawZSxP3XQy2JuOsyO93cQPO5CH7fvrfEk6M4Z9UHHv4UH8pyrPe9FW9i9lRBC1W6ncOnNZcleKvC0695QxDCA9NypQYK5tCsIsclexy8aZ1n3hcE6rB9MniFkaSLNqU1uFWL4+gwdYue8Xa9HGmvNFQ8iMoe8rdcSHm40Kikura+Pyli04gb089V4Bpfg9qspiDdMG7h3ZaJ9F5pD0ly0LxTZCtI9cUzOi5U7OrfADabdF4pJrOdXlYRIMuInZOgbT0bShM8JJEZA2nOmcSRQl02TMc0xIda55+1I1AOgYgabfDmmI29ZcKROzqYECIhUxp+XK6FPYSud0kAtk= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(396003)(366004)(376002)(346002)(39830400003)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(2906002)(44832011)(8676002)(8936002)(5660300002)(4326008)(54906003)(41300700001)(66946007)(316002)(6916009)(2616005)(66556008)(66476007)(6666004)(26005)(36756003)(52116002)(107886003)(1076003)(6512007)(6506007)(86362001)(38350700002)(478600001)(38100700002)(83380400001)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+t1l9NK0WV8a0SDjdF+1Ct0BbxudML8iFPnWHkpoa6e+9bwegkuGsPbkWdeF?= =?us-ascii?Q?cexvYtzsMx6yCBJ98oLCUl1Qsxha+yqg2N9G81cSJWk0yGzrLmx1WRqAb/Op?= =?us-ascii?Q?f//o0wSCy9dpnqkTmpzgeDrDcxhj1e+sphq6Ti+oBEMlNAyqhkzHeCCf718A?= =?us-ascii?Q?1ZzNQFyxWYHiKWEeysAqdBMh9qgU7a3Jc9AsA+o3B9vmHncIVE2xffvVCBz2?= =?us-ascii?Q?L+Dbx4HGv5XX9YLaUWMezU0nmUKg16vb8Vi7S6ZzldeZaI5JDZJ1Ok465GQZ?= =?us-ascii?Q?apAf1v75F6lmlABHAgYirHTLISlKF5TuD9aVeXDKF5E0pxYlDS24TCrTWYbH?= =?us-ascii?Q?QH2wyQl9C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= =?us-ascii?Q?8GpZpMBjibwAkboW6ShE+yKmUK783BZAnJ1xjFg5bXmBoGsKoupvFI+mdBdb?= =?us-ascii?Q?SRyWIXJvYgWmGsBGH4n8erHSASd5YZW0CAUI9He8T6BRyThM8YXJqvcgklb0?= =?us-ascii?Q?aHqdV+KYMoyNq+3RJ4rXcH09nCyUjBxElunpRgvCa6bSSZZEq3PuSobmMRiH?= =?us-ascii?Q?woJx0QQWixKo6ZEx4eyDOQPLT72PYvUkM+5j/r4Phrq9aKyOJs7IqixdkyZ6?= =?us-ascii?Q?MaMcu5FR/KbE6aji3fXsHP3MJQVFyTt6nyp/aQp7yeh7K9R6SY5CXo9Xha/p?= =?us-ascii?Q?NvMJWB566mh3FrDAYJ7PB/qSpxkJaCvL2241hJngIZeCyC5A3XP69iBkVgfw?= =?us-ascii?Q?oA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 898f7123-71ea-4861-b1be-08dbc6d5a17d X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 01:35:04.5815 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hfuEiPDVEdAxTt0EFobAud2Eh5CROH3yaDtQH4x9Vid0DA4ZBSzEht6qgMISdvhFdpj3n+Et6PyjhEuVM8qzL8qA5BeHEu+pjnoSdj+2/to= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4913 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 From: Long Wu After bonding port notification, member port hardware may create the bonding port. We want to get the result of creatition, so we add this API to do the getting action. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He --- drivers/net/bonding/rte_eth_bond.h | 15 ++++++++++++++ drivers/net/bonding/rte_eth_bond_api.c | 28 ++++++++++++++++++++++++++ drivers/net/bonding/version.map | 1 + lib/ethdev/ethdev_driver.h | 20 ++++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 737beca446..6be5e46deb 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -398,6 +398,21 @@ __rte_experimental int rte_eth_bond_notify_members(uint16_t bonding_port_id); +/** + * Get the status of specified bonding port created by member port hardware. + * + * @param bonding_port_id + * Port ID of bonding device. + * @param member_port_id + * Port ID of member device. + * + * @return + * 0 on success, negative value otherwise. + */ +__rte_experimental +int +rte_eth_bond_hw_create_get(uint16_t bonding_port_id, uint16_t member_port_id); + #ifdef __cplusplus } #endif diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 48c1d050fd..0be580b19b 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -1171,3 +1171,31 @@ rte_eth_bond_notify_members(uint16_t bonding_port_id) return 0; } + +int +rte_eth_bond_hw_create_get(uint16_t bonding_port_id, uint16_t member_port_id) +{ + uint32_t i; + struct rte_eth_dev *bonding_dev; + struct rte_eth_dev *member_dev; + struct bond_dev_private *internals; + + if (valid_bonding_port_id(bonding_port_id) != 0) + return -EINVAL; + + bonding_dev = &rte_eth_devices[bonding_port_id]; + internals = bonding_dev->data->dev_private; + for (i = 0; i < internals->member_count; i++) { + if (internals->members[i].port_id == member_port_id) + break; + } + + if (i == internals->member_count) + return -EINVAL; + + member_dev = &rte_eth_devices[member_port_id]; + if (*member_dev->dev_ops->bond_hw_create_get == NULL) + return -ENOTSUP; + + return member_dev->dev_ops->bond_hw_create_get(member_dev, bonding_dev); +} diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 3bd5e8ad11..3cfff51269 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -32,6 +32,7 @@ EXPERIMENTAL { global: rte_eth_bond_8023ad_member_info; rte_eth_bond_active_members_get; + rte_eth_bond_hw_create_get; rte_eth_bond_member_add; rte_eth_bond_member_remove; rte_eth_bond_members_get; diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index f626f971e5..18ff5db969 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -1231,6 +1231,21 @@ typedef int (*eth_map_aggr_tx_affinity_t)(struct rte_eth_dev *dev, uint16_t tx_q typedef int (*eth_bond_notify_member)(struct rte_eth_dev *dev, struct rte_eth_dev *bonding_dev); +/** + * @internal + * Get the status of specified bonding port created by member port hardware. + * + * @param dev + * Member port (ethdev) handle. + * @param bonding_dev + * Bonding port (ethdev) handle. + * + * @return + * Negative on error, 0 on success. + */ +typedef int (*eth_bond_hw_create_get)(struct rte_eth_dev *dev, + struct rte_eth_dev *bonding_dev); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -1473,6 +1488,11 @@ struct eth_dev_ops { /** Notify the member port of bonding port information */ eth_bond_notify_member bond_notify_member; + /** + * Get the status of whether bonding port is successfully created by + * the member port hardware. + */ + eth_bond_hw_create_get bond_hw_create_get; }; /** -- 2.39.1