New field csum_cap is added to respective uverbs counterpart according
to ib_verbs.

Signed-off-by: Bodong Wang <bod...@mellanox.com>
---
 drivers/infiniband/core/uverbs_cmd.c | 7 +++++++
 include/uapi/rdma/ib_user_verbs.h    | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/infiniband/core/uverbs_cmd.c 
b/drivers/infiniband/core/uverbs_cmd.c
index bbb02ff..9d5deec 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -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)
diff --git a/include/uapi/rdma/ib_user_verbs.h 
b/include/uapi/rdma/ib_user_verbs.h
index 978841e..9d69546 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -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 {
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to