@@ -265,6 +265,15 @@ int ibv_cmd_query_device_ex(struct ibv_context *context,
}
}
+ if (attr_size >= offsetof(struct ibv_device_attr_ex, xrc_odp_caps) +
+ sizeof(attr->xrc_odp_caps)) {
+ if (resp->response_length >=
+ offsetof(struct ib_uverbs_ex_query_device_resp, xrc_odp_caps) +
+ sizeof(resp->xrc_odp_caps)) {
+ attr->xrc_odp_caps = resp->xrc_odp_caps;
+ }
+ }
+
return 0;
}
@@ -309,9 +309,10 @@ static void print_odp_trans_caps(uint32_t trans)
}
}
-static void print_odp_caps(const struct ibv_odp_caps *caps)
+static void print_odp_caps(const struct ibv_device_attr_ex *device_attr)
{
uint64_t unknown_general_caps = ~(IBV_ODP_SUPPORT);
+ const struct ibv_odp_caps *caps = &device_attr->odp_caps;
/* general odp caps */
printf("\tgeneral_odp_caps:\n");
@@ -328,6 +329,8 @@ static void print_odp_caps(const struct ibv_odp_caps *caps)
print_odp_trans_caps(caps->per_transport_caps.uc_odp_caps);
printf("\tud_odp_caps:\n");
print_odp_trans_caps(caps->per_transport_caps.ud_odp_caps);
+ printf("\txrc_odp_caps:\n");
+ print_odp_trans_caps(device_attr->xrc_odp_caps);
}
static void print_device_cap_flags_ex(uint64_t device_cap_flags_ex)
@@ -531,7 +534,7 @@ static int print_hca_cap(struct ibv_device *ib_dev, uint8_t ib_port)
printf("\tmax_pkeys:\t\t\t%d\n", device_attr.orig_attr.max_pkeys);
printf("\tlocal_ca_ack_delay:\t\t%d\n", device_attr.orig_attr.local_ca_ack_delay);
- print_odp_caps(&device_attr.odp_caps);
+ print_odp_caps(&device_attr);
if (device_attr.completion_timestamp_mask)
printf("\tcompletion timestamp_mask:\t\t\t0x%016" PRIx64 "\n",
device_attr.completion_timestamp_mask);
@@ -37,6 +37,7 @@ struct ibv_tm_caps tm_caps; /* Tag matching capabilities
struct ibv_cq_moderation_caps cq_mod_caps; /* CQ moderation max capabilities */
uint64_t max_dm_size; /* Max Device Memory size (in bytes) available for allocation */
struct ibv_pci_atomic_caps atomic_caps; /* PCI atomic operations capabilities, use enum ibv_pci_atomic_op_size */
+uint32_t xrc_odp_caps; /* Mask with enum ibv_odp_transport_cap_bits to know which operations are supported. */
.in -8
};
@@ -325,6 +325,7 @@ struct ibv_device_attr_ex {
struct ibv_cq_moderation_caps cq_mod_caps;
uint64_t max_dm_size;
struct ibv_pci_atomic_caps pci_atomic_caps;
+ uint32_t xrc_odp_caps;
};
enum ibv_mtu {