Skip to content

Commit 84c80c9

Browse files
Rafi Wienerliranoz12
authored andcommitted
issue: 1348872 Add capabiliy mask to device data
Signed-off-by: Rafi Wiener <[email protected]>
1 parent e66d313 commit 84c80c9

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/vma/dev/ring_simple.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,15 @@ int ring_simple::get_ring_descriptors(vma_mlx_hw_device_data &d)
19881988
{
19891989
d.dev_data.vendor_id = m_p_ib_ctx->get_ibv_device_attr()->vendor_id;
19901990
d.dev_data.vendor_part_id = m_p_ib_ctx->get_ibv_device_attr()->vendor_part_id;
1991-
d.dev_data.device_cap = 0;
1991+
if (vma_is_packet_pacing_supported(m_p_ib_ctx->get_ibv_device_attr())) {
1992+
d.dev_data.device_cap |= VMA_HW_PP_EN;
1993+
}
1994+
if (vma_is_umr_supported(m_p_ib_ctx->get_ibv_device_attr())) {
1995+
d.dev_data.device_cap |= VMA_HW_UMR_EN;
1996+
}
1997+
if (vma_is_mp_rq_supported(m_p_ib_ctx->get_ibv_device_attr())) {
1998+
d.dev_data.device_cap |= VMA_HW_MP_RQ_EN;
1999+
}
19922000
d.valid_mask = DATA_VALID_DEV;
19932001

19942002
ring_logdbg("found device with Vendor-ID %u, ID %u, Device cap %u", d.dev_data.vendor_part_id,

src/vma/util/verbs_extra.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ typedef struct ibv_flow_spec_ipv4 vma_ibv_flow_spec_ipv4;
187187
typedef struct ibv_flow_spec_tcp_udp vma_ibv_flow_spec_tcp_udp;
188188
#define vma_get_flow_tag 0
189189
typedef struct ibv_exp_flow_spec_action_tag_dummy {} vma_ibv_flow_spec_action_tag;
190-
191190
#else //new MLNX_OFED verbs (2.2 and newer)
192191

193192
#define vma_ibv_create_qp(pd, attr) ibv_exp_create_qp((pd)->context, attr)
@@ -308,14 +307,28 @@ typedef struct ibv_exp_flow_spec_action_tag vma_ibv_flow_spec_action_tag;
308307
#define vma_get_flow_tag(cqe) 0
309308
typedef struct ibv_exp_flow_spec_action_tag_dummy {} vma_ibv_flow_spec_action_tag;
310309
#endif //DEFINED_IBV_EXP_FLOW_TAG
311-
#endif
310+
#endif //new MLNX_OFED verbs (2.2 and newer)
312311

313312
#if defined(HAVE_IBV_DM)
314313
#define vma_ibv_dm_size(attr) ((attr)->max_dm_size)
315314
#else
316315
#define vma_ibv_dm_size(attr) (0)
317316
#endif
318317

318+
#ifdef HAVE_MP_RQ
319+
#define vma_is_umr_supported(attr) ((attr)->umr_caps.max_klm_list_size)
320+
#define vma_is_mp_rq_supported(attr) ((attr)->comp_mask & IBV_EXP_DEVICE_ATTR_MP_RQ)
321+
#else
322+
#define vma_is_umr_supported(attr) (0)
323+
#define vma_is_mp_rq_supported(attr) (0)
324+
#endif
325+
326+
#ifdef DEFINED_IBV_EXP_QP_RATE_LIMIT
327+
#define vma_is_packet_pacing_supported(attr) ((attr)->packet_pacing_caps.qp_rate_limit_min)
328+
#else
329+
#define vma_is_packet_pacing_supported(attr) (0)
330+
#endif
331+
319332
typedef enum {
320333
RL_RATE = 1<<0,
321334
RL_BURST_SIZE = 1<<1,

src/vma/vma_extra.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ struct vma_ring_type_attr {
353353
};
354354

355355
typedef enum {
356-
VMA_HW_RESERVED
356+
VMA_HW_PP_EN = (1 << 0),
357+
VMA_HW_UMR_EN = (1 << 1),
358+
VMA_HW_MP_RQ_EN = (1 << 2),
357359
} mlx_hw_device_cap;
358360

359361
struct dev_data {

0 commit comments

Comments
 (0)