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 218434378F; Tue, 26 Dec 2023 03:38:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35137402E8; Tue, 26 Dec 2023 03:38:14 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id BCDC0402DA for ; Tue, 26 Dec 2023 03:38:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JVwCcvNYimYZf2iIrD4oL8OstNLYgzBbNegc4btSWfQFLEEX8IqZt6UB/7O54YD1kg4p6TOmMffx0QgaJPTv6IQyEAUaNzY4ln0XsN5WFX7ddEYRLxKkvNm/jkKxzGZHnHz/L+cuBEXv7QEWThwi9x4lN1xHj1KVipiLcUrDDqEU7kfowl4os6tZrLj6uiinWiNbcPVU0GBrx6/bgHVMHtq1q4Wg2lgBOd9C6pVZlCQrG0vhsLttM7JKkbYVPQJzi2C+gjkN+FNk9D7Lp0DmTkuvOBDsRnxY0RQH89o/dtK0zBFIIdAG4C2hOrFQs6iYSd2fCeab2zOm2QOQKIoBgA== 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=Nf0Jzjuw2SZFvIbpeTfCghQvEOFea46iD2WouhB6/Pk=; b=OnyIpLWsrwRvDjK9OUAGyjA/GZLL6aM2qYchDfwLnVhrX+bxFoIPmklZjujo3VN2NKtG/CdMnK+f3P2KnQsyCz1LWSfhkKcx/GkuL4s+WkToYn/WC+NhrCbX7H0oUeB7YSvflioguzZ/AZ7h64aiH++7UQYy2l/lsse7Mkec7hpMIdjaz8TdxXNYmulUi3BykfbbW+40bkBSIm+QSskMUow3yn/UxiMfKCpbOz9mwNx57TJIecM+g5fC7XQj/Ov/aniNu2zTkAtvlD/V70C7kkiaXBWREsiWN6eSe7H9N5d1eFZbYmMbF81lFHUwkMFj2d6+NKmWCPfdOmLYXDSxMg== 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=Nf0Jzjuw2SZFvIbpeTfCghQvEOFea46iD2WouhB6/Pk=; b=klUCriQ4KHFmdGkKJibeXo9L1vzPFQacahZh0B9tjH+toWLZsvEC/hXEsb7NVmF559M9oI1rGW/1bubc70gzJolwMPqYQnWSc4L+G1w6BcqySH9lBH1RgHm4QOkFYO1M/GshihNy3BpoyFP5At0womAHkhaC47gy/J5Fvmt13nk= 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 MW4PR13MB5864.namprd13.prod.outlook.com (2603:10b6:303:1b7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Tue, 26 Dec 2023 02:38:10 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b%6]) with mapi id 15.20.7113.026; Tue, 26 Dec 2023 02:38:10 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v5 02/14] ethdev: add API to get firmware creation of bonding port Date: Tue, 26 Dec 2023 10:37:33 +0800 Message-Id: <20231226023745.3144143-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226023745.3144143-1-chaoyong.he@corigine.com> References: <20231018074821.1908906-1-chaoyong.he@corigine.com> <20231226023745.3144143-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW4PR13MB5864:EE_ X-MS-Office365-Filtering-Correlation-Id: 52361759-f94e-44cf-219a-08dc05bbb35c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mh2EkztyNXXuYW26Ksor4F/H7fFlEaPPGWsk+27emjbbGKF4Qw7Zsmp+oPZrs88gGp0tqguQiVTD4i6jpDzh7I/UN/bnGFSh9KrIvmgYd9d6obJvEN4HhjiEtyHG7FqnVWnlcb5YIXaDUQHoN5KN57U157SfEubWQVfaoa+YTp7oqC2ma8Chw2u0chegbPDvNBeplpleZFONU0o3+zjLmea743E1TSfv+sXI1OAKgxKlRBuSzC9jwZYb1lqeDvahYWuKuKQmRFS0VniGKidIhq63+Dwk9ZHxsxm3hQsim7pUlgaCdehCLoxbBXbGoL7BRonZc3B57F4moPzg+GA4sLh/Rfyw5QTfUio/uQJzdsHnpZaOAsRYdfsR+VHZR36Ow/RBZK2DJjV3tdPg25syLcGxIXvwf8EB5YnKgzTmTVem1WnuPJ0h2bpTJjkqxeCuFoYZ1D02eVZvZ+dK9Y8T2x4nlgtVmQnvJsh3PyXQezX8x9wZId6lUHnQ4bsVFFROt/9Sgp3A0B0JduzboCMIq7oac8pUHq+a0jiUpgJ9MMqNLnArD9zMNeGUO/HbSwtsqShy0Vlf9dDMdRcqgsi+eKqcdSDFX5Uu0UDP3r3HTPWZZ4iXTtscNVSJ2fQL+RSmk9JTND4Ar4MZhAeTek2t+INNX4paSOF8fhxXeXXlQws= 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)(39840400004)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(83380400001)(41300700001)(2616005)(38100700002)(26005)(107886003)(1076003)(316002)(4326008)(54906003)(8676002)(2906002)(5660300002)(44832011)(8936002)(478600001)(6512007)(6666004)(6506007)(52116002)(66476007)(66556008)(66946007)(6486002)(6916009)(38350700005)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?TcJhiVjOqfjA+1YK2cLnuV2E0iw04j9nxxujVOweHWR5H+4ps3/9jmQnwpiX?= =?us-ascii?Q?xYVV+MBUI8slSXKQsDm9C6DPUu1IdEFD9jZB1LGVpRvKWDgpXiMElJDS00xA?= =?us-ascii?Q?i8uShj13RrdcnwfcgE49xEUeUbjxYGzRxNrYcO0KMjKE1czBGhV2Xb1UTtRI?= =?us-ascii?Q?hc4XSt8iixVaN0jzyDkHBQVoGQ5zU79fGJfSaRvSIWCQ1tVKL97sXi5OgQOA?= =?us-ascii?Q?DMIiTJ8PvorQ+ENJ7yufVAppfMJVFqOPw0TnvlsSR6cegqKoFJf4c9sj8dRN?= =?us-ascii?Q?mxnj1Sn9g0ZFPhhBPAxpzZW+NlEYZB8DqqipQES/FYVoawgX8k+7x+Ga+qZ3?= =?us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qXnREqvzEq3CHu0XCS4AFCqzVDw+1qi2x4z?= =?us-ascii?Q?A8XI9mrhkPdEo6GSZrtzbt9GEDeJ/petNiFC7RZyRAmQrni0C19MyZUE8N15?= =?us-ascii?Q?grkdCanNHruN4qcdHqFuXwsLvdJSPgqZf4oNaAdBt/1lJIt1ZKmUaZG5s4ZC?= =?us-ascii?Q?y1ViDpIOrC84+9ebwHosZA+aN9UWkZT2DxXoygKyrkdZXkqLB++ZrKe5vGHt?= =?us-ascii?Q?+in1UpwvW/mDW6G0VbvDs4gycUSx8vlvEOzFFNMBw8riJPvuIdNE9/nwQh/1?= =?us-ascii?Q?MvRbk52zbkPU1v+3zWjI196s1U+XrVUrySGszPFDAIRsBhdPfje7/Gla/Ipq?= =?us-ascii?Q?JaqtYopHo3r6BzG7SGTf12mo/ornH5P81p3iR9R1huOl6XZcXIglJIUCTkmx?= =?us-ascii?Q?jQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52361759-f94e-44cf-219a-08dc05bbb35c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 02:38:10.7874 (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: WJUhRk2auCY4ZUwKXzredI/jkR4XfgVEZRdHfTnY/4s2p9wdz2/xv63f5KdTzxFKSznVkXEti/p5mT8R5YrrIkTgLdFZQsf+HL6Cjs4acMs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5864 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 firmware 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: Chaoyong He Reviewed-by: James Hershaw Reviewed-by: Peng Zhang --- 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 f6c773615c..9a8bed0346 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 firmware. + * + * @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_fw_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 239f86ee92..83957830a9 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -1170,3 +1170,31 @@ rte_eth_bond_notify_members(uint16_t bonding_port_id) return 0; } + +int +rte_eth_bond_fw_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_fw_create_get == NULL) + return -ENOTSUP; + + return member_dev->dev_ops->bond_fw_create_get(member_dev, bonding_dev); +} diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 3bd5e8ad11..12589f61b0 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_fw_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 39316a7a29..09d85ad101 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 firmware. + * + * @param dev + * Member port (ethdev) handle. + * @param bonding_dev + * Bonding port (ethdev) handle. + * + * @return + * Negative on error, 0 on success. + */ +typedef int (*eth_bond_fw_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 firmware. + */ + eth_bond_fw_create_get bond_fw_create_get; }; /** -- 2.39.1