From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3A1941B5A5; Fri, 22 Mar 2019 12:18:18 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CED130BC644; Fri, 22 Mar 2019 11:18:17 +0000 (UTC) Received: from [10.36.112.59] (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C07D860857; Fri, 22 Mar 2019 11:18:13 +0000 (UTC) To: David Marchand , dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> From: Maxime Coquelin Message-ID: Date: Fri, 22 Mar 2019 12:18:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 22 Mar 2019 11:18:17 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/2] net/bonding: fix more incorrect slave id types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2019 11:18:18 -0000 On 3/21/19 9:28 PM, David Marchand wrote: > From: Zhaohui > > mode_bond_id and mode_band_id are slave ids, stored on 16bits. > > Fixes: f8244c6399d9 ("ethdev: increase port id range") > Cc: stable@dpdk.org > > Signed-off-by: Zhaohui > Signed-off-by: David Marchand > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1e6a3fc..3943ec1 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -638,7 +638,7 @@ > SM_FLAG_CLR(port, NTT); > } > > -static uint8_t > +static uint16_t > max_index(uint64_t *a, int n) > { > if (n <= 0) > @@ -672,7 +672,8 @@ > uint64_t agg_bandwidth[8] = {0}; > uint64_t agg_count[8] = {0}; > uint16_t default_slave = 0; > - uint8_t mode_count_id, mode_band_id; > + uint16_t mode_count_id; > + uint16_t mode_band_id; > struct rte_eth_link link_info; > > slaves = internals->active_slaves; > @@ -708,13 +709,11 @@ > > switch (internals->mode4.agg_selection) { > case AGG_COUNT: > - mode_count_id = max_index( > - (uint64_t *)agg_count, slaves_count); > + mode_count_id = max_index(agg_count, slaves_count); > new_agg_id = mode_count_id; > break; > case AGG_BANDWIDTH: > - mode_band_id = max_index( > - (uint64_t *)agg_bandwidth, slaves_count); > + mode_band_id = max_index(agg_bandwidth, slaves_count); > new_agg_id = mode_band_id; > break; > case AGG_STABLE: > Reviewed-by: Maxime Coquelin From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id C902CA00E6 for ; Fri, 22 Mar 2019 12:18:21 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B8C761B5A6; Fri, 22 Mar 2019 12:18:19 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 3A1941B5A5; Fri, 22 Mar 2019 12:18:18 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CED130BC644; Fri, 22 Mar 2019 11:18:17 +0000 (UTC) Received: from [10.36.112.59] (ovpn-112-59.ams2.redhat.com [10.36.112.59]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C07D860857; Fri, 22 Mar 2019 11:18:13 +0000 (UTC) To: David Marchand , dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> From: Maxime Coquelin Message-ID: Date: Fri, 22 Mar 2019 12:18:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Content-Type: text/plain; charset="UTF-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 22 Mar 2019 11:18:17 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 1/2] net/bonding: fix more incorrect slave id types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190322111812.CiYuaTmom3NxkRz-ODzmNpXurmEJu7YQ-GrT19NVaPc@z> On 3/21/19 9:28 PM, David Marchand wrote: > From: Zhaohui > > mode_bond_id and mode_band_id are slave ids, stored on 16bits. > > Fixes: f8244c6399d9 ("ethdev: increase port id range") > Cc: stable@dpdk.org > > Signed-off-by: Zhaohui > Signed-off-by: David Marchand > --- > drivers/net/bonding/rte_eth_bond_8023ad.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c > index 1e6a3fc..3943ec1 100644 > --- a/drivers/net/bonding/rte_eth_bond_8023ad.c > +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c > @@ -638,7 +638,7 @@ > SM_FLAG_CLR(port, NTT); > } > > -static uint8_t > +static uint16_t > max_index(uint64_t *a, int n) > { > if (n <= 0) > @@ -672,7 +672,8 @@ > uint64_t agg_bandwidth[8] = {0}; > uint64_t agg_count[8] = {0}; > uint16_t default_slave = 0; > - uint8_t mode_count_id, mode_band_id; > + uint16_t mode_count_id; > + uint16_t mode_band_id; > struct rte_eth_link link_info; > > slaves = internals->active_slaves; > @@ -708,13 +709,11 @@ > > switch (internals->mode4.agg_selection) { > case AGG_COUNT: > - mode_count_id = max_index( > - (uint64_t *)agg_count, slaves_count); > + mode_count_id = max_index(agg_count, slaves_count); > new_agg_id = mode_count_id; > break; > case AGG_BANDWIDTH: > - mode_band_id = max_index( > - (uint64_t *)agg_bandwidth, slaves_count); > + mode_band_id = max_index(agg_bandwidth, slaves_count); > new_agg_id = mode_band_id; > break; > case AGG_STABLE: > Reviewed-by: Maxime Coquelin