mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-23 07:01:23 +00:00
net/mlx5: Add rate limit print macros
Add rate limited print macros for warning and info level. This protects the system from burst of prints depleting HW resources and spamming dmesg. Signed-off-by: Aya Levin <ayal@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
aa8106f137
commit
3732b9720f
1 changed files with 10 additions and 0 deletions
|
@ -83,9 +83,19 @@ do { \
|
||||||
__func__, __LINE__, current->pid, \
|
__func__, __LINE__, current->pid, \
|
||||||
##__VA_ARGS__)
|
##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define mlx5_core_warn_rl(__dev, format, ...) \
|
||||||
|
pr_warn_ratelimited("%s:%s:%d:(pid %d): " format, (__dev)->priv.name, \
|
||||||
|
__func__, __LINE__, current->pid, \
|
||||||
|
##__VA_ARGS__)
|
||||||
|
|
||||||
#define mlx5_core_info(__dev, format, ...) \
|
#define mlx5_core_info(__dev, format, ...) \
|
||||||
pr_info("%s " format, (__dev)->priv.name, ##__VA_ARGS__)
|
pr_info("%s " format, (__dev)->priv.name, ##__VA_ARGS__)
|
||||||
|
|
||||||
|
#define mlx5_core_info_rl(__dev, format, ...) \
|
||||||
|
pr_info_ratelimited("%s:%s:%d:(pid %d): " format, (__dev)->priv.name, \
|
||||||
|
__func__, __LINE__, current->pid, \
|
||||||
|
##__VA_ARGS__)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MLX5_CMD_DATA, /* print command payload only */
|
MLX5_CMD_DATA, /* print command payload only */
|
||||||
MLX5_CMD_TIME, /* print command execution time */
|
MLX5_CMD_TIME, /* print command execution time */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue