From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id D9F05B78B for ; Fri, 20 Feb 2015 17:12:35 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 20 Feb 2015 08:11:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,615,1418112000"; d="scan'208";a="688429623" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 20 Feb 2015 08:11:32 -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 t1KGBUEV020884; Fri, 20 Feb 2015 16:11:30 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t1KGBUA9005474; Fri, 20 Feb 2015 16:11:30 GMT Received: (from mtgajdzx@localhost) by sivswdev01.ir.intel.com with id t1KGBULP005470; Fri, 20 Feb 2015 16:11:30 GMT From: Maciej Gajdzica To: dev@dpdk.org Date: Fri, 20 Feb 2015 16:11:20 +0000 Message-Id: <1424448680-5376-1-git-send-email-maciejx.t.gajdzica@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] bond: changed rx and tx queue_id field type 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:36 -0000 Previous type of rx and tx queue_id field was int, which caused possible data loss when calling functions expecting uint16_t as an argument. Issue found with static code analysis tool. Signed-off-by: Maciej Gajdzica --- lib/librte_pmd_bond/rte_eth_bond_pmd.c | 3 ++- lib/librte_pmd_bond/rte_eth_bond_private.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/librte_pmd_bond/rte_eth_bond_pmd.c b/lib/librte_pmd_bond/rte_eth_bond_pmd.c index 7a17f53..a8df699 100644 --- a/lib/librte_pmd_bond/rte_eth_bond_pmd.c +++ b/lib/librte_pmd_bond/rte_eth_bond_pmd.c @@ -937,7 +937,8 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct bond_rx_queue *bd_rx_q; struct bond_tx_queue *bd_tx_q; - int errval, q_id; + int errval; + uint16_t q_id; /* Stop slave */ rte_eth_dev_stop(slave_eth_dev->data->port_id); diff --git a/lib/librte_pmd_bond/rte_eth_bond_private.h b/lib/librte_pmd_bond/rte_eth_bond_private.h index 3da5a9e..65697bd 100644 --- a/lib/librte_pmd_bond/rte_eth_bond_private.h +++ b/lib/librte_pmd_bond/rte_eth_bond_private.h @@ -65,7 +65,7 @@ extern const char *driver_name; /** Port Queue Mapping Structure */ struct bond_rx_queue { - int queue_id; + uint16_t queue_id; /**< Queue Id */ struct bond_dev_private *dev_private; /**< Reference to eth_dev private structure */ @@ -78,7 +78,7 @@ struct bond_rx_queue { }; struct bond_tx_queue { - int queue_id; + uint16_t queue_id; /**< Queue Id */ struct bond_dev_private *dev_private; /**< Reference to dev private structure */ -- 1.7.9.5