From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4393DB773 for ; Fri, 20 Feb 2015 17:12:32 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 20 Feb 2015 08:12:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,615,1418112000"; d="scan'208";a="680932240" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2015 08:12:29 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t1KGCS6A020972; Fri, 20 Feb 2015 16:12:28 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t1KGCSwR005642; Fri, 20 Feb 2015 16:12:28 GMT Received: (from mtgajdzx@localhost) by sivswdev01.ir.intel.com with id t1KGCSah005638; Fri, 20 Feb 2015 16:12:28 GMT From: Maciej Gajdzica To: dev@dpdk.org Date: Fri, 20 Feb 2015 16:12:22 +0000 Message-Id: <1424448742-5605-1-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] bond: changed slave_id to uint8_t to prevent data loss X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2015 16:12:32 -0000 In some places slave_id is declared as uint16_t, which causes data loss when using functions expecting port_id as uint8_t. Issue found with static code analysis tool. Signed-off-by: Maciej Gajdzica --- lib/librte_pmd_bond/rte_eth_bond_8023ad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_bond/rte_eth_bond_8023ad.c b/lib/librte_pmd_bond/rte_eth_bond_8023ad.c index f1cf81a..97a828e 100644 --- a/lib/librte_pmd_bond/rte_eth_bond_8023ad.c +++ b/lib/librte_pmd_bond/rte_eth_bond_8023ad.c @@ -747,7 +747,7 @@ bond_mode_8023ad_periodic_cb(void *arg) struct ether_addr slave_addr; void *pkt = NULL; - uint16_t i, slave_id; + uint8_t i, slave_id; /* Update link status on each port */ @@ -1050,7 +1050,7 @@ int bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev) { struct bond_dev_private *internals = bond_dev->data->dev_private; - uint16_t i; + uint8_t i; for (i = 0; i < internals->active_slave_count; i++) bond_mode_8023ad_activate_slave(bond_dev, i); -- 1.7.9.5