Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/SA: Rename ib_sa_path_rec to sa_path_rec

Rename ib_sa_path_rec to a more generic sa_path_rec.
This is part of extending ib_sa to also support OPA
path records in addition to the IB defined path records.

Reviewed-by: Don Hiatt <don.hiatt@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Dasaratharaman Chandramouli and committed by
Doug Ledford
c2f8fc4e 82ffc226

+55 -55
+10 -10
drivers/infiniband/core/cm.c
··· 241 241 __be32 local_id; /* Established / timewait */ 242 242 __be32 remote_id; 243 243 struct ib_cm_event cm_event; 244 - struct ib_sa_path_rec path[0]; 244 + struct sa_path_rec path[0]; 245 245 }; 246 246 247 247 struct cm_timewait_info { ··· 440 440 grh, &av->ah_attr); 441 441 } 442 442 443 - static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av, 443 + static int cm_init_av_by_path(struct sa_path_rec *path, struct cm_av *av, 444 444 struct cm_id_private *cm_id_priv) 445 445 { 446 446 struct cm_device *cm_dev; ··· 1172 1172 struct cm_id_private *cm_id_priv, 1173 1173 struct ib_cm_req_param *param) 1174 1174 { 1175 - struct ib_sa_path_rec *pri_path = param->primary_path; 1176 - struct ib_sa_path_rec *alt_path = param->alternate_path; 1175 + struct sa_path_rec *pri_path = param->primary_path; 1176 + struct sa_path_rec *alt_path = param->alternate_path; 1177 1177 1178 1178 cm_format_mad_hdr(&req_msg->hdr, CM_REQ_ATTR_ID, 1179 1179 cm_form_tid(cm_id_priv, CM_MSG_SEQUENCE_REQ)); ··· 1401 1401 } 1402 1402 1403 1403 static void cm_format_paths_from_req(struct cm_req_msg *req_msg, 1404 - struct ib_sa_path_rec *primary_path, 1405 - struct ib_sa_path_rec *alt_path) 1404 + struct sa_path_rec *primary_path, 1405 + struct sa_path_rec *alt_path) 1406 1406 { 1407 1407 memset(primary_path, 0, sizeof(*primary_path)); 1408 1408 primary_path->dgid = req_msg->primary_local_gid; ··· 2815 2815 2816 2816 static void cm_format_lap(struct cm_lap_msg *lap_msg, 2817 2817 struct cm_id_private *cm_id_priv, 2818 - struct ib_sa_path_rec *alternate_path, 2818 + struct sa_path_rec *alternate_path, 2819 2819 const void *private_data, 2820 2820 u8 private_data_len) 2821 2821 { ··· 2845 2845 } 2846 2846 2847 2847 int ib_send_cm_lap(struct ib_cm_id *cm_id, 2848 - struct ib_sa_path_rec *alternate_path, 2848 + struct sa_path_rec *alternate_path, 2849 2849 const void *private_data, 2850 2850 u8 private_data_len) 2851 2851 { ··· 2899 2899 EXPORT_SYMBOL(ib_send_cm_lap); 2900 2900 2901 2901 static void cm_format_path_from_lap(struct cm_id_private *cm_id_priv, 2902 - struct ib_sa_path_rec *path, 2902 + struct sa_path_rec *path, 2903 2903 struct cm_lap_msg *lap_msg) 2904 2904 { 2905 2905 memset(path, 0, sizeof *path); ··· 3712 3712 atomic_long_inc(&port->counter_group[CM_RECV]. 3713 3713 counter[attr_id - CM_ATTR_ID_OFFSET]); 3714 3714 3715 - work = kmalloc(sizeof(*work) + sizeof(struct ib_sa_path_rec) * paths, 3715 + work = kmalloc(sizeof(*work) + sizeof(struct sa_path_rec) * paths, 3716 3716 GFP_KERNEL); 3717 3717 if (!work) { 3718 3718 ib_free_recv_mad(mad_recv_wc);
+4 -4
drivers/infiniband/core/cma.c
··· 1128 1128 static void cma_save_ib_info(struct sockaddr *src_addr, 1129 1129 struct sockaddr *dst_addr, 1130 1130 struct rdma_cm_id *listen_id, 1131 - struct ib_sa_path_rec *path) 1131 + struct sa_path_rec *path) 1132 1132 { 1133 1133 struct sockaddr_ib *listen_ib, *ib; 1134 1134 ··· 2301 2301 } 2302 2302 EXPORT_SYMBOL(rdma_set_service_type); 2303 2303 2304 - static void cma_query_handler(int status, struct ib_sa_path_rec *path_rec, 2304 + static void cma_query_handler(int status, struct sa_path_rec *path_rec, 2305 2305 void *context) 2306 2306 { 2307 2307 struct cma_work *work = context; ··· 2328 2328 struct cma_work *work) 2329 2329 { 2330 2330 struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr; 2331 - struct ib_sa_path_rec path_rec; 2331 + struct sa_path_rec path_rec; 2332 2332 ib_sa_comp_mask comp_mask; 2333 2333 struct sockaddr_in6 *sin6; 2334 2334 struct sockaddr_ib *sib; ··· 2453 2453 } 2454 2454 2455 2455 int rdma_set_ib_paths(struct rdma_cm_id *id, 2456 - struct ib_sa_path_rec *path_rec, int num_paths) 2456 + struct sa_path_rec *path_rec, int num_paths) 2457 2457 { 2458 2458 struct rdma_id_private *id_priv; 2459 2459 int ret;
+10 -10
drivers/infiniband/core/sa_query.c
··· 129 129 }; 130 130 131 131 struct ib_sa_path_query { 132 - void (*callback)(int, struct ib_sa_path_rec *, void *); 132 + void (*callback)(int, struct sa_path_rec *, void *); 133 133 void *context; 134 134 struct ib_sa_query sa_query; 135 135 }; ··· 188 188 static u32 tid; 189 189 190 190 #define PATH_REC_FIELD(field) \ 191 - .struct_offset_bytes = offsetof(struct ib_sa_path_rec, field), \ 192 - .struct_size_bytes = sizeof ((struct ib_sa_path_rec *) 0)->field, \ 191 + .struct_offset_bytes = offsetof(struct sa_path_rec, field), \ 192 + .struct_size_bytes = sizeof((struct sa_path_rec *)0)->field, \ 193 193 .field_name = "sa_path_rec:" #field 194 194 195 195 static const struct ib_field path_rec_table[] = { ··· 618 618 static void ib_nl_set_path_rec_attrs(struct sk_buff *skb, 619 619 struct ib_sa_query *query) 620 620 { 621 - struct ib_sa_path_rec *sa_rec = query->mad_buf->context[1]; 621 + struct sa_path_rec *sa_rec = query->mad_buf->context[1]; 622 622 struct ib_sa_mad *mad = query->mad_buf->mad; 623 623 ib_sa_comp_mask comp_mask = mad->sa_hdr.comp_mask; 624 624 u16 val16; ··· 1099 1099 } 1100 1100 1101 1101 int ib_init_ah_from_path(struct ib_device *device, u8 port_num, 1102 - struct ib_sa_path_rec *rec, 1102 + struct sa_path_rec *rec, 1103 1103 struct rdma_ah_attr *ah_attr) 1104 1104 { 1105 1105 int ret; ··· 1301 1301 return ret ? ret : id; 1302 1302 } 1303 1303 1304 - void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec) 1304 + void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec) 1305 1305 { 1306 1306 ib_unpack(path_rec_table, ARRAY_SIZE(path_rec_table), attribute, rec); 1307 1307 } 1308 1308 EXPORT_SYMBOL(ib_sa_unpack_path); 1309 1309 1310 - void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute) 1310 + void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute) 1311 1311 { 1312 1312 ib_pack(path_rec_table, ARRAY_SIZE(path_rec_table), rec, attribute); 1313 1313 } ··· 1321 1321 container_of(sa_query, struct ib_sa_path_query, sa_query); 1322 1322 1323 1323 if (mad) { 1324 - struct ib_sa_path_rec rec; 1324 + struct sa_path_rec rec; 1325 1325 1326 1326 ib_unpack(path_rec_table, ARRAY_SIZE(path_rec_table), 1327 1327 mad->data, &rec); ··· 1366 1366 */ 1367 1367 int ib_sa_path_rec_get(struct ib_sa_client *client, 1368 1368 struct ib_device *device, u8 port_num, 1369 - struct ib_sa_path_rec *rec, 1369 + struct sa_path_rec *rec, 1370 1370 ib_sa_comp_mask comp_mask, 1371 1371 int timeout_ms, gfp_t gfp_mask, 1372 1372 void (*callback)(int status, 1373 - struct ib_sa_path_rec *resp, 1373 + struct sa_path_rec *resp, 1374 1374 void *context), 1375 1375 void *context, 1376 1376 struct ib_sa_query **sa_query)
+3 -3
drivers/infiniband/core/ucm.c
··· 702 702 return 0; 703 703 } 704 704 705 - static int ib_ucm_path_get(struct ib_sa_path_rec **path, u64 src) 705 + static int ib_ucm_path_get(struct sa_path_rec **path, u64 src) 706 706 { 707 707 struct ib_user_path_rec upath; 708 - struct ib_sa_path_rec *sa_path; 708 + struct sa_path_rec *sa_path; 709 709 710 710 *path = NULL; 711 711 ··· 962 962 int in_len, int out_len) 963 963 { 964 964 struct ib_ucm_context *ctx; 965 - struct ib_sa_path_rec *path = NULL; 965 + struct sa_path_rec *path = NULL; 966 966 struct ib_ucm_lap cmd; 967 967 const void *data = NULL; 968 968 int result;
+1 -1
drivers/infiniband/core/ucma.c
··· 1197 1197 static int ucma_set_ib_path(struct ucma_context *ctx, 1198 1198 struct ib_path_rec_data *path_data, size_t optlen) 1199 1199 { 1200 - struct ib_sa_path_rec sa_path; 1200 + struct sa_path_rec sa_path; 1201 1201 struct rdma_cm_event event; 1202 1202 int ret; 1203 1203
+2 -2
drivers/infiniband/core/uverbs_marshall.c
··· 97 97 EXPORT_SYMBOL(ib_copy_qp_attr_to_user); 98 98 99 99 void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst, 100 - struct ib_sa_path_rec *src) 100 + struct sa_path_rec *src) 101 101 { 102 102 memcpy(dst->dgid, src->dgid.raw, sizeof src->dgid); 103 103 memcpy(dst->sgid, src->sgid.raw, sizeof src->sgid); ··· 122 122 } 123 123 EXPORT_SYMBOL(ib_copy_path_rec_to_user); 124 124 125 - void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst, 125 + void ib_copy_path_rec_from_user(struct sa_path_rec *dst, 126 126 struct ib_user_path_rec *src) 127 127 { 128 128 memcpy(dst->dgid.raw, src->dgid, sizeof dst->dgid);
+1 -1
drivers/infiniband/ulp/ipoib/ipoib.h
··· 423 423 424 424 struct ipoib_path { 425 425 struct net_device *dev; 426 - struct ib_sa_path_rec pathrec; 426 + struct sa_path_rec pathrec; 427 427 struct ipoib_ah *ah; 428 428 struct sk_buff_head queue; 429 429
+3 -3
drivers/infiniband/ulp/ipoib/ipoib_cm.c
··· 1068 1068 static int ipoib_cm_send_req(struct net_device *dev, 1069 1069 struct ib_cm_id *id, struct ib_qp *qp, 1070 1070 u32 qpn, 1071 - struct ib_sa_path_rec *pathrec) 1071 + struct sa_path_rec *pathrec) 1072 1072 { 1073 1073 struct ipoib_dev_priv *priv = ipoib_priv(dev); 1074 1074 struct ipoib_cm_data data = {}; ··· 1128 1128 } 1129 1129 1130 1130 static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn, 1131 - struct ib_sa_path_rec *pathrec) 1131 + struct sa_path_rec *pathrec) 1132 1132 { 1133 1133 struct ipoib_dev_priv *priv = ipoib_priv(p->dev); 1134 1134 int ret; ··· 1332 1332 struct ipoib_path *path; 1333 1333 int ret; 1334 1334 1335 - struct ib_sa_path_rec pathrec; 1335 + struct sa_path_rec pathrec; 1336 1336 u32 qpn; 1337 1337 1338 1338 netif_tx_lock_bh(dev);
+1 -1
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 716 716 } 717 717 718 718 static void path_rec_completion(int status, 719 - struct ib_sa_path_rec *pathrec, 719 + struct sa_path_rec *pathrec, 720 720 void *path_ptr) 721 721 { 722 722 struct ipoib_path *path = path_ptr;
+1 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 643 643 } 644 644 645 645 static void srp_path_rec_completion(int status, 646 - struct ib_sa_path_rec *pathrec, 646 + struct sa_path_rec *pathrec, 647 647 void *ch_ptr) 648 648 { 649 649 struct srp_rdma_ch *ch = ch_ptr;
+1 -1
drivers/infiniband/ulp/srp/ib_srp.h
··· 152 152 struct completion done; 153 153 int status; 154 154 155 - struct ib_sa_path_rec path; 155 + struct sa_path_rec path; 156 156 struct ib_sa_query *path_query; 157 157 int path_query_id; 158 158
+7 -7
include/rdma/ib_cm.h
··· 117 117 118 118 u8 port; 119 119 120 - struct ib_sa_path_rec *primary_path; 121 - struct ib_sa_path_rec *alternate_path; 120 + struct sa_path_rec *primary_path; 121 + struct sa_path_rec *alternate_path; 122 122 123 123 __be64 remote_ca_guid; 124 124 u32 remote_qkey; ··· 197 197 }; 198 198 199 199 struct ib_cm_lap_event_param { 200 - struct ib_sa_path_rec *alternate_path; 200 + struct sa_path_rec *alternate_path; 201 201 }; 202 202 203 203 enum ib_cm_apr_status { ··· 363 363 __be64 service_id); 364 364 365 365 struct ib_cm_req_param { 366 - struct ib_sa_path_rec *primary_path; 367 - struct ib_sa_path_rec *alternate_path; 366 + struct sa_path_rec *primary_path; 367 + struct sa_path_rec *alternate_path; 368 368 __be64 service_id; 369 369 u32 qp_num; 370 370 enum ib_qp_type qp_type; ··· 521 521 * @private_data_len: Size of the private data buffer, in bytes. 522 522 */ 523 523 int ib_send_cm_lap(struct ib_cm_id *cm_id, 524 - struct ib_sa_path_rec *alternate_path, 524 + struct sa_path_rec *alternate_path, 525 525 const void *private_data, 526 526 u8 private_data_len); 527 527 ··· 565 565 u8 private_data_len); 566 566 567 567 struct ib_cm_sidr_req_param { 568 - struct ib_sa_path_rec *path; 568 + struct sa_path_rec *path; 569 569 __be64 service_id; 570 570 int timeout_ms; 571 571 const void *private_data;
+2 -2
include/rdma/ib_marshall.h
··· 45 45 struct rdma_ah_attr *src); 46 46 47 47 void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst, 48 - struct ib_sa_path_rec *src); 48 + struct sa_path_rec *src); 49 49 50 - void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst, 50 + void ib_copy_path_rec_from_user(struct sa_path_rec *dst, 51 51 struct ib_user_path_rec *src); 52 52 53 53 #endif /* IB_USER_MARSHALL_H */
+7 -7
include/rdma/ib_sa.h
··· 148 148 #define IB_SA_PATH_REC_PACKET_LIFE_TIME IB_SA_COMP_MASK(21) 149 149 #define IB_SA_PATH_REC_PREFERENCE IB_SA_COMP_MASK(22) 150 150 151 - struct ib_sa_path_rec { 151 + struct sa_path_rec { 152 152 __be64 service_id; 153 153 union ib_gid dgid; 154 154 union ib_gid sgid; ··· 179 179 enum ib_gid_type gid_type; 180 180 }; 181 181 182 - static inline struct net_device *ib_get_ndev_from_path(struct ib_sa_path_rec *rec) 182 + static inline struct net_device *ib_get_ndev_from_path(struct sa_path_rec *rec) 183 183 { 184 184 return rec->net ? dev_get_by_index(rec->net, rec->ifindex) : NULL; 185 185 } ··· 323 323 324 324 int ib_sa_path_rec_get(struct ib_sa_client *client, 325 325 struct ib_device *device, u8 port_num, 326 - struct ib_sa_path_rec *rec, 326 + struct sa_path_rec *rec, 327 327 ib_sa_comp_mask comp_mask, 328 328 int timeout_ms, gfp_t gfp_mask, 329 329 void (*callback)(int status, 330 - struct ib_sa_path_rec *resp, 330 + struct sa_path_rec *resp, 331 331 void *context), 332 332 void *context, 333 333 struct ib_sa_query **query); ··· 428 428 * path record. 429 429 */ 430 430 int ib_init_ah_from_path(struct ib_device *device, u8 port_num, 431 - struct ib_sa_path_rec *rec, 431 + struct sa_path_rec *rec, 432 432 struct rdma_ah_attr *ah_attr); 433 433 434 434 /** 435 435 * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec 436 436 * to IB MAD wire format. 437 437 */ 438 - void ib_sa_pack_path(struct ib_sa_path_rec *rec, void *attribute); 438 + void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute); 439 439 440 440 /** 441 441 * ib_sa_unpack_path - Convert a path record from MAD format to struct 442 442 * ib_sa_path_rec. 443 443 */ 444 - void ib_sa_unpack_path(void *attribute, struct ib_sa_path_rec *rec); 444 + void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec); 445 445 446 446 /* Support GuidInfoRecord */ 447 447 int ib_sa_guid_info_rec_query(struct ib_sa_client *client,
+1 -1
include/rdma/rdma_cm.h
··· 85 85 86 86 struct rdma_route { 87 87 struct rdma_addr addr; 88 - struct ib_sa_path_rec *path_rec; 88 + struct sa_path_rec *path_rec; 89 89 int num_paths; 90 90 }; 91 91
+1 -1
include/rdma/rdma_cm_ib.h
··· 46 46 * connection and replaces the call to rdma_resolve_route. 47 47 */ 48 48 int rdma_set_ib_paths(struct rdma_cm_id *id, 49 - struct ib_sa_path_rec *path_rec, int num_paths); 49 + struct sa_path_rec *path_rec, int num_paths); 50 50 51 51 /* Global qkey for UDP QPs and multicast groups. */ 52 52 #define RDMA_UDP_QKEY 0x01234567