@@ -3464,6 +3464,13 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
resp.hca_core_clock = attr.hca_core_clock;
resp.response_length += sizeof(resp.hca_core_clock);
+ if (ucore->outlen < resp.response_length + sizeof(resp.csum_cap))
+ goto end;
+
+ resp.csum_cap.eth_csum_cap = attr.csum_cap.eth_csum_cap;
+ resp.csum_cap.ib_csum_cap = attr.csum_cap.ib_csum_cap;
+ resp.response_length += sizeof(resp.csum_cap);
+
end:
err = ib_copy_to_udata(ucore, &resp, resp.response_length);
if (err)
@@ -218,6 +218,11 @@ struct ib_uverbs_odp_caps {
__u32 reserved;
};
+struct ib_uverbs_csum_cap_per_link {
+ __u32 eth_csum_cap;
+ __u32 ib_csum_cap;
+};
+
struct ib_uverbs_ex_query_device_resp {
struct ib_uverbs_query_device_resp base;
__u32 comp_mask;
@@ -225,6 +230,7 @@ struct ib_uverbs_ex_query_device_resp {
struct ib_uverbs_odp_caps odp_caps;
__u64 timestamp_mask;
__u64 hca_core_clock; /* in KHZ */
+ struct ib_uverbs_csum_cap_per_link csum_cap;
};
struct ib_uverbs_query_port {
New field csum_cap is added to respective uverbs counterpart according to ib_verbs. Signed-off-by: Bodong Wang <bodong@mellanox.com> --- drivers/infiniband/core/uverbs_cmd.c | 7 +++++++ include/uapi/rdma/ib_user_verbs.h | 6 ++++++ 2 files changed, 13 insertions(+)