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 824D34318A; Tue, 17 Oct 2023 10:33:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 286B7427D7; Tue, 17 Oct 2023 10:33:31 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 1D81D40279 for ; Tue, 17 Oct 2023 10:33:29 +0200 (CEST) Received: from kwepemm000004.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4S8nGN2SQbzVlSN; Tue, 17 Oct 2023 16:29:48 +0800 (CST) Received: from [10.67.121.59] (10.67.121.59) by kwepemm000004.china.huawei.com (7.193.23.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 17 Oct 2023 16:33:26 +0800 Message-ID: <9d3ed36d-5fd1-3a13-82ee-9bd955a10b0f@huawei.com> Date: Tue, 17 Oct 2023 16:33:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3 7/8] net/bonding: support checking valid bonding port ID To: Chaoyong He , CC: , Long Wu , James Hershaw References: <20231007013440.1309422-1-chaoyong.he@corigine.com> <20231008015041.1551165-1-chaoyong.he@corigine.com> <20231008015041.1551165-8-chaoyong.he@corigine.com> From: "lihuisong (C)" In-Reply-To: <20231008015041.1551165-8-chaoyong.he@corigine.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.121.59] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm000004.china.huawei.com (7.193.23.18) X-CFilter-Loop: Reflected 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 Hi Chaoyong, It is better to separate patch 3/8 and patch 6/8 from this series. 在 2023/10/8 9:50, Chaoyong He 写道: > 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; > };