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 1E7B043795; Tue, 26 Dec 2023 08:29:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A00AB402EC; Tue, 26 Dec 2023 08:28:50 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2106.outbound.protection.outlook.com [40.107.212.106]) by mails.dpdk.org (Postfix) with ESMTP id 598A1402D8 for ; Tue, 26 Dec 2023 08:28:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EuzjUFr4OUGHnAllTAdjF7T/ElTGIwfU4+z16GIjxa9yX+bktv7EH3GrRwQj5Eo5DmO3GmSyLj+jDTKtg+XYAqv0dJw2BHKPVmxuN6M8yIQM40AZTsTbduWFNXOZsCfWP19RmpBuPfaZvgXfhNxz7HV8pIcdpN0j8t8y4cx+HhJvM+rYvnWeqg4xrv6f9KNGF38veRMv8kwjSY9NqDdK4XqmA9GjjGB78forwXhFw+/GOvvzJdJEupGe3kC8UCDIHrjIaJu+wTUZeF+RLTQjOCvZWhOxR9phWPhqGrvCIAJ9gB1FCtQr0mO2CwsTiQPX5R6amPyTD9664QCxeab4Qg== 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=TD3Wbl7sXthISoIpCJfxv89TC7UYM3p/uLuaaQ+Cw7NZXejtBPDWnjiSgxR1G8uKwPXt/4QaTGv/kMxl7IHEVbjHJWCaSwyZtkejXvY1NqdkU/kvxTXLH2TO2NEHGsk12X/Xt9qtla7MEkFxCaFmL9BsWhKvWwLrsSeBNlUxyh9eVNaMs8AX7xEqxG/GE41sraSzPWIWK0X21xUwOvXt2XED1ujlt0mU24s0hk2kr5RGEpvPHlbEBk+lpWgtzcxYKCldxY+5NcLx4kUuSRhkzT0kdnQLsOAusQjqCOxdFnGyZqDTKoGJB81Euhn1Ofq0lloiD1OXY7gic+NMoChreQ== 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=fk0PpXDg9oVu8g8Dwv6e98hmzgKh5uVPDo5D8M8EJwszzycVRarHVM9tCb8tPtmKi6XmK/WZn+Gvpd2lxS2HtK186yJKtw/E+EGYqXh3apkBYdZqnKZa8bBRctqA8WNs6mERMiHgm2ZWeKK3KN0R9xr6cicJ3slE/1yPkoMutuE= 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 CH3PR13MB6506.namprd13.prod.outlook.com (2603:10b6:610:1a3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Tue, 26 Dec 2023 07:28:46 +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.027; Tue, 26 Dec 2023 07:28:46 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v6 02/14] ethdev: add API to get firmware creation of bonding port Date: Tue, 26 Dec 2023 15:28:12 +0800 Message-Id: <20231226072824.3163121-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226072824.3163121-1-chaoyong.he@corigine.com> References: <20231226023745.3144143-1-chaoyong.he@corigine.com> <20231226072824.3163121-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0239.namprd03.prod.outlook.com (2603:10b6:a03:39f::34) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH3PR13MB6506:EE_ X-MS-Office365-Filtering-Correlation-Id: 472548ea-688c-41ff-1922-08dc05e44bff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: boSKt5f8TIO57/EzCh+qNkOWYlypBoHsw0Ur1+pFR/hnNoFlsJVON7uZNvUfw3vrjrLMJ3JXNTShsD6CvXmmIUrnjD3lx9DWrWbGmDmXGRRqOOkpxIsmzJUkRl2G67cZtGQRajEQdaD62qTjJkPneeErsRADo74CXx6IOtiXx+4tqCyJgMaEldFA6wbrMAOFZPxCX3PxtPs7QcmRQ4yC5BxiTnhI96mAxQgShy4O9YSqgGxX5m5bgsb41qKOq3nD95Zz7XmGenPbUmlfSeoCxwqRbeqoNWWOVejWI6WzQyMZWLOWx5pTE/SnVRNoZ0yZ/tF4hWfEbkbnqToULMfKzKyi7H0fdK1L3AbKrJ7ZtnMD+Rx6YM9JkCQy+xY3QOhH4uF1jZWav/jxulIMU4pFDlLWfKyBga8/66YAYYk7wEIToYRhYCW2IidWDlN8ZD8rvUUllZm4M3YBeRgGtT67DGrSNpgLvubeG40l0O8aDhr+n8RFcFkjXsVtqyhFBo/yrv9jdYCP89828xIOJ47zhjQuLM7kcOpiPYApcT97n/V30baBkJybcVPaC5xuPScTh2keH3hvWwqgm+eHhIpTsE3Ao6pMUI6gAC/fL4Sb62uY3ybrSuzbzTMiAjlttLF3gVMfLY98Skt5hg6rmWwWnhfoAqGW7Cc53hlK731zd6k= 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)(376002)(346002)(136003)(396003)(366004)(39840400004)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(107886003)(26005)(1076003)(52116002)(6666004)(2616005)(6512007)(83380400001)(5660300002)(44832011)(4326008)(8676002)(41300700001)(2906002)(8936002)(6486002)(478600001)(316002)(6916009)(54906003)(66476007)(66556008)(66946007)(6506007)(86362001)(36756003)(38100700002)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HbIpNlbCxq8HYnKviRSEJPnUEF65wyf00V9PrnzF4grEllzT644RgEYh/Zgr?= =?us-ascii?Q?Uge13r0Grutc5T3CGPK6OoHMdg73fZTfC7trL289RVexQWrAwxNan7B1GhtU?= =?us-ascii?Q?RzVo7qeIAzBWtI5tDMMk88N7AwDFO+KCwWGPFCStzjs9Cc9b7JbDlkqDBQRo?= =?us-ascii?Q?54txfKrwnQhc3cT+TSeb4VsRjRh5C7cJdKvcDHkT5t9fpjni6/x35VtJ46hA?= =?us-ascii?Q?d2gmkIsNf4drjJd2v6+Lldx9MbclsQpR3SmHJVn4sh4Jq6mQQsb5DJVhqcbQ?= =?us-ascii?Q?gkjoumTWM71u4DSdHioiClM7RpWSsmOMRw+/qOUPk1mTnax2meP3btE/ue7E?= =?us-ascii?Q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o3jpZAcGkpvsQK7jLZytPUhNcy/bw?= =?us-ascii?Q?CEBNS6sHbfSsf0LrPcbj+R9F9I6LuTVDf4WeCW3xWjNjONJ9R0FteLXoP+32?= =?us-ascii?Q?ZMYey/htiqltdSit2+OZvyRuuHqSHXl4y9TC4kjX+QuA1MMBw7T5lZlcCxSa?= =?us-ascii?Q?NG04PRQrKacKk5UbWVXLIoa6uDj4ETksZzJO/lNzJ0mLG1kU92c40t3m+Oc/?= =?us-ascii?Q?i6CXph7s4HBw8chTykNoBNfnU46Lp6CLDfjKGwhaHVU0SmqY1A7ugrPdHhdN?= =?us-ascii?Q?zCdJGX8NSd2444o+nxAY9Lo1pjRoHAzmqwtihSHV6C4rneSUjTyAP8wMnTFW?= =?us-ascii?Q?KimmipyLpSnihnBUFeWGS9C1w6W8xippfjXeqj7/4n7BAWK2DFST+3+hiKui?= =?us-ascii?Q?Ig=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 472548ea-688c-41ff-1922-08dc05e44bff X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 07:28:46.8223 (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: huTd6Rc0qDWkW/qCnOn7hpLWmxTYBY3aIVaXpVj10jXJzuvtm6bQMPd0JSxTIevqy+f3n1UcQ1wI95ep1D7FA0+0EAX7NH8wAIInhQFe3fw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR13MB6506 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