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 61F3B43196; Wed, 18 Oct 2023 09:49:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B4C6842E00; Wed, 18 Oct 2023 09:48:57 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2090.outbound.protection.outlook.com [40.107.223.90]) by mails.dpdk.org (Postfix) with ESMTP id B7F2442DE6 for ; Wed, 18 Oct 2023 09:48:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nIDYQ7jAOqReJrdhgYA72g4hnbO1MR7jiF686RboEJRs7/YHTFncH2WyAmKhlfnTxQa1fTyY/lzBjeK3CHgSJkClSDciMMuWqvHgBgo26tr6wWlG+fUPxKRuHi03P4OYgt9tngmOdOJWC+1J0s68VHooDTkzbvl51c0/P0Dqj8MD+2jfaevynIDaA9ry/AQfpRHuPH91EBudnkZVRsxn1vOG4jwmyKXcHDAPZTn430QTOY926pgSuFEkQM6gaSfucKrJqLx4MVkAVPDnpb/SvlCzZYAWXUIlDx1ijJzOf8uoNkUnyJ4g3mjKBgF8F0EmPjo4rNvOtIrETqEZhelBnA== 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=kl7IBavRVOOizwMDh7/5SsOjC/MAMrIdu9lzdcBCFOE=; b=K4LybPPAPYFQX6fHWgUpvV3EmNiYfm0SLDvvUYGkVw449yLypD2AF50b2Xys413l2q2TWFQbX00eF+D2cjZK04RH6Migxg0qdb92kP1evPF+bwnNFx/7r4il9dF3aQCwaeAr0cX65+OvavM6OB37iPki/v00lxydSxhtQoKkPSawNNmI7a2W1H5JnqVbcVIL8IPUuQNt9ss231bAMHsoNGHjf+am6RM/keLppYndCePjuYxf01FOqwMKb/E96ydx0MI8Tt4O1/9NK4QQSoUSIGeNDe1nKSK4Q41x4Q+J97wZd2fdcq436BL0aUEbhCZtVQboG9261gnQbrEQPhT3dw== 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=kl7IBavRVOOizwMDh7/5SsOjC/MAMrIdu9lzdcBCFOE=; b=LGh43BEe0nEc6LmY7us80gDuvv8ie1ZcsnzIxaARw2SOh1t5opf2reyTx5wiBQkixUZQOhz6I4jooCPgLR4onW729k7cEHeGeNhQ9NUhE641jINa6K98T6q/d2+TP+caOr+adVAjNqO6w+WKb1+qpfjDhpXr08bv/Ys5aPlwGiU= 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 CH0PR13MB5188.namprd13.prod.outlook.com (2603:10b6:610:fd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Wed, 18 Oct 2023 07:48:53 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::142e:d47c:7320:8a9d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::142e:d47c:7320:8a9d%4]) with mapi id 15.20.6907.021; Wed, 18 Oct 2023 07:48:53 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v4 5/6] net/bonding: support checking valid bonding port ID Date: Wed, 18 Oct 2023 15:48:20 +0800 Message-Id: <20231018074821.1908906-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231018074821.1908906-1-chaoyong.he@corigine.com> References: <20231008015041.1551165-1-chaoyong.he@corigine.com> <20231018074821.1908906-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0019.apcprd02.prod.outlook.com (2603:1096:4:195::13) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH0PR13MB5188:EE_ X-MS-Office365-Filtering-Correlation-Id: 80c3db7a-84df-48ec-e6eb-08dbcfaeaca7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GkCC68gwHRgHn2Zj3nNsVP/CHs2GC5zOxilaSy7jNhAeLII0NSbw9tcClpoKtlqJQD73zCMHM1/lXRukKJD0IVL87J47u2Ymw2DFLkm3lGr2KnNmcwi9GcMLel/YScgeSPUBQdQKD2MZBb8I3wcDtp8PnVv1JMQBjCbTBlzLmRiF8PvUp5Z4AcVRhnZY13dJXiBeEp60JtGBh1HqIb/GOiXS9AWowJ9JNK+pbftYiKloi6DGiFFBMx+Qsp6w4/BXNmfN1QrlKauTTcMn4T62htT1qppn45u8MJqXFTaJaFZRGCKRTKHew7HP6b+TS8wIPR/yUACUTCoSPLmwQmM1T+H92g99JAZ6HNPlBLelytqLbMHNS3MYNRXN+iXbWroSmzTujOSogFk+au/hrQVyCVBMsB8Hg54x5QM3EgrORRnXJEZLLhyAdIEj1gsVYhVQKJBI4vxJ/aC6T+jiUV3VLy6JnA4rYgivEpO/Krb5h9bhQ7d8dWsRMuP8Wq1YnQqdZVGqbc57tqygEw6SZvXZPfHVs1CyGNkxJTEZOqqvnU6yb0Tj6QTOTkKYeLiXI5I8jX4OrHO56z4obsvjZTNe3UEUUWsrlYKNDZCncnb7hi5MRGp4eG+Ig9ufzlTpajitlW98ve6NaMmPF3Dovdk9J8nIuBJdFs8+HBCjtptQAU0= 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)(366004)(136003)(396003)(346002)(376002)(39830400003)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(86362001)(41300700001)(5660300002)(8936002)(4326008)(8676002)(2906002)(44832011)(36756003)(6486002)(478600001)(107886003)(2616005)(1076003)(26005)(52116002)(6512007)(6666004)(6506007)(38350700005)(54906003)(66476007)(66556008)(66946007)(316002)(6916009)(38100700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?N0c3+Lmw0UeStk6pHqPiaPE2/Y8eOC2BkPk+ok+cNUd9+QuzVLbjmzp7pZ9h?= =?us-ascii?Q?51vByW2IWkxiPfq2ZxMsqesFpmBiFLtFK5YldVVC/1sAVCGOysuwLovu6k1y?= =?us-ascii?Q?SKz7dZ0Ulk3WtMDsMJ56bwpnb97mAbbLybCZKBGVe2b8XS4luyvxOfm9Lqs2?= =?us-ascii?Q?bb+VHPdAxkIwbsnTiakuQiqC4K5ve3qSQ430vFX1zDRm0cCg2bOqSKJD+Oie?= =?us-ascii?Q?tnBcjX3WX9uTUlAr4FBXlQH6AtR2NeI1lut1APT393KfaWTochlfAaiE22v/?= =?us-ascii?Q?OueSP33QxIyJLZPIIQBRiNp7vOedakN+FFWHzSFdYHy1dTQM6MEeeF7fWaQt?= =?us-ascii?Q?OxW+YQP/MIrO30Gj6FSa/WPYlkXgT48Td+E5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90wnnSt8eVWs2rxeJE5J2cyMBt1rQR6ThEjHFaP?= =?us-ascii?Q?mDarQlO6ccnm/rEelkOqBacUo8vp6fwVu87m3ocLBJhmw0bDyboLQjBdnr/f?= =?us-ascii?Q?gO0VZtbN4kJNCJJjzrXuuKgY3tUKuPQuCyCUooxV1fr/eq7rAXQ5wlmNR0pb?= =?us-ascii?Q?76lGRCZel7uiDFDHIAbL1EwinCSHAKC0cq4N+KbMTO0scbQC5JBoRXDomlVV?= =?us-ascii?Q?Xbgkwq/9DbgoNLKm2mN7bqThLFnDunOzmbPHTQW4fUJsdU6jhYoNFDI5Lxxd?= =?us-ascii?Q?l03VXVsV6tRNKvgDEHw5aETlaVJaalbvLoUtRQfYp+/1hy5ucVWgJC6Lajpo?= =?us-ascii?Q?Ig=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80c3db7a-84df-48ec-e6eb-08dbcfaeaca7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 07:48:53.2738 (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: hfLzHHXQq8NfhrhZPyKZiKTAGB9KU3ufROtFkYXrS4XfJdDNl19VggcY02M6vx233oOQfsR3r3GT1au6+WFlZnCDsOe53osC5Q4cFhFm0ZM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB5188 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 Add API to support checking if the port id is a bonding port id. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He --- drivers/net/bonding/rte_eth_bond.h | 13 +++++++++++++ drivers/net/bonding/rte_eth_bond_api.c | 7 +++++++ drivers/net/bonding/version.map | 1 + 3 files changed, 21 insertions(+) diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 936ab8c3a0..02ddb496bb 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -427,6 +427,19 @@ __rte_experimental int rte_eth_bond_hw_create_get(uint16_t bonding_port_id, uint16_t member_port_id); +/** + * Check whether bonding port id is valid. + * + * @param port_id + * Port ID of bonding device. + * + * @return + * true means the port is a bonding device, false means not. + */ +__rte_experimental +bool +rte_eth_bond_is_valid_port(uint16_t 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 656ddd35a7..07efc7a7e5 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -1212,3 +1212,10 @@ rte_eth_bond_hw_create_get(uint16_t bonding_port_id, uint16_t member_port_id) return member_dev->dev_ops->bond_hw_create_get(member_dev, bonding_dev); } + + +bool +rte_eth_bond_is_valid_port(uint16_t port_id) +{ + return (valid_bonding_port_id(port_id) == 0); +} diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 3cfff51269..97ef24dcdb 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -33,6 +33,7 @@ EXPERIMENTAL { rte_eth_bond_8023ad_member_info; rte_eth_bond_active_members_get; rte_eth_bond_hw_create_get; + rte_eth_bond_is_valid_port; rte_eth_bond_member_add; rte_eth_bond_member_remove; rte_eth_bond_members_get; -- 2.39.1