Hi,
From: Bing Zhao <[email protected]>
Sent: Monday, November 25, 2024 7:23 PM
To: Dariusz Sosnowski; Slava Ovsiienko; [email protected]; Raslan Darawsheh
Cc: Ori Kam; Suanming Mou; Matan Azrad; [email protected]
Subject: [PATCH] net/mlx5: fix Rx queue control deref
When the Rx queue is shared, only the control structure is shared and
the private structure of each Rx queue is still independent. During
the port stop stage, the hardware resource will be released, and the
memory will be freed in the device close stage. Then the control
structure reference count should be decreased when freeing a private
structure.
In the previous implementation, the decreasing action was wrongly
put inside the owners list empty condition. Indeed, they should be
in the same level. And since the reference count was set to 1 after
the 1st queue is created, when checking the value, it should be
subtracted firstly and then check the value.
With this commit, the reference calculation and condition checking
will be corrected. The shared Rx queues' control structures will be
freed successlly to avoid the crash in the port restarting.
Fixes: 3c9a82fa6edc ("net/mlx5: fix Rx queue control management")
Cc: [email protected]
Signed-off-by: Bing Zhao <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh