Skip to contentSkip to conversation

net/mlx5e: Fix missing error code in mlx5e_rx_reporter_err_icosq_cqe_recover()

PATCH In review Jiapeng Chong 3 participants 6 messages Mar 24, 2023 – Mar 29, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +3 -1
index b621f735cdc3..b66183204be3 100644
@@ -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)
Signature · 1 line
2.20.1.7.g153144c
#1 lore raw

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +3 -1
index 44c1926843a1..5e2e2449668d 100644
@@ -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);
 
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 2/2
#2 lore raw

Hi Jiapeng,

This looks good too.

Quoted 31 lines · Jiapeng Chong

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +3 -2
index 44c1926843a1..5e2e2449668d 100644
@@ -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);
 
--
Quoted 1 line

2.20.1.7.g153144c

BR
Steen

#3 lore raw
In reply to Jiapeng Chong
Quoted 17 lines · Jiapeng Chong

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +0 -0
index 44c1926843a1..5e2e2449668d 100644

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c static int mlx5e_tx_reporter_err_cqe_recover(void *ctx) · line 105

Quoted 6 lines
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +2 -1
@@ -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.

Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c +1 -0
 		goto out;
+	}
 
 	mlx5e_tx_disable_queue(sq->txq);
 
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v1 1/2
#4 lore raw
In reply to Jiapeng Chong

Hi Jiapeng,

Looks good to me.

Quoted 31 lines · Jiapeng Chong

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +3 -2
index b621f735cdc3..b66183204be3 100644
@@ -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)
--
Quoted 1 line

2.20.1.7.g153144c

BR
Steen

#5 lore raw
In reply to Jiapeng Chong
Quoted 17 lines · Jiapeng Chong

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

---
 drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +0 -0
index b621f735cdc3..b66183204be3 100644

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c static int mlx5e_rx_reporter_err_icosq_cqe_recover(void *ctx) · line 104

Quoted 6 lines
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +2 -1
@@ -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

Quoted 8 lines
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_rx.c +1 -0
 		goto out;
+	}
 
 	mlx5e_deactivate_rq(rq);
 	if (xskrq)
Signature · 1 line
2.20.1.7.g153144c