DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding
@ 2021-12-10 11:41 Yunjian Wang
  2021-12-11  7:57 ` Min Hu (Connor)
  0 siblings, 1 reply; 3+ messages in thread
From: Yunjian Wang @ 2021-12-10 11:41 UTC (permalink / raw)
  To: dev; +Cc: chas3, humin29, dingxiaoxiong, xudingke, Yunjian Wang

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.

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/bonding/eth_bond_private.h | 2 +-
 drivers/net/bonding/rte_eth_bond_api.c | 2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h
index 8b104b6391..05117cc0d2 100644
--- a/drivers/net/bonding/eth_bond_private.h
+++ b/drivers/net/bonding/eth_bond_private.h
@@ -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,
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 84943cffe2..e577be85a7 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -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;
 	}
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 84f4900ee5..c48f41fc93 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1554,7 +1554,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;
 
@@ -3293,7 +3293,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;
 	}
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding
  2021-12-10 11:41 [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding Yunjian Wang
@ 2021-12-11  7:57 ` Min Hu (Connor)
  2022-01-18 11:30   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Min Hu (Connor) @ 2021-12-11  7:57 UTC (permalink / raw)
  To: Yunjian Wang, dev; +Cc: chas3, dingxiaoxiong, xudingke

Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2021/12/10 19:41, Yunjian Wang 写道:
> 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.
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>   drivers/net/bonding/eth_bond_private.h | 2 +-
>   drivers/net/bonding/rte_eth_bond_api.c | 2 +-
>   drivers/net/bonding/rte_eth_bond_pmd.c | 4 ++--
>   3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h
> index 8b104b6391..05117cc0d2 100644
> --- a/drivers/net/bonding/eth_bond_private.h
> +++ b/drivers/net/bonding/eth_bond_private.h
> @@ -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,
> diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
> index 84943cffe2..e577be85a7 100644
> --- a/drivers/net/bonding/rte_eth_bond_api.c
> +++ b/drivers/net/bonding/rte_eth_bond_api.c
> @@ -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;
>   	}
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index 84f4900ee5..c48f41fc93 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1554,7 +1554,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;
>   
> @@ -3293,7 +3293,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;
>   	}
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding
  2021-12-11  7:57 ` Min Hu (Connor)
@ 2022-01-18 11:30   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2022-01-18 11:30 UTC (permalink / raw)
  To: Min Hu (Connor), Yunjian Wang, dev; +Cc: chas3, dingxiaoxiong, xudingke

On 12/11/2021 7:57 AM, Min Hu (Connor) wrote:

> 在 2021/12/10 19:41, Yunjian Wang 写道:
>> 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.
>>
>> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> 
> Acked-by: Min Hu (Connor) <humin29@huawei.com>
> 


     Fixes: 2efb58cbab6e ("bond: new link bonding library")
     Fixes: a45b288ef21a ("bond: support link status polling")
     Fixes: 68451eb6698c ("net/bonding: call through EAL on create/free")
     Cc: stable@dpdk.org


Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-18 11:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 11:41 [dpdk-dev] [PATCH 1/1] net/bondig: fix type-mismatch in bonding Yunjian Wang
2021-12-11  7:57 ` Min Hu (Connor)
2022-01-18 11:30   ` Ferruh Yigit

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).