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 93F15426E6; Sun, 8 Oct 2023 03:52:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 882D740A75; Sun, 8 Oct 2023 03:51:42 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2099.outbound.protection.outlook.com [40.107.237.99]) by mails.dpdk.org (Postfix) with ESMTP id CD82440A6C for ; Sun, 8 Oct 2023 03:51:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cLChBPkHAkFHXnNxnMz91EgLJ1NdL+XRnArNSLmaf6qOrcBJQhBqLTQ+rexugUGvq0tWkMGS8ZypppDTOX/vderokNcqO4YVMbiI1iubsge2cINkZOViybMydOXlQfFwuX4ai45eYnbEfm0rWxG7qL+1zq7ATAX4LIOvefzVNC6XySNNCx0AZuSS72WUhGadae/Rnh86dVgAv+9YX0GVgV6JluuUIkGWi0t0fHEy3wqhKOXNoev1kH4GUal2Jh/QokuAc+NaXA5Fs0ULr2mFr3fw9FtgkkoSwZ2A54+fEt5hCB1dXFJUwC/IIJDt0Z6zf26CkZA7vDjN29Bn3yQpWA== 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=8GvFanOm7WZCkd6JspOO5TncKo6KwCNNjTpeUIISPDA=; b=hNFOyTnymNCrCTNlAFX70WzX/PMotEekFzJAKNsa5C2/10uHqq0iTA/3djmMVlUOE82ITeI6Unmr8bLRhzFLpYdn+Hl1tccKwlse6KlOr6e96ZsDxiBhzJXH6FDWYqhQtw039sd+um47jZg3t9BFLEycixm1eG8sKhZ8gLa8LSCuDUiY6W4xnvIoFirT5a+9PsPH5UfMtSt8l5qrjFV1kQn94fouv0gAeRimbK0RkDXB7GkpOzRo/kHLkIHDWJ/9feRq0cnZpfdq8+kb/fLlvwkmCnRazbHnfi2z4aR2s227Ptvga/2ZcDefjtrRAJqAl5/akdnHoyl0gGGyaKfA6A== 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=8GvFanOm7WZCkd6JspOO5TncKo6KwCNNjTpeUIISPDA=; b=Ie9cjnz83tqD8Pxeiks2+U8hwvpv6OTlSQhxGJmTxcE8IriCYXU7jGWitrP+M0miwux3NylRHNToMJcZVccqjBW9yyItAbvqMwyWcsyaYtMWcxidtWifgSSiGeseqc4h+UnQeKClrm6qRroeQ2riz/J0CelvyzIAe3Eh9b7ieFQ= 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 BLAPR13MB4579.namprd13.prod.outlook.com (2603:10b6:208:327::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.41; Sun, 8 Oct 2023 01:51:39 +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; Sun, 8 Oct 2023 01:51:39 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v3 7/8] net/bonding: support checking valid bonding port ID Date: Sun, 8 Oct 2023 09:50:40 +0800 Message-Id: <20231008015041.1551165-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231008015041.1551165-1-chaoyong.he@corigine.com> References: <20231007013440.1309422-1-chaoyong.he@corigine.com> <20231008015041.1551165-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR05CA0173.namprd05.prod.outlook.com (2603:10b6:a03:339::28) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BLAPR13MB4579:EE_ X-MS-Office365-Filtering-Correlation-Id: 209eeb5b-0773-4703-7bc0-08dbc7a11cd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YPO4wHggOdoUmARJDNe39zZ64PUGXY+yislh7y3/QYt0UzP7nP8E/O4KNnC5V5IvUs732BuKuek7YnFRKbqKpaJy6fhrQ86tE/9d4Y+s1uqQbmyjYTLRJ5TsKCi6d3DL2x0oK7pgmlilJqJtArsLnDgXIFsCEcMYpPFNR7moFgg/42DpEsVQJy958+uDjJ70qiTpX5rXUVO1cjZXuBFhBF6Cwl7+eftpuyWoBB1IF2HckOVkrhKsLI4S0aQTARnVDdw8+khGIvemRaoVKdKg6BQCcBilO6CL+BTuHkNnM+U3gFNIv+QX1FVZjuMRdjSzGtQ6stsQo7NckxZvWBfF/zMY8GHUGrGA/O/f+b53JJTM7xauOX1uSc40SAn2NLoLpRpR/xy4g9xZVrDWI90OQFRdyZBP8hlVMhVlMt9fNjsBK7u1kScrq+GhYbDkCn2Sqo2sy/ExjBxNiN4md6bRtFvM5cHpz5MvokaM3CNtK8W622ly1SAOU8DIoGaPOCpNLPNNNWC5/sRC2WPZE+hTnQ4cYkTSYl6FzWS/mSNl4m1JCzWn+7Ev29WB7nnSh9ZJq8UCKaH10UnAGTSIRIBeOfwZluKZywY+Bpsi79VzZbDtfWDSca3b880tLia9mXy1NAg9NsrscruP4e8j0tI3NvMn43L89YbkXNS0iWTqt3Y= 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)(39830400003)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(41300700001)(1076003)(107886003)(2616005)(316002)(6916009)(66556008)(66946007)(54906003)(66476007)(36756003)(5660300002)(44832011)(38350700002)(38100700002)(86362001)(2906002)(26005)(8676002)(8936002)(4326008)(478600001)(6666004)(6486002)(6506007)(52116002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yYK0YWCKqRnBHhRVyJYb+uF3FQ4Cb9TH7Ug66eom9u6wCMhqj/e9uZqpPWcV?= =?us-ascii?Q?L4aWM546aAEaRAXk1GR2i6pngkmQEUJiBbVK7wHTVU6D/YbOsLEG0dKerJbq?= =?us-ascii?Q?JNDPKzAF/DjZKehu17VCDj9dJd9q5okgkf4Zw2njfESe+SkWFy1ddeiZpw/Q?= =?us-ascii?Q?EeqPBddey7ET9x2NqbJq/bhd6PNulHKI/e204O7PjQklp6SnFdMBgdZaCuAZ?= =?us-ascii?Q?GVf6fOS3Qa2nDKZuZYg5zlNp03hFwXjUniomyXDtnjZ3a7T+2RlhdnW5+jHL?= =?us-ascii?Q?H+dPI5p5zM+hOfCOAfPdWIbg74Xdp36+zgGsd2y2wghRLOQYpyi4KKQcS0WG?= =?us-ascii?Q?FW83MVtHieLJn56jEhczdRnUoxBLzD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?lhqTe4hggwYCWzxLTVe8TJ3b2jn10psiy2JBJxESDQBF1szNUeiOg7K5dm41?= =?us-ascii?Q?+Dh/J5yzAu6sRaciBkUjzAKbcCFb92HPFUh44eFh+tlOLq6XwFa3z6sR0nf+?= =?us-ascii?Q?h0b61HMlSbbaA7p0FlhBZR2q+X/p/f72rJmMjvzUiXljMpV0DuqO6mhgluqs?= =?us-ascii?Q?l5V+DgaTNbkDf1SbfxKP3v1MrDWv1IVb7Wcr6XUQaAz3iLyiYf+7MFLFidYC?= =?us-ascii?Q?6g8wRQx7G9DRDUCsYPhzKq4V2NIobwDbroq+3Lt19vVHMfO57Dqa57UoetYQ?= =?us-ascii?Q?8ESN4HwS7i1b2b0DtLNQKcJq5KSutQk8Si+m6kqcbPOkKOM9RHi5gp4Hsb62?= =?us-ascii?Q?Og=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 209eeb5b-0773-4703-7bc0-08dbc7a11cd5 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2023 01:51:39.3366 (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: RxVjqv75fI7QuNQfNhaohY4tcSKcsw75wmQf0JOHUBCzx8yXxaiXkZmgmtHbjmq5VMUUvl9JbvrT9/tsP/ogq2GPmReSuFz99g5/05z4TEc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR13MB4579 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 3f427b6bab..e8152a155f 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -461,6 +461,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 bonding_port_id + * Port ID of bonding device. + * + * @return + * 0 on success, negative value otherwise. + */ +__rte_experimental +int +rte_eth_bond_valid_bonding_port_id(uint16_t bonding_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 0113dfdc16..80d71529cc 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -1214,3 +1214,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); } + + +int +rte_eth_bond_valid_bonding_port_id(uint16_t port_id) +{ + return valid_bonding_port_id(port_id); +} diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 3cfff51269..bf5e50521e 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -39,4 +39,5 @@ EXPERIMENTAL { rte_eth_bond_notify_member_flag_get; rte_eth_bond_notify_member_flag_set; rte_eth_bond_notify_members; + rte_eth_bond_valid_bonding_port_id; }; -- 2.39.1