IB/rxe: Initialize ib_ah_attr during query_ah
authorDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Sat, 29 Apr 2017 18:41:17 +0000 (14:41 -0400)
committerDoug Ledford <dledford@redhat.com>
Mon, 1 May 2017 18:32:43 +0000 (14:32 -0400)
Zero out ib_ah_attr before calling query_ah. Set ah_flags
appropriately.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Don Hiatt <don.hiatt@intel.com>
Reviewed-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rxe/rxe_av.c
drivers/infiniband/sw/rxe/rxe_verbs.c

index 604f6fee96bdb5cae1ea8ae669f9ffbd1e46584f..88a4a7f15fbde32bf86f7601b4d246c3d60ce375 100644 (file)
@@ -69,6 +69,7 @@ int rxe_av_to_attr(struct rxe_dev *rxe, struct rxe_av *av,
                   struct ib_ah_attr *attr)
 {
        memcpy(&attr->grh, &av->grh, sizeof(av->grh));
+       attr->ah_flags = IB_AH_GRH;
        attr->port_num = av->port_num;
        return 0;
 }
index dbede30261386c7789a6b92284feaf543060d2ec..b35201dd03bdbf4b14a41fcc634a6facdba27789 100644 (file)
@@ -378,6 +378,7 @@ static int rxe_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr)
        struct rxe_dev *rxe = to_rdev(ibah->device);
        struct rxe_ah *ah = to_rah(ibah);
 
+       memset(attr, 0, sizeof(*attr));
        rxe_av_to_attr(rxe, &ah->av, attr);
        return 0;
 }