-
Notifications
You must be signed in to change notification settings - Fork 4
[PWCI] "net/mlx5: release allocated indexed pools" #138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The cited commit allocated indexped pools but those pools were never released. Fix it. Fixes: b4edeaf ("net/mlx5: replace flow list with indexed pool") Cc: stable@dpdk.org Signed-off-by: Roi Dayan <roid@nvidia.com> Acked-by: Bing Zhao <bingz@nvidia.com> Signed-off-by: 0-day Robot <robot@bytheb.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds mechanism to release indexed flow pools by introducing a dedicated cleanup function and invoking it during device shutdown. Sequence diagram for device close and flow pool cleanupsequenceDiagram
participant "mlx5_dev_close()"
participant "mlx5_flow_pools_destroy()"
participant "mlx5_ipool_destroy()"
"mlx5_dev_close()"->>"mlx5_flow_pools_destroy()": Call during device close
loop For each flow pool in priv->flows
"mlx5_flow_pools_destroy()"->>"mlx5_ipool_destroy()": Destroy non-null pool
end
Class diagram for updated mlx5_priv flow pool managementclassDiagram
class mlx5_priv {
flows[MLX5_FLOW_TYPE_MAXI]: ipool*
domain_id: int
...
}
class mlx5_flow_pools_destroy {
+mlx5_flow_pools_destroy(priv: mlx5_priv*)
}
mlx5_flow_pools_destroy --> mlx5_priv : uses
class mlx5_ipool_destroy {
+mlx5_ipool_destroy(ipool*)
}
mlx5_flow_pools_destroy --> mlx5_ipool_destroy : calls
mlx5_priv "1" o-- "MLX5_FLOW_TYPE_MAXI" ipool : flows array
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Consider resetting priv->flows[i] to NULL after calling mlx5_ipool_destroy to avoid dangling pointers in the private data.
- Ensure mlx5_flow_pools_destroy is invoked in any early error‐exit paths during flow pool setup so partial initialization failures don’t leak pools.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider resetting priv->flows[i] to NULL after calling mlx5_ipool_destroy to avoid dangling pointers in the private data.
- Ensure mlx5_flow_pools_destroy is invoked in any early error‐exit paths during flow pool setup so partial initialization failures don’t leak pools.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
WalkthroughAdds a static mlx5_flow_pools_destroy(priv) to free flow IP pools and invokes it from mlx5_dev_close() to ensure pools are destroyed during device close. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App
participant Driver as mlx5_dev_close()
participant Pools as mlx5_flow_pools_destroy()
participant IPool as mlx5_ipool_destroy()
App->>Driver: close device
Driver->>Pools: destroy flow pools
loop for i in [0..MLX5_FLOW_TYPE_MAXI)
alt priv->flows[i] != NULL
Pools->>IPool: mlx5_ipool_destroy(priv->flows[i])
IPool-->>Pools: freed
else
note over Pools: skip null entry
end
end
Pools-->>Driver: done
Driver-->>App: close complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)drivers/net/mlx5/mlx5.c (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
NOTE: This is an auto submission for "net/mlx5: release allocated indexed pools".
See "http://patchwork.dpdk.org/project/dpdk/list/?series=36292" for details.
Summary by Sourcery
Add cleanup of allocated indexed pools for flow resources on device close to prevent memory leaks
Bug Fixes:
Enhancements:
Summary by CodeRabbit