From patchwork Thu Mar 21 20:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 51491 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 648731B535; Thu, 21 Mar 2019 21:28:24 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 74B3A1B526; Thu, 21 Mar 2019 21:28:22 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA2F1308FC5F; Thu, 21 Mar 2019 20:28:21 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 295865C659; Thu, 21 Mar 2019 20:28:19 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: ferruh.yigit@intel.com, chas3@att.com, zhaohui8@huawei.com, stable@dpdk.org Date: Thu, 21 Mar 2019 21:28:13 +0100 Message-Id: <1553200094-5487-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 21 Mar 2019 20:28:21 +0000 (UTC) Subject: [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" 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 Reviewed-by: Maxime Coquelin --- 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: