diff mbox series

[1/3] net/bonding: fix proper return value check and correct log message

Message ID 20210622092531.73112-2-xhavli56@stud.fit.vutbr.cz (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers show
Series net/bonding: make dedicated queues work with mlx5 | expand

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Martin Havlik June 22, 2021, 9:25 a.m. UTC
Return value is now saved to errval and log message on error
reports correct function name, doesn't use q_id which was out of context,
and uses up-to-date errval.

Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
Cc: tomaszx.kulasek@intel.com

Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
Cc: Jan Viktorin <viktorin@cesnet.cz>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Min Hu (Connor) July 8, 2021, 12:33 p.m. UTC | #1
The old code has just low-level error, which just copied the "printf"
above.
Thanks for your patch.

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

在 2021/6/22 17:25, Martin Havlik 写道:
> Return value is now saved to errval and log message on error
> reports correct function name, doesn't use q_id which was out of context,
> and uses up-to-date errval.
> 
> Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control")
> Cc: tomaszx.kulasek@intel.com
> 
> Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
> Cc: Jan Viktorin <viktorin@cesnet.cz>
> ---
>   drivers/net/bonding/rte_eth_bond_pmd.c | 11 ++++++-----
>   1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
> index b01ef003e..4c43bf916 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1805,12 +1805,13 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>   				!= 0)
>   			return errval;
>   
> -		if (bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
> -				slave_eth_dev->data->port_id) != 0) {
> +		errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
> +				slave_eth_dev->data->port_id);
> +		if (errval != 0) {
>   			RTE_BOND_LOG(ERR,
> -				"rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)",
> -				slave_eth_dev->data->port_id, q_id, errval);
> -			return -1;
> +				"bond_ethdev_8023ad_flow_verify: port=%d, err (%d)",
> +				slave_eth_dev->data->port_id, errval);
> +			return errval;
>   		}
>   
>   		if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL)
>
Andrew Rybchenko July 13, 2021, 9:26 a.m. UTC | #2
On 7/8/21 3:33 PM, Min Hu (Connor) wrote:
> 在 2021/6/22 17:25, Martin Havlik 写道:
>> Return value is now saved to errval and log message on error
>> reports correct function name, doesn't use q_id which was out of context,
>> and uses up-to-date errval.
>>
>> Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP
>> control")
>> Cc: tomaszx.kulasek@intel.com
>>
>> Signed-off-by: Martin Havlik <xhavli56@stud.fit.vutbr.cz>
>> Cc: Jan Viktorin <viktorin@cesnet.cz>
>
> Acked-by: Min Hu (Connor) <humin29@huawei.com>

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index b01ef003e..4c43bf916 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1805,12 +1805,13 @@  slave_configure(struct rte_eth_dev *bonded_eth_dev,
 				!= 0)
 			return errval;
 
-		if (bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
-				slave_eth_dev->data->port_id) != 0) {
+		errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev,
+				slave_eth_dev->data->port_id);
+		if (errval != 0) {
 			RTE_BOND_LOG(ERR,
-				"rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)",
-				slave_eth_dev->data->port_id, q_id, errval);
-			return -1;
+				"bond_ethdev_8023ad_flow_verify: port=%d, err (%d)",
+				slave_eth_dev->data->port_id, errval);
+			return errval;
 		}
 
 		if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL)