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 B0E7D4378F; Tue, 26 Dec 2023 03:38:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0B74F4067E; Tue, 26 Dec 2023 03:38:20 +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 4CC2240298 for ; Tue, 26 Dec 2023 03:38:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HKDCC9699EWFnCNjj+b/ZvvAs7riPbsUOxS0Q/Qvg/bsOtfyoolZHw2RtE1scES6fpc+U8BDpnhAz89MiQSYgJQsW4qpCGGMjWgcgtq6EBeCYCwP6MzHtTRQAzx/RVnD6lKj/A56zhPY8ZMctxiQpwfwNToBtcaziDhu34e/93pPtBlKvJxmJbG+FvPyyA9Ty5KNz+H3hb1uHb1E8wSBEALTEwtKYLX4CXcAPWToynZQreSt2GLgWgvrQdbC0bZ5yeUyMUbIRm2vk7neMPkgQ7Jv6vneW1v5VGkU6EZvY4sZWTVDz23PA6QU4jpow/dDa+qJrvG9pccZsAIzl72hfg== 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=8QiZArDINC9gYrpI91mjnZx3kDrpJSb0TBHMPG868CM=; b=dZ2SG/g93DPeJpxoX/xxQTjDvlMnjvaXn21YJU2kfupsSoYFUJHEaaRndLsxusTiGKmAkk+aiGa3D2vdKHdFrr9TabWcO6m1bIh0SP6IO79hdcCOF8cxvpB+Kau/7jcZ4RdGy4BIR4EmkPd7SRZ6Mo+OKjMbRP6vKELbkmIq/5D2Lg9uqzd+sLstAu++miWhPz+Yr41rVJcnYyrvkBg/wvxFRCkI5lgXLCEJz1gdpqLXWF0aGM5P4Lzix6p9t6oiPl6J5DGUoMpPkrZ05ORPfgK5tgOLf719jY/xeMOUaKyW3MSMYvxfF7FKbr6TAQofhNdZk3/6cR5idyBwXBd3ww== 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=8QiZArDINC9gYrpI91mjnZx3kDrpJSb0TBHMPG868CM=; b=gm5u5qk05lTDM7Q0jmuMf6SNpmJOB+E1HszRRlhHLN2EW+FQYsiWY+LD+jekkgd7l5MtSQujYYVbLTIBItFC4cjzqaIK6TZ9jNB5ab0okaT2O+lyrufKgrTVg+7koS9lKPJ6e6cRkUYqw/TOyEj/IKiL2x3RIJKsjD9wdfJuN68= 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:17 +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:17 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v5 05/14] net/bonding: support checking valid bonding port ID Date: Tue, 26 Dec 2023 10:37:36 +0800 Message-Id: <20231226023745.3144143-6-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: 58394093-40f5-4ff9-f077-08dc05bbb798 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Usk1uq6iXJHY0pgNoqWvsAOfHhRFvoA5LlAAJJTEIht7ngeSnYY1pGUcnUHM83mRjoeWrZ7630Jz61hgGX7yWDpFNpyu0stPvskvuPUemhcKaZiRXlqEZ6srJfFh7n6YJDOxuYb5ojY8jhWumbdaq1U/Za6265T6bQJ1Jkc0LL0tTPbvTNbCfIe7sBmQcY2YfU/XMXBLRY8Xp+Q5CzDRZ3VSgdRWhQZX1VW3B9uKt+HQL0/xXa7lit4OIC8SEc7/NL62aHtohsAUoJdNw2KTErkdAsIf2vQOqn8vRiVLj226H2sl073gOizQARvMqlMi3tGi1AFnMEzKOIoxfkWe6UOaEXLtN70qGr/fXzsF3bTz4jRcPnUQ6iwY2C6/QOqNkU5jBLl39IwvWMTykpmczBE/DLoqawcbZnzH/xtC/XQckXTinO3PAUAJQlpCmnIglbs5G44sGJc1prMHXb3chX1tZD83Y7z2JI/YRGyXX0ZWwvS+yxu9xo/zlo3YdVq/udDL2dILmczf/U646/VN29IdGhGInQXbyse+F0rX58LBNy9pWWQnNzKpRtxkO8gPybY80HRFjKPkwo8BpZob8EhSFQXR7Vzfrq3paxA4lafX6IHg15ZLnWkRdes8svhli0Pb+BJ/+Fp0ASCK1rFaj1Cy7tcxvDsTnszFXxH46I4= 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)(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?AuAiNQW3UZebasvfZbN75x/Xl3A2QVoah2D5isdrgvETEd8wzoCdO5hBigvt?= =?us-ascii?Q?ZFPBQ6uxX4bD5w0rLn3yrS750uX297lnXoD1NO48scX5p9hFjtzqDmZ7WaBs?= =?us-ascii?Q?8JJqhSjQXOXD4geKMdV/dqfv5I/pDcisXpphoSWM9QDN5a7dGT/hZfCU43IL?= =?us-ascii?Q?VYlx+KbbIke3tYHrQL4/PS5ZQF7//xxBlQtd8NqF9asMUBaxUXmdaRMObd5O?= =?us-ascii?Q?/mpRQ5RnZWH7QtUSDKP5WfAwK+hlKOdbI7bNk6Y7k78IIhId+vD/kcWy2NMt?= =?us-ascii?Q?vW2Ezt9bBT7dgowlnXAsjl6es15piAR4SPo+YxSMHbFF1C458OSsr6a17va3?= =?us-ascii?Q?rhQkRF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sYNdP4IQc?= =?us-ascii?Q?B2FCmk+Cjq9gLR8l/FteKLnBrz5EQFL6Z9htqeIoRqYJSolF5qpDPMQQjiB7?= =?us-ascii?Q?kObZ+jV115vCQvjs6YGoFZqFrYUFFPkcvuOWZUrAtDrcxBGEFMxmS9OlFhMv?= =?us-ascii?Q?7JqGT8rj/eStbTMw/qKOlJzh+GLaunYMmC80+C8nbx3st/3mibKS/kw9915j?= =?us-ascii?Q?T3dXx6u99juHLdsfbVFBpbCso7oiVTFRgn8grG07N2FI7Tybx1rBRz/dpmDD?= =?us-ascii?Q?hx2m29fI5lqEgBBgBZ9dq2zzFCEM2RwZKtGDDPwVaaxnp7dXOB9ropnSEf24?= =?us-ascii?Q?6AnpDXs2sfCARWy5+P5UmIYGEcVtr9pkpSNlDWWYYgF6qJdRKzGB4Pp33+Vg?= =?us-ascii?Q?sw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58394093-40f5-4ff9-f077-08dc05bbb798 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:17.8720 (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: guqMvaShF2ER9BTHMewheZP/Kr2gZm3R0ZQoNQPr49vOLAANuSq4AB/JLDnMTl0Hpy/3HSBDQPqo59R0Etyuv8grfiocBu3S23Yz7yUonjc= 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 Add API to support checking if the port id is a bonding port id. Signed-off-by: Long Wu Reviewed-by: Chaoyong He Reviewed-by: James Hershaw Reviewed-by: Peng Zhang --- 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 84dd39b12f..62af9bbd99 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_fw_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 32fa761baf..5e9437c786 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_fw_create_get(uint16_t bonding_port_id, uint16_t member_port_id) return member_dev->dev_ops->bond_fw_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 12589f61b0..cd27c43092 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_fw_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