aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>2017-04-29 14:41:17 -0400
committerDoug Ledford <dledford@redhat.com>2017-05-01 14:32:43 -0400
commiteca7ddf965e0d6b0b1e4e6dea207f2015b65d367 (patch)
tree0e17902a0ed3b769ca963fa78172606beec06a38
parent4ba66093bdc6316cd2fe48e74a54bfc29599322f (diff)
IB/rxe: Initialize ib_ah_attr during query_ah
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>
-rw-r--r--drivers/infiniband/sw/rxe/rxe_av.c1
-rw-r--r--drivers/infiniband/sw/rxe/rxe_verbs.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c
index 604f6fee96bd..88a4a7f15fbd 100644
--- a/drivers/infiniband/sw/rxe/rxe_av.c
+++ b/drivers/infiniband/sw/rxe/rxe_av.c
@@ -69,6 +69,7 @@ int rxe_av_to_attr(struct rxe_dev *rxe, struct rxe_av *av,
69 struct ib_ah_attr *attr) 69 struct ib_ah_attr *attr)
70{ 70{
71 memcpy(&attr->grh, &av->grh, sizeof(av->grh)); 71 memcpy(&attr->grh, &av->grh, sizeof(av->grh));
72 attr->ah_flags = IB_AH_GRH;
72 attr->port_num = av->port_num; 73 attr->port_num = av->port_num;
73 return 0; 74 return 0;
74} 75}
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index dbede3026138..b35201dd03bd 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -378,6 +378,7 @@ static int rxe_query_ah(struct ib_ah *ibah, struct ib_ah_attr *attr)
378 struct rxe_dev *rxe = to_rdev(ibah->device); 378 struct rxe_dev *rxe = to_rdev(ibah->device);
379 struct rxe_ah *ah = to_rah(ibah); 379 struct rxe_ah *ah = to_rah(ibah);
380 380
381 memset(attr, 0, sizeof(*attr));
381 rxe_av_to_attr(rxe, &ah->av, attr); 382 rxe_av_to_attr(rxe, &ah->av, attr);
382 return 0; 383 return 0;
383} 384}