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 A22AB43795; Tue, 26 Dec 2023 08:29:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41EB940693; Tue, 26 Dec 2023 08:28:57 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2134.outbound.protection.outlook.com [40.107.212.134]) by mails.dpdk.org (Postfix) with ESMTP id 071DE40647 for ; Tue, 26 Dec 2023 08:28:55 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAJuGGN5NhH1cizbpGDWZVJjj2jwf1QP99JFVG5ZimryNKcSGQ+MeBr0dSiTJbhXEYh1oxpZeySj1qqeY/+V2oX9q+heznFP+5D7Zm3Dk//9wYFsiccBGnM8xNu1mI8fEqP+jonnnqGPkYNdDDP1+wXeF90xsFgCK9qL2lkDhHHg6VqlvU5ig5PkbGQM4AtJRCPcP0Iid4XUK2Q6vPqVKkxGzJVstoPF212cLyBsSY0+ljazlCfxox+c0VKn8ipO6Cyjf/z/pvgjHiz5L+87Zh4rTIiX1ARAcubXrsBOOTewYY6qwkomzBlsyjVCH2snFN2csj/IpiIrACnyM6zDIg== 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=obbBFu7/zTyJuRNKToKp7J/bspNBljh54k1grmT/e4fpkF988NgiX72/TJhu8diy+cNkThCM1UOUZVYBtSIZhYLN4hcyEBt1iQcbDr/04DYs1ahl6/vGO339oBN71Lu0oyz++sP6AXKaB+ZdngQUBjdZwjD6abnShVjgbuhzE+tLPjy+m/AYRQjkiQa5iKY4om8iXhv6ycgP7HlLmEXn/Qy7MoJxevO5TxDGpwKPgD0teYbBCUjRhGv+EkIP2TdgSjdjWeRewzJHawjsllw83Y3DOLTjmwdWVo+TFOfMB/uTSu07cjUXkfiBvnw1J/xhSFpZN28FGivIu5PYPBUbBg== 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=VGiAFKFpwrKoC7LxPdtB5DJgFju1eGFs/bCI5lZLiPB2ApMh/ioGqa3d5Ht7M78A7o5RkK3NKAo1+/VSeVeeb+iyEhf8xvN9n9d6+tBjjYxCcSE6qbjbW4+NohHFevvLvLLdcUvc3VcVYIpbGE5AchHgtNhXK1m8Q3HV5TD/8Lg= 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:53 +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:53 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Chaoyong He , James Hershaw , Peng Zhang Subject: [PATCH v6 05/14] net/bonding: support checking valid bonding port ID Date: Tue, 26 Dec 2023 15:28:15 +0800 Message-Id: <20231226072824.3163121-6-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: 48d719b7-10d3-47cb-eb26-08dc05e44ffd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HF3JgTQ85u3WrZ5rTJOXGy2x5Wn2GkM2YXZH8inpCZpvfbWeRD6JOx4m4a6D1mF3rE7jDppS37okW6P0W7t3c/93Ufnfg+Rqsntv4NDsiE0h8D9xXno1MNm/2/cM7UrRDWbDdGN9OiTxdneu5LH75cpDG9/1q6fn9IkScfX1oPb9BVWHG/nJnJYS8eaSwZnqBhC+b3VvbYGMiPD3yzPER+Du+lKn7fcr1m3qYOfM+LnoG5DIArtVB44tG+Kur+4IPsz7hF2llRvdXBVEAEtTS+zI5njQ4kExNQCua+RUeJ0GUR7i0cZVt8rfu6NL3xCCgGi+4idka3OlTgmn6+TeritlEsecEw4j4XC5oHWXZdrdzcudup6Gl438HkEPvLo3fx7ldiT9Ap9TF+hwL3yzSWWbDofOuHzAyY8+bmmnEdQWWMy6xN4qdzmeEsSMxYyylqLtzIOrU1cLWUfGGsFa7qL/197DPnaIdL5ixWuk9nO+c6CWfcZ8dlxIXeTXlMNlS+kgGmTUxJVOt95N8OSFHbyZn5BAoAodC4XWlbscZ9qfN16ccqionda1c1DMeeEyWtZvcUp1CbyY7Agfs80ukWqb7pHAcq9LyWHk+G3+Pe3sOlqk0tLF2WJW0RvLSvOxVnssGxrM11TUwyUro0IX0aT94dHJDVaXpbpI8pRBEwg= 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)(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?1TDHpQtQPqlsWGH+4dSwJAXwOivucxLxHvaBrhpjE/EL8Bm1l8F14M3SZGdI?= =?us-ascii?Q?8x4nxO7jAC4HC2j4eHMTyZ+pnamYl72qgtJ6QoabgWt+t4o5FytELoZ10mSQ?= =?us-ascii?Q?jrckdVVvCHH3L8sWCOmJopfepTcsc0W5vlJD1XqSuqAYIL4AlYvurjl7Rrcy?= =?us-ascii?Q?59yT0usjOq0NzqbrJzDa/sqi1FQ4LLwKFKj79U8OkRRVcnZOvBZmtfqGqIp6?= =?us-ascii?Q?BHwvYgZ+qxcBnTgmzSXOte4mySCXJPJVgCSYA0mTFqyGpfW9Ft1bczmLdbpZ?= =?us-ascii?Q?dJBkPCPzZRm7tFouAAcd3svMH9mWa3JrCTR8oPS+3cdvx0jz2stS1AosrFcD?= =?us-ascii?Q?g7j2Mr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nbwdFhRw?= =?us-ascii?Q?/b1L0GT84X1xY8NNReqRMqFKG9w6cLCdjaw8DU4nCPTJ/ZfWTkfviGraiWoK?= =?us-ascii?Q?PlYy3WE6jY4J7KgDU/7/DloAnUXidzdCL/nSBfEuLwI7Xz9833dhsPFkhUrK?= =?us-ascii?Q?hT8R5NXnmHXTHPaaQvpsHkyUl0zVSE6SN+qAyT5Z9t51c6bEHH+NZ4XfFoe6?= =?us-ascii?Q?dng6RcHeSUhCJ40kSgaJioD0UfDZVwULy6FQZEAgG8bD+QYGGCs/RiEhkhmZ?= =?us-ascii?Q?1BoqouxrHajF6su0nISyBFVabiGLFHYmmAnPY8Zwj2gCohsSXVdwP9ZOyY8s?= =?us-ascii?Q?Ds8tTwgy/OAN61sgTd0Xak02qI4cw7dreHZu/4LB8+38/3pwg/fbwvRKFWEy?= =?us-ascii?Q?mQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 48d719b7-10d3-47cb-eb26-08dc05e44ffd 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:53.5371 (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: jP55jvePO3yuikwp1w+KUH6vUsXWHQEutdrBP6WGjqvJtgQ3ohWuFgfnCVtQpzLYBbcph24Yk85uAHf9uKiRr5OG/yuOiTkTMlOi4R9i/a4= 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 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