diff options
author | Eli Cohen <eli@dev.mellanox.co.il> | 2014-01-14 10:45:19 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2014-01-23 02:23:50 -0500 |
commit | db81a5c374b5bd650c5e6ae85d026709751db103 (patch) | |
tree | 5567376f685a054973bc83b9b3a4d9309f8c41e2 /include/linux/mlx5 | |
parent | bde51583f49bd87e452e9504d489926638046b11 (diff) |
mlx5_core: Improve debugfs readability
Use strings to display transport service or state of QPs. Use numeric
value for MTU of a QP.
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'include/linux/mlx5')
-rw-r--r-- | include/linux/mlx5/qp.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h index d9e3eacb3a7f..d51eff713549 100644 --- a/include/linux/mlx5/qp.h +++ b/include/linux/mlx5/qp.h | |||
@@ -464,4 +464,49 @@ void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev); | |||
464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 464 | int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); | 465 | void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); |
466 | 466 | ||
467 | static inline const char *mlx5_qp_type_str(int type) | ||
468 | { | ||
469 | switch (type) { | ||
470 | case MLX5_QP_ST_RC: return "RC"; | ||
471 | case MLX5_QP_ST_UC: return "C"; | ||
472 | case MLX5_QP_ST_UD: return "UD"; | ||
473 | case MLX5_QP_ST_XRC: return "XRC"; | ||
474 | case MLX5_QP_ST_MLX: return "MLX"; | ||
475 | case MLX5_QP_ST_QP0: return "QP0"; | ||
476 | case MLX5_QP_ST_QP1: return "QP1"; | ||
477 | case MLX5_QP_ST_RAW_ETHERTYPE: return "RAW_ETHERTYPE"; | ||
478 | case MLX5_QP_ST_RAW_IPV6: return "RAW_IPV6"; | ||
479 | case MLX5_QP_ST_SNIFFER: return "SNIFFER"; | ||
480 | case MLX5_QP_ST_SYNC_UMR: return "SYNC_UMR"; | ||
481 | case MLX5_QP_ST_PTP_1588: return "PTP_1588"; | ||
482 | case MLX5_QP_ST_REG_UMR: return "REG_UMR"; | ||
483 | default: return "Invalid transport type"; | ||
484 | } | ||
485 | } | ||
486 | |||
487 | static inline const char *mlx5_qp_state_str(int state) | ||
488 | { | ||
489 | switch (state) { | ||
490 | case MLX5_QP_STATE_RST: | ||
491 | return "RST"; | ||
492 | case MLX5_QP_STATE_INIT: | ||
493 | return "INIT"; | ||
494 | case MLX5_QP_STATE_RTR: | ||
495 | return "RTR"; | ||
496 | case MLX5_QP_STATE_RTS: | ||
497 | return "RTS"; | ||
498 | case MLX5_QP_STATE_SQER: | ||
499 | return "SQER"; | ||
500 | case MLX5_QP_STATE_SQD: | ||
501 | return "SQD"; | ||
502 | case MLX5_QP_STATE_ERR: | ||
503 | return "ERR"; | ||
504 | case MLX5_QP_STATE_SQ_DRAINING: | ||
505 | return "SQ_DRAINING"; | ||
506 | case MLX5_QP_STATE_SUSPENDED: | ||
507 | return "SUSPENDED"; | ||
508 | default: return "Invalid QP state"; | ||
509 | } | ||
510 | } | ||
511 | |||
467 | #endif /* MLX5_QP_H */ | 512 | #endif /* MLX5_QP_H */ |