2023-03-24 02:56:25

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH 1/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'err'.

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:104 mlx5e_rx_reporter_err_icosq_cqe_recover() warn: missing error code 'err'.

Reported-by: Abaci Robot <[email protected]>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4601
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
index b621f735cdc3..b66183204be3 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
@@ -100,8 +100,10 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
goto out;
}

- if (state != MLX5_SQC_STATE_ERR)
+ if (state != MLX5_SQC_STATE_ERR) {
+ err = -EINVAL;
goto out;
+ }

mlx5e_deactivate_rq(rq);
if (xskrq)
--
2.20.1.7.g153144c


2023-03-24 03:01:48

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH 2/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

The error code is missing in this code scenario, add the error code
'-EINVAL' to the return value 'err'.

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c:105 mlx5e_tx_reporter_err_cqe_recover() warn: missing error code 'err'.

Reported-by: Abaci Robot <[email protected]>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4600
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index 44c1926843a1..5e2e2449668d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -101,8 +101,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
goto out;
}

- if (state != MLX5_SQC_STATE_ERR)
+ if (state != MLX5_SQC_STATE_ERR) {
+ err = -EINVAL;
goto out;
+ }

mlx5e_tx_disable_queue(sq->txq);

--
2.20.1.7.g153144c

2023-03-24 12:20:08

by Steen Hegelund

[permalink] [raw]
Subject: Re: [PATCH 1/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

Hi Jiapeng,

Looks good to me.

On Fri Mar 24, 2023 at 3:55 AM CET, Jiapeng Chong wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
>
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:104 mlx5e_rx_reporter_err_icosq_cqe_recover() warn: missing error code 'err'.
>
> Reported-by: Abaci Robot <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4601
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> index b621f735cdc3..b66183204be3 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> @@ -100,8 +100,10 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
> goto out;
> }
>
> - if (state != MLX5_SQC_STATE_ERR)
> + if (state != MLX5_SQC_STATE_ERR) {
> + err = -EINVAL;
> goto out;
> + }
>
> mlx5e_deactivate_rq(rq);
> if (xskrq)
> --
> 2.20.1.7.g153144c


Reviewed-by: Steen Hegelund <[email protected]>

BR
Steen

2023-03-24 12:20:13

by Steen Hegelund

[permalink] [raw]
Subject: Re: [PATCH 2/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

Hi Jiapeng,

This looks good too.

On Fri Mar 24, 2023 at 3:55 AM CET, Jiapeng Chong wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
>
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c:105 mlx5e_tx_reporter_err_cqe_recover() warn: missing error code 'err'.
>
> Reported-by: Abaci Robot <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4600
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> index 44c1926843a1..5e2e2449668d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> @@ -101,8 +101,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
> goto out;
> }
>
> - if (state != MLX5_SQC_STATE_ERR)
> + if (state != MLX5_SQC_STATE_ERR) {
> + err = -EINVAL;
> goto out;
> + }
>
> mlx5e_tx_disable_queue(sq->txq);
>
> --
> 2.20.1.7.g153144c


Reviewed-by: Steen Hegelund <[email protected]>

BR
Steen

2023-03-29 10:40:50

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 1/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

On Fri, Mar 24, 2023 at 10:55:40AM +0800, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
>
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c:104 mlx5e_rx_reporter_err_icosq_cqe_recover() warn: missing error code 'err'.
>
> Reported-by: Abaci Robot <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4601
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> index b621f735cdc3..b66183204be3 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c
> @@ -100,8 +100,10 @@ static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx)
> goto out;
> }
>
> - if (state != MLX5_SQC_STATE_ERR)
> + if (state != MLX5_SQC_STATE_ERR) {
> + err = -EINVAL;

I'm not sure about correctness of this change. SQC is not in error
state, there is nothing to recover here.

Thanks

> goto out;
> + }
>
> mlx5e_deactivate_rq(rq);
> if (xskrq)
> --
> 2.20.1.7.g153144c
>

2023-03-29 10:41:39

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 2/2] net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

On Fri, Mar 24, 2023 at 10:55:41AM +0800, Jiapeng Chong wrote:
> The error code is missing in this code scenario, add the error code
> '-EINVAL' to the return value 'err'.
>
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c:105 mlx5e_tx_reporter_err_cqe_recover() warn: missing error code 'err'.
>
> Reported-by: Abaci Robot <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4600
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> index 44c1926843a1..5e2e2449668d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
> @@ -101,8 +101,10 @@ static int mlx5e_tx_reporter_err_cqe_recover(void *ctx)
> goto out;
> }
>
> - if (state != MLX5_SQC_STATE_ERR)
> + if (state != MLX5_SQC_STATE_ERR) {
> + err = -EINVAL;

Same comment as for patch #1.

> goto out;
> + }
>
> mlx5e_tx_disable_queue(sq->txq);
>
> --
> 2.20.1.7.g153144c
>