| .. | .. |
|---|
| 46 | 46 | #define TRACER_BLOCK_SIZE_BYTE 256 |
|---|
| 47 | 47 | #define TRACES_PER_BLOCK 32 |
|---|
| 48 | 48 | |
|---|
| 49 | +#define TRACE_STR_MSG 256 |
|---|
| 50 | +#define SAVED_TRACES_NUM 8192 |
|---|
| 51 | + |
|---|
| 49 | 52 | #define TRACER_MAX_PARAMS 7 |
|---|
| 50 | 53 | #define MESSAGE_HASH_BITS 6 |
|---|
| 51 | 54 | #define MESSAGE_HASH_SIZE BIT(MESSAGE_HASH_BITS) |
|---|
| .. | .. |
|---|
| 53 | 56 | #define MASK_52_7 (0x1FFFFFFFFFFF80) |
|---|
| 54 | 57 | #define MASK_6_0 (0x7F) |
|---|
| 55 | 58 | |
|---|
| 59 | +struct mlx5_fw_trace_data { |
|---|
| 60 | + u64 timestamp; |
|---|
| 61 | + bool lost; |
|---|
| 62 | + u8 event_id; |
|---|
| 63 | + char msg[TRACE_STR_MSG]; |
|---|
| 64 | +}; |
|---|
| 65 | + |
|---|
| 56 | 66 | struct mlx5_fw_tracer { |
|---|
| 57 | 67 | struct mlx5_core_dev *dev; |
|---|
| 68 | + struct mlx5_nb nb; |
|---|
| 58 | 69 | bool owner; |
|---|
| 59 | 70 | u8 trc_ver; |
|---|
| 60 | 71 | struct workqueue_struct *work_queue; |
|---|
| .. | .. |
|---|
| 81 | 92 | struct mlx5_core_mkey mkey; |
|---|
| 82 | 93 | u32 consumer_index; |
|---|
| 83 | 94 | } buff; |
|---|
| 95 | + |
|---|
| 96 | + /* Saved Traces Array */ |
|---|
| 97 | + struct { |
|---|
| 98 | + struct mlx5_fw_trace_data straces[SAVED_TRACES_NUM]; |
|---|
| 99 | + u32 saved_traces_index; |
|---|
| 100 | + struct mutex lock; /* Protect st_arr access */ |
|---|
| 101 | + } st_arr; |
|---|
| 84 | 102 | |
|---|
| 85 | 103 | u64 last_timestamp; |
|---|
| 86 | 104 | struct work_struct handle_traces_work; |
|---|
| .. | .. |
|---|
| 170 | 188 | int mlx5_fw_tracer_init(struct mlx5_fw_tracer *tracer); |
|---|
| 171 | 189 | void mlx5_fw_tracer_cleanup(struct mlx5_fw_tracer *tracer); |
|---|
| 172 | 190 | void mlx5_fw_tracer_destroy(struct mlx5_fw_tracer *tracer); |
|---|
| 173 | | -void mlx5_fw_tracer_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe); |
|---|
| 191 | +int mlx5_fw_tracer_trigger_core_dump_general(struct mlx5_core_dev *dev); |
|---|
| 192 | +int mlx5_fw_tracer_get_saved_traces_objects(struct mlx5_fw_tracer *tracer, |
|---|
| 193 | + struct devlink_fmsg *fmsg); |
|---|
| 194 | +int mlx5_fw_tracer_reload(struct mlx5_fw_tracer *tracer); |
|---|
| 174 | 195 | |
|---|
| 175 | 196 | #endif |
|---|