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 54BDF426D6; Sat, 7 Oct 2023 03:36:10 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C957A40A77; Sat, 7 Oct 2023 03:35:23 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2124.outbound.protection.outlook.com [40.107.94.124]) by mails.dpdk.org (Postfix) with ESMTP id 5A08340A72 for ; Sat, 7 Oct 2023 03:35:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GGrMDrzGGbNR+wILEarNQlEoIrqcm01dD5eAZC/sgIMlO/jxfhUVP0OKo3vsTwg1J1z9lc4SE5kI1TJQBwZ8KI++bOoN3SsZg729aXkngl9zPhX6GP9MGk7DQ9lGJP0kIJsojS1MPpCwcjDlU7zfpz80y0Qkg8taR7zmWNI8hmcanoudFc/BzlbZ9IlQm9GWlBN6mFV5bu9NOOnC8hvGSXnVWz7cMzUiiB/hKML+fNVre1+PwfLB4Rf6RloNubRv4zGYlyV952dmye/j9v2fC54hIFrd1M9O6++RB6K/pTpggBEJ+LLj0SHOkh1QIE6o5GCsTf11Snrz3o87IOQ3EA== 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=C/JpGEN5iK7e+tWx7o8znx0vosZHiouGKTDhwymJ83exOg7kV2gmUL6UprLs2BlvmbAbGTJ2LTlYovMU9w48se7yCSbo9wzMpadvG2aYTtDpusALH4GrrUXmPjoJb8QoGtg6d8I0Ql0UrBL3jGoef+LJ67OHOPfBIi1TFn8vWqAtF1Or+4dYDY0UJKm/RLIjuW7G5fusWwW5QL5lgaSTiUCVawy57uJQM0mDQOUeqUNJ24WIGJHWxRfeiO6AtHTMq6o0ZTYMRKK2MEH9pOWQtgDvIz61SCpLK+r8B2ouuryOM+s5Y8otIJqqpKXjLGBX9ApZwpv4rq8MjO+NBCDJVA== 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=Sld/WnXawLzp/4C5nQS3JCtX5MOnMe+jfZ/0YdiM6UNmbDnvxDdardjkPW56PEPY7ujI0usWWbNHjwg6Y8B3uJVTftuiGt+r7Nr6q08pzL0QTNKCa8t2xiF/ayAAqWfW/SZ44p00Fzw/HKpKakSXLxXFsaDukMSd2cKWUF7ocRQ= 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 BY3PR13MB4913.namprd13.prod.outlook.com (2603:10b6:a03:364::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.37; Sat, 7 Oct 2023 01:35:17 +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; Sat, 7 Oct 2023 01:35:17 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH v2 7/8] net/bonding: support checking valid bonding port ID Date: Sat, 7 Oct 2023 09:34:39 +0800 Message-Id: <20231007013440.1309422-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231007013440.1309422-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> <20231007013440.1309422-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH8PR20CA0008.namprd20.prod.outlook.com (2603:10b6:510:23c::18) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY3PR13MB4913:EE_ X-MS-Office365-Filtering-Correlation-Id: 63c56fd4-dbc1-47fc-b40f-08dbc6d5a893 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aIRS+7kaH1j+DqNMl34MEOAnQ0C3FtJ6TuOm8p2AVEiGcyUQa/sN0cmoKKuKz1yFMM1vKm3EcfrxWnXhfJZ3fKJfrA1iui/FXvpzS40JQOLDVLjJDc9mNWrUapmzzxptBgGTtuD7VAi6joHHWw8jctcs7yWpLJiOdWgEA5AqmEWZQlX13q5gJ4+F9cdn9T5VucfSLe4lI8Q7aINaqhcbucTaX28L7JUcSkGlFFyvVDY+TQ/CDY4NMtJ7ksoLGPFU/fhRjWGwnQ2aAIjVQVLcMO6WiTKpd2DBCH7lk8ZBKrrNoUwZ6kg7Qst1A7ReoS6Q5iOjbi+yRuKlt5st86SbumNKaSoR2+V/U2p4GC0Cpj6I8BjpJZnoxTFTKsAcHo5Adtl6KgTde+hJqqVj+z/FTtMhAYhbMmBLdto1JpyRY+leZFAD7m08Der0U3Yazo9DDedGWUJ+4lk30AumRl/zTIheUiNfEho4eIp43F9LwLB3UEJh6jKUtNZPNYKDhVB14WkPRmPsLKtXWR9SsEZZur31osOG2nPtBBFs6LIh3eSmEzxcBUGfp7bedhwCduf4lEWEZoHT587aZ/DO06z6ooCqCS8/8ckTx4IRhbNKbHhhNc3Ptl8bjU5XAMAM1ohbhCfGaXp2HnIPDyiropfhvw/5bVsS/nO73TA6KLgjwWQ= 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)(136003)(396003)(366004)(376002)(346002)(39830400003)(230922051799003)(186009)(451199024)(1800799009)(64100799003)(2906002)(44832011)(8676002)(8936002)(5660300002)(4326008)(54906003)(41300700001)(66946007)(316002)(6916009)(2616005)(66556008)(66476007)(6666004)(26005)(36756003)(52116002)(107886003)(1076003)(6512007)(6506007)(86362001)(38350700002)(478600001)(38100700002)(6486002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NbELe7BEIqJ/WqP+56Osr6lVuTCmxe1XdnU9TIl9KoGfRUlolGEVDoTdLx3q?= =?us-ascii?Q?cRRQNx+t3YfuJsKQrEWUctbyG/t3E7Xq6OubIchL9SzIuObVq2hAGDHWMaTp?= =?us-ascii?Q?WLD0OlWVWMW87A17Z65Z87waxuoRU37z/jEoUn54NXxIYrxEsviwxpWzZQHL?= =?us-ascii?Q?6yKL3qAZretkBURHCRwKh684NT5h8J+08/nE0JlGhMuevGdulOCBJGNs55me?= =?us-ascii?Q?W9RhEZBoB7xVBMbAEJ9VdBLw7i0lAgOXhlmIuGu2egY2FmN+0D1focRYx+2U?= =?us-ascii?Q?MQIq7Gl6Q3vBLOQozlK7DUCDCEPHM8Ca8qYSu4pFQ3OW6weLzQf8gF/iUvVp?= =?us-ascii?Q?i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+Uvu5azWKn?= =?us-ascii?Q?7rF6ZGd3O/GeWaCCeHuiJpsrs7CxgAffJ2cb5N452cJ8eb40cV7ECfRkbENl?= =?us-ascii?Q?oN++P9aFFsq4gXiXFEqXoXYORNrwtoWzg/vLX7UwZ5OUaYVvEG+INEzjPAfq?= =?us-ascii?Q?D9j1k78+qds9/vd1KtOMS0WgNL/U1JzzO+3kGZdt9LRTAgFRcrTVzdSeQysY?= =?us-ascii?Q?Qxndg/pxRHamZzwA1F1EOghAs03NP+5+vWMEkaxfuzXF+MujfyJ2WvK5ThLL?= =?us-ascii?Q?2bbJ0A+ji+RjA/ABrPNKnRTYc+iFP7nA8e2X3FybsYTJ83eAgKq53N9PJd1+?= =?us-ascii?Q?OkAK/2KulLumr5e5iS4e02im+C5+bFFBrbK76B6FnBCqZdvgClGJWSHJrn3A?= =?us-ascii?Q?6Q=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63c56fd4-dbc1-47fc-b40f-08dbc6d5a893 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Oct 2023 01:35:17.0416 (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: vhXetnrEhZ9oINLxnWdB+u84+gu1Fb5nWQO8HOv08qssGOSi5dloa/vqFaZsbjD/PjG/BvGTQUkKDzEiBVu+lkTQs0DUA/hCedQC6ctTHNQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB4913 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