]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
IB/uverbs: Pass IB_UVERBS_QPF_GRH_REQUIRED to user space
authorArtemy Kovalyov <artemyko@mellanox.com>
Wed, 4 Jul 2018 12:57:51 +0000 (15:57 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 10 Jul 2018 17:13:04 +0000 (11:13 -0600)
Userspace also needs to know if the port requires GRHs to properly form
the AVs it creates.

Signed-off-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
drivers/infiniband/core/uverbs_cmd.c
include/uapi/rdma/ib_user_ioctl_verbs.h
include/uapi/rdma/ib_user_verbs.h

index 1bc9ceb16b701dad51aeee299bf3312733984132..bd6eefaecbd63fc5a03d840836b233b0e4b39cd0 100644 (file)
@@ -294,6 +294,9 @@ ssize_t ib_uverbs_query_port(struct ib_uverbs_file *file,
        resp.qkey_viol_cntr  = attr.qkey_viol_cntr;
        resp.pkey_tbl_len    = attr.pkey_tbl_len;
 
+       if (rdma_is_grh_required(ib_dev, cmd.port_num))
+               resp.flags |= IB_UVERBS_QPF_GRH_REQUIRED;
+
        if (rdma_cap_opa_ah(ib_dev, cmd.port_num)) {
                resp.lid     = OPA_TO_IB_UCAST_LID(attr.lid);
                resp.sm_lid  = OPA_TO_IB_UCAST_LID(attr.sm_lid);
index 1220f1df3deddf4488538c11067e8ddbd02cce9d..a81d853bf25d809568d1fecdcf1a2854546a2388 100644 (file)
@@ -78,6 +78,10 @@ enum ib_uverbs_query_port_cap_flags {
        IB_UVERBS_PCF_IP_BASED_GIDS = 1 << 26,
 };
 
+enum ib_uverbs_query_port_flags {
+       IB_UVERBS_QPF_GRH_REQUIRED = 1 << 0,
+};
+
 enum ib_uverbs_flow_action_esp_keymat {
        IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM,
 };
index 0a9070abb3f865bd1871092e70e8f9b01a002c70..25a16760de2ad1c6a735d71b3bd4edcc07f1e3c3 100644 (file)
@@ -299,7 +299,8 @@ struct ib_uverbs_query_port_resp {
        __u8  active_speed;
        __u8  phys_state;
        __u8  link_layer;
-       __u8  reserved[2];
+       __u8  flags;                    /* see ib_uverbs_query_port_flags */
+       __u8  reserved;
 };
 
 struct ib_uverbs_alloc_pd {