* [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure
@ 2026-05-04 22:30 Prathamesh Deshpande
2026-05-07 11:18 ` Tariq Toukan
2026-05-08 9:06 ` Simon Horman
0 siblings, 2 replies; 3+ messages in thread
From: Prathamesh Deshpande @ 2026-05-04 22:30 UTC (permalink / raw)
To: Saeed Mahameed, Leon Romanovsky
Cc: Richard Cochran, Tariq Toukan, Eran Ben Elisha, Jakub Kicinski,
netdev, linux-kernel, Prathamesh Deshpande
mlx5e_ptp_open_txqsq() creates the hardware SQ before allocating the PTP
traffic metadata database.
If mlx5e_ptp_alloc_traffic_db() fails, the error path frees the software
TX queue state but skips destroying the already-created hardware SQ.
Add a dedicated unwind label that destroys the SQ before freeing the TXQ
state.
Fixes: 1880bc4e4a96 ("net/mlx5e: Add TX port timestamp support")
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
index 723f66a6bd63..45db2dd7408d 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
@@ -489,12 +489,14 @@ static int mlx5e_ptp_open_txqsq(struct mlx5e_ptp *c, u32 tisn,
err = mlx5e_ptp_alloc_traffic_db(ptpsq, dev_to_node(mlx5_core_dma_dev(c->mdev)));
if (err)
- goto err_free_txqsq;
+ goto err_destroy_sq;
INIT_WORK(&ptpsq->report_unhealthy_work, mlx5e_ptpsq_unhealthy_work);
return 0;
+err_destroy_sq:
+ mlx5e_ptp_destroy_sq(c->mdev, txqsq->sqn);
err_free_txqsq:
mlx5e_free_txqsq(txqsq);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure
2026-05-04 22:30 [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure Prathamesh Deshpande
@ 2026-05-07 11:18 ` Tariq Toukan
2026-05-08 9:06 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Tariq Toukan @ 2026-05-07 11:18 UTC (permalink / raw)
To: Prathamesh Deshpande, Saeed Mahameed, Leon Romanovsky
Cc: Richard Cochran, Tariq Toukan, Eran Ben Elisha, Jakub Kicinski,
netdev, linux-kernel
On 05/05/2026 1:30, Prathamesh Deshpande wrote:
> mlx5e_ptp_open_txqsq() creates the hardware SQ before allocating the PTP
> traffic metadata database.
>
> If mlx5e_ptp_alloc_traffic_db() fails, the error path frees the software
> TX queue state but skips destroying the already-created hardware SQ.
>
> Add a dedicated unwind label that destroys the SQ before freeing the TXQ
> state.
>
> Fixes: 1880bc4e4a96 ("net/mlx5e: Add TX port timestamp support")
> Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> index 723f66a6bd63..45db2dd7408d 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/ptp.c
> @@ -489,12 +489,14 @@ static int mlx5e_ptp_open_txqsq(struct mlx5e_ptp *c, u32 tisn,
>
> err = mlx5e_ptp_alloc_traffic_db(ptpsq, dev_to_node(mlx5_core_dma_dev(c->mdev)));
> if (err)
> - goto err_free_txqsq;
> + goto err_destroy_sq;
>
> INIT_WORK(&ptpsq->report_unhealthy_work, mlx5e_ptpsq_unhealthy_work);
>
> return 0;
>
> +err_destroy_sq:
> + mlx5e_ptp_destroy_sq(c->mdev, txqsq->sqn);
> err_free_txqsq:
> mlx5e_free_txqsq(txqsq);
>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure
2026-05-04 22:30 [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure Prathamesh Deshpande
2026-05-07 11:18 ` Tariq Toukan
@ 2026-05-08 9:06 ` Simon Horman
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-05-08 9:06 UTC (permalink / raw)
To: Prathamesh Deshpande
Cc: Saeed Mahameed, Leon Romanovsky, Richard Cochran, Tariq Toukan,
Eran Ben Elisha, Jakub Kicinski, netdev, linux-kernel
On Mon, May 04, 2026 at 11:30:05PM +0100, Prathamesh Deshpande wrote:
> mlx5e_ptp_open_txqsq() creates the hardware SQ before allocating the PTP
> traffic metadata database.
>
> If mlx5e_ptp_alloc_traffic_db() fails, the error path frees the software
> TX queue state but skips destroying the already-created hardware SQ.
>
> Add a dedicated unwind label that destroys the SQ before freeing the TXQ
> state.
>
> Fixes: 1880bc4e4a96 ("net/mlx5e: Add TX port timestamp support")
> Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-08 9:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-04 22:30 [PATCH net v1] net/mlx5e: Fix PTP TX SQ cleanup on metadata DB failure Prathamesh Deshpande
2026-05-07 11:18 ` Tariq Toukan
2026-05-08 9:06 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox