Skip to content

Commit

Permalink
net/bonding: fix mode type mismatch
Browse files Browse the repository at this point in the history
[ upstream commit cc5097b ]

There were some type-mismatch issues in bonding and fix them:
- Use %u to fix argument type mismatch in RTE_BOND_LOG.
- The internals->mode is of type uint8_t. But the function
  parameter 'mode' is of type int. So change the mode type
  from int to uint8_t.

Fixes: 2efb58c ("bond: new link bonding library")
Fixes: a45b288 ("bond: support link status polling")
Fixes: 68451eb ("net/bonding: call through EAL on create/free")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
wyjwang authored and bluca committed Feb 14, 2022
1 parent 8b6401d commit 239f57b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/net/bonding/eth_bond_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev,
uint16_t slave_port_id);

int
bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode);
bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode);

int
slave_configure(struct rte_eth_dev *bonded_eth_dev,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bonding/rte_eth_bond_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
}

if (slave_idx < 0) {
RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %d",
RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u",
internals->slave_count);
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/bonding/rte_eth_bond_pmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
}

int
bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, int mode)
bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode)
{
struct bond_dev_private *internals;

Expand Down Expand Up @@ -3300,7 +3300,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
/* Set mode 4 default configuration */
bond_mode_8023ad_setup(eth_dev, NULL);
if (bond_ethdev_mode_set(eth_dev, mode)) {
RTE_BOND_LOG(ERR, "Failed to set bonded device %d mode to %d",
RTE_BOND_LOG(ERR, "Failed to set bonded device %u mode to %u",
eth_dev->data->port_id, mode);
goto err;
}
Expand Down

0 comments on commit 239f57b

Please sign in to comment.