]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
IB/core: Add extended device capability flags
authorMajd Dibbiny <majd@mellanox.com>
Sun, 17 Apr 2016 14:19:34 +0000 (17:19 +0300)
committerDoug Ledford <dledford@redhat.com>
Fri, 13 May 2016 23:40:27 +0000 (19:40 -0400)
Since all the uverbs device_cap_flags are occupied, we need a place to
expose more device capabilities.

This patch adds a new 64 bit device_cap_flags_ex to expose new
device capabilities.

The lower 32 bits will be identical to the original device_cap_flags,
The upper 32 bits will be new capabilities.

Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
include/uapi/rdma/ib_user_verbs.h

index 6fdc7ecdaca0c3df64e471e9d7b4b3f8242f00ff..9acb84983bd91befcdb3d83e18e79f861b0f0bd1 100644 (file)
@@ -3655,6 +3655,11 @@ 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.device_cap_flags_ex))
+               goto end;
+
+       resp.device_cap_flags_ex = attr.device_cap_flags;
+       resp.response_length += sizeof(resp.device_cap_flags_ex);
 end:
        err = ib_copy_to_udata(ucore, &resp, resp.response_length);
        return err;
index 8126c143a519f2d499d536d2d6e10b2587e9290f..b6543d73d20a7fd03a0e77a2615679bad978d74a 100644 (file)
@@ -226,6 +226,7 @@ struct ib_uverbs_ex_query_device_resp {
        struct ib_uverbs_odp_caps odp_caps;
        __u64 timestamp_mask;
        __u64 hca_core_clock; /* in KHZ */
+       __u64 device_cap_flags_ex;
 };
 
 struct ib_uverbs_query_port {