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 DEE56426BB; Thu, 5 Oct 2023 04:41:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 484E840A6E; Thu, 5 Oct 2023 04:40:52 +0200 (CEST) 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 480C5406FF for ; Thu, 5 Oct 2023 04:40:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mm+FEnoRY5JHV00+jP8fImKrICo7UOozjHjNHegSErB6BU/tvAou+V9TS7qTJ1LK4W93sUQ49rkd+xLIQrdOQxp40CCj9BnS/lEfDXWfBAB+NqR2v7Wpu7V5LMl4gcwUmuMa3CpvfKPxaMvYaacqX+0TBlHqv4qaTNJK6e14AiDNLtE1ia9479KHe7MkTIuIo0Q/iJqbY72syZu6UjpoWKeGCIIt7kakOo6Ly+hD4OgxOaVAsWYzYpHthHDP/InhIQiu0JovEUbF9GeQUoP7jUTWdJVMw0kfb+tZAxVO2O9qJGVyJxmCCDvwYHC23xHtZ9u7HGkKtlMxXgqHN89kjQ== 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=EsoE0ZFvH9wfYBwqxGq0d30PrbMiQ0cZFJLWn7+C4vo=; b=O5m6D3ftNL+sNP/VoFiRPUO0c+9ZJkcDhZPcmVFsYA3NfwDoe5NXDGJ8V3JPcORGOwup5tZeBIb5iGmlk7VbfjSe0SDq87/dwXwV3ecyDslGtc7NheQHmUBHd52R6y8DOiYWBVChc0PttEcDg+cyHDbrtZKZgjmihSV5KsLjLSml99GnLDoz7dO4fZSe0wMsPd06sma3ZQ0D3/ie9VVRLerGh6V6ZPZf/Fm/eJDZy1qnBIFrv59CD62f3RyTANa3evtzQeP0r68Baqi83n7yntbZEkCXiXbscSo9mMqVCDnA/I6CYJipPdUhJVZG4bZn2lLnknBEe8aXNRA3gNYNBQ== 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=EsoE0ZFvH9wfYBwqxGq0d30PrbMiQ0cZFJLWn7+C4vo=; b=RqsUMw4YBGQWTY1uCAeoWSK4rGR0Thp7IXVXtxAinvJU2f3MjLn2G/KtFghBLSHXy33pIpQVJ07VL3x6wUxcM0uU6IM6WeBnRazcl572F/NBT9iCMWZQci6DwQkxokSxF/pb0NSNQSG9XDjI0TfuPCFtsWXXIWMGB95nJB1RC04= 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 PH0PR13MB4780.namprd13.prod.outlook.com (2603:10b6:510:79::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.28; Thu, 5 Oct 2023 02:40:48 +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; Thu, 5 Oct 2023 02:40:48 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH 7/8] net/bonding: support checking valid bonding port ID Date: Thu, 5 Oct 2023 10:40:11 +0800 Message-Id: <20231005024012.1279810-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231005024012.1279810-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH0PR07CA0064.namprd07.prod.outlook.com (2603:10b6:510:f::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH0PR13MB4780:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fbde460-1774-439a-a540-08dbc54c7b94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: syiJgS6IgbAqh/CI4GBwNjhaOKbs5NvE5hrjUbFcwkhnijZycYtmupMPGNfUZ8J9VMbtd7MQy75NFkrvyWjNxD8T272vC6eApN5eorUZQlSvXyoe/qFfxgP56fUeYapjKeYYoaRdItpSpZmzngoFGRDwtn3VoCGYnE7x8Jey+jHSWLp3vIxZTAB1U9aPa/+AjC5BQAt48c5bpdxttCryYBT8QDed+9LW4x0So1VnLawsNIF3X0SWqrq5BqBscKDivIFpIptcWs/BOozK1wdQVWfWgnO4vKZr9VoO8y27lFU+/FqW4wrapVHtddmANwb5AU5bmyBHmHWPr6MpPfMPZJgnbVstxdSp5A3HbW04IShJlOu0/IeHpeDHdTUAZ/5bihOsqORACE+paImb50XlYGrWpERgJbHvC8Cpc1lSD+7RBLw1YvwfZihWN+DUu7uSWw+K3r6RCvVPSDswWQbcf2PR2QKeOfhtmVqOXj1IBUZ+ipa30HnijMK/NC/j2DIhrNjyjHRDkRJXXpq9IGGpxHJhiiBfJ2zTU19YGJJ3dKzyk5ei5zoUYqodi0iKfSOdqJXgqRsXOgqsW36H6i+1x+PVyg/9vRn4hl7+47eSyXQPntn/U09P1VDKY7ZZjI2qnGFiNKnuOah+3pgWSFPqawJt0HfIxeTEbUzx9elwviM= 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)(376002)(346002)(136003)(39830400003)(396003)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(8676002)(107886003)(2616005)(66476007)(4326008)(38100700002)(54906003)(316002)(478600001)(8936002)(66556008)(66946007)(38350700002)(2906002)(6916009)(86362001)(41300700001)(6486002)(6506007)(5660300002)(52116002)(6512007)(1076003)(6666004)(26005)(44832011)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?jyOp3rdJBhuvIzc5pMnJ9ab71RGVYRcRsLIVdTMlNP8WuGnQQ8hTxsVRKDX4?= =?us-ascii?Q?SFgxjymWiHrMlSAkKd8J35CDpYzkDQiQn7oz561Qhw0TpjUiuJZ6D4ywKD8c?= =?us-ascii?Q?gPeTgsIhIdml+dPH43K4RSxNYDV06O3Z2NtO2hlMvB4BeX97ZHA7S9mw8DsT?= =?us-ascii?Q?znVVfi/q5CFZ55Lit3mlM/sLOMI8zw7P7G7RoaKf1a73Y5YVxUlQ8tS8VTeI?= =?us-ascii?Q?rBii4vMpXUlvDnvDje64uxosP/KSkPXhgI2aWqF6egxxTKwQmf3ed3Cuaqf8?= =?us-ascii?Q?a46OLWnwX1Q/3rXuXrxG4g3DsvFVNfd9L1HoQx5nUGWFdbV9asORx2VNaWZp?= =?us-ascii?Q?C+L6xcsUspRvTBnJo44qv5OtOnwE9/N2p8SJX6pNVnhA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Mj1wDn16ppvrrs1RYi9n+GuO2ZjE5vv9GGJbaVcbo2M8KFTIu5OLY?= =?us-ascii?Q?IRxLuI7OXHs6Ihi00uS11EO1NDXcnctjFhp3tOHJu/exyoDGRoHIlgwmEdIB?= =?us-ascii?Q?pJ2nIC5FLsgg13MytvY8yQ7VglqJlh4/XlkvTeUGDyrbt4ji2I7xZ8yJ49gp?= =?us-ascii?Q?lFAzQ64Xp+bBsi/ltU3BgM8+6YhM1ioflnm8rIsLGKhbViE/SkTndC6htJQg?= =?us-ascii?Q?K8b9xV3mxEW8NIpTL9hTWVih3Okovyt6wWswLC9lGRr0VOXM+ipTR+hKgbr6?= =?us-ascii?Q?SF6P/m+4K/t1xF56Pxi05fRxhqPi0mKBzjQx/2M4oEB50+rkRXj4AkG6PC83?= =?us-ascii?Q?rw=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fbde460-1774-439a-a540-08dbc54c7b94 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 02:40:48.7785 (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: 8BGisEoubkpb6hHpUQgF2sHGOWtXiiTkq3iDCHHNdBXPIcL0ce8RTz35l4Yqjy+ddQbUK4dgkr+Gd2aqCytqhDZnAfjwXPpm7HNERHmj6Qc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB4780 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 2ae2f28ec1..8fa7b0aa01 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -475,6 +475,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