Skip to content

Commit 69ffc45

Browse files
author
Jakub Ramaseuski
committed
RDMA/ionic: Implement device stats ops
JIRA: https://issues.redhat.com/browse/RHEL-121486 commit ea4c399 Author: Abhijit Gangurde <abhijit.gangurde@amd.com> Date: Wed Sep 3 11:46:05 2025 +0530 RDMA/ionic: Implement device stats ops Implement device stats operations for hw stats and qp stats. Co-developed-by: Allen Hubbe <allen.hubbe@amd.com> Signed-off-by: Allen Hubbe <allen.hubbe@amd.com> Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com> Link: https://patch.msgid.link/20250903061606.4139957-14-abhijit.gangurde@amd.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jakub Ramaseuski <jramaseu@redhat.com>
1 parent cedd644 commit 69ffc45

File tree

4 files changed

+554
-0
lines changed

4 files changed

+554
-0
lines changed

drivers/infiniband/hw/ionic/ionic_fw.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,17 @@ static inline int ionic_v1_use_spec_sge(int min_sge, int spec)
659659
return spec;
660660
}
661661

662+
struct ionic_admin_stats_hdr {
663+
__le64 dma_addr;
664+
__le32 length;
665+
__le32 id_ver;
666+
__u8 type_state;
667+
} __packed;
668+
669+
#define IONIC_ADMIN_STATS_HDRS_IN_V1_LEN 17
670+
static_assert(sizeof(struct ionic_admin_stats_hdr) ==
671+
IONIC_ADMIN_STATS_HDRS_IN_V1_LEN);
672+
662673
struct ionic_admin_create_ah {
663674
__le64 dma_addr;
664675
__le32 length;
@@ -837,6 +848,7 @@ struct ionic_v1_admin_wqe {
837848
__le16 len;
838849

839850
union {
851+
struct ionic_admin_stats_hdr stats;
840852
struct ionic_admin_create_ah create_ah;
841853
struct ionic_admin_destroy_ah destroy_ah;
842854
struct ionic_admin_query_ah query_ah;
@@ -983,4 +995,35 @@ static inline u32 ionic_v1_eqe_evt_qid(u32 evt)
983995
return evt >> IONIC_V1_EQE_QID_SHIFT;
984996
}
985997

998+
enum ionic_v1_stat_bits {
999+
IONIC_V1_STAT_TYPE_SHIFT = 28,
1000+
IONIC_V1_STAT_TYPE_NONE = 0,
1001+
IONIC_V1_STAT_TYPE_8 = 1,
1002+
IONIC_V1_STAT_TYPE_LE16 = 2,
1003+
IONIC_V1_STAT_TYPE_LE32 = 3,
1004+
IONIC_V1_STAT_TYPE_LE64 = 4,
1005+
IONIC_V1_STAT_TYPE_BE16 = 5,
1006+
IONIC_V1_STAT_TYPE_BE32 = 6,
1007+
IONIC_V1_STAT_TYPE_BE64 = 7,
1008+
IONIC_V1_STAT_OFF_MASK = BIT(IONIC_V1_STAT_TYPE_SHIFT) - 1,
1009+
};
1010+
1011+
struct ionic_v1_stat {
1012+
union {
1013+
__be32 be_type_off;
1014+
u32 type_off;
1015+
};
1016+
char name[28];
1017+
};
1018+
1019+
static inline int ionic_v1_stat_type(struct ionic_v1_stat *hdr)
1020+
{
1021+
return hdr->type_off >> IONIC_V1_STAT_TYPE_SHIFT;
1022+
}
1023+
1024+
static inline unsigned int ionic_v1_stat_off(struct ionic_v1_stat *hdr)
1025+
{
1026+
return hdr->type_off & IONIC_V1_STAT_OFF_MASK;
1027+
}
1028+
9861029
#endif /* _IONIC_FW_H_ */

0 commit comments

Comments
 (0)