From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 1/2] net/bonding: fix more incorrect slave id types Date: Fri, 22 Mar 2019 12:18:12 +0100 Message-ID: References: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org To: David Marchand , dev@dpdk.org Return-path: In-Reply-To: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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