DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] bond: changed slave_id to uint8_t to prevent data loss
@ 2015-02-20 16:12 Maciej Gajdzica
  0 siblings, 0 replies; only message in thread
From: Maciej Gajdzica @ 2015-02-20 16:12 UTC (permalink / raw)
  To: dev

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 <maciejx.t.gajdzica@intel.com>
---
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-20 16:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 16:12 [dpdk-dev] [PATCH] bond: changed slave_id to uint8_t to prevent data loss Maciej Gajdzica

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).