IB/uverbs: Expose vlan offloads capabilities
authorNoa Osherovich <noaos@mellanox.com>
Wed, 18 Jan 2017 13:39:58 +0000 (15:39 +0200)
committerDoug Ledford <dledford@redhat.com>
Tue, 14 Feb 2017 16:41:12 +0000 (11:41 -0500)
Expose raw packet capabilities to user space as part of query device.

Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/core/uverbs_cmd.c
include/uapi/rdma/ib_user_verbs.h

index 0834dce0a490b6ce261b2ef0b47a39264b8f3969..e4ae0c62df3655874a647ced71d3370d644aef17 100644 (file)
@@ -4354,6 +4354,12 @@ int ib_uverbs_ex_query_device(struct ib_uverbs_file *file,
 
        resp.max_wq_type_rq = attr.max_wq_type_rq;
        resp.response_length += sizeof(resp.max_wq_type_rq);
+
+       if (ucore->outlen < resp.response_length + sizeof(resp.raw_packet_caps))
+               goto end;
+
+       resp.raw_packet_caps = attr.raw_packet_caps;
+       resp.response_length += sizeof(resp.raw_packet_caps);
 end:
        err = ib_copy_to_udata(ucore, &resp, resp.response_length);
        return err;
index b458fea590b6e3b7ad3368d3b178c92330361c02..0db9e646edd3e7f5308e5e64633ba61f04640482 100644 (file)
@@ -247,7 +247,7 @@ struct ib_uverbs_ex_query_device_resp {
        __u64 device_cap_flags_ex;
        struct ib_uverbs_rss_caps rss_caps;
        __u32  max_wq_type_rq;
-       __u32 reserved;
+       __u32 raw_packet_caps;
 };
 
 struct ib_uverbs_query_port {