diff options
author | Sean Hefty <sean.hefty@intel.com> | 2013-05-29 13:09:30 -0400 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2013-06-21 02:35:42 -0400 |
commit | 05ad94577ecd5a101889d04aa099b738ec5ee34f (patch) | |
tree | 24394fe2bcee72de80d91fa4c32426d2c9fee91a | |
parent | edaa7a5578988bcf12f68f14fb002bc0c87e2801 (diff) |
RDMA/ucma: Name changes to indicate only IP addresses supported
Several commands into the RDMA CM from user space are restricted to
supporting addresses which fit into a sockaddr_in6 structure: bind
address, resolve address, and join multicast.
With the addition of AF_IB, we need to support addresses which are
larger than sockaddr_in6. This will be done by adding new commands
that exchange address information using sockaddr_storage. However, to
support existing applications, we maintain the current commands and
structures, but rename them to indicate that they only support IPv4
and v6 addresses.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r-- | drivers/infiniband/core/ucma.c | 60 | ||||
-rw-r--r-- | include/uapi/rdma/rdma_user_cm.h | 12 |
2 files changed, 36 insertions, 36 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 45bb052f573e..82fb1e6e1384 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c | |||
@@ -512,10 +512,10 @@ static ssize_t ucma_destroy_id(struct ucma_file *file, const char __user *inbuf, | |||
512 | return ret; | 512 | return ret; |
513 | } | 513 | } |
514 | 514 | ||
515 | static ssize_t ucma_bind_addr(struct ucma_file *file, const char __user *inbuf, | 515 | static ssize_t ucma_bind_ip(struct ucma_file *file, const char __user *inbuf, |
516 | int in_len, int out_len) | 516 | int in_len, int out_len) |
517 | { | 517 | { |
518 | struct rdma_ucm_bind_addr cmd; | 518 | struct rdma_ucm_bind_ip cmd; |
519 | struct ucma_context *ctx; | 519 | struct ucma_context *ctx; |
520 | int ret; | 520 | int ret; |
521 | 521 | ||
@@ -531,11 +531,11 @@ static ssize_t ucma_bind_addr(struct ucma_file *file, const char __user *inbuf, | |||
531 | return ret; | 531 | return ret; |
532 | } | 532 | } |
533 | 533 | ||
534 | static ssize_t ucma_resolve_addr(struct ucma_file *file, | 534 | static ssize_t ucma_resolve_ip(struct ucma_file *file, |
535 | const char __user *inbuf, | 535 | const char __user *inbuf, |
536 | int in_len, int out_len) | 536 | int in_len, int out_len) |
537 | { | 537 | { |
538 | struct rdma_ucm_resolve_addr cmd; | 538 | struct rdma_ucm_resolve_ip cmd; |
539 | struct ucma_context *ctx; | 539 | struct ucma_context *ctx; |
540 | int ret; | 540 | int ret; |
541 | 541 | ||
@@ -1178,11 +1178,11 @@ static ssize_t ucma_notify(struct ucma_file *file, const char __user *inbuf, | |||
1178 | return ret; | 1178 | return ret; |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | static ssize_t ucma_join_multicast(struct ucma_file *file, | 1181 | static ssize_t ucma_join_ip_multicast(struct ucma_file *file, |
1182 | const char __user *inbuf, | 1182 | const char __user *inbuf, |
1183 | int in_len, int out_len) | 1183 | int in_len, int out_len) |
1184 | { | 1184 | { |
1185 | struct rdma_ucm_join_mcast cmd; | 1185 | struct rdma_ucm_join_ip_mcast cmd; |
1186 | struct rdma_ucm_create_id_resp resp; | 1186 | struct rdma_ucm_create_id_resp resp; |
1187 | struct ucma_context *ctx; | 1187 | struct ucma_context *ctx; |
1188 | struct ucma_multicast *mc; | 1188 | struct ucma_multicast *mc; |
@@ -1379,26 +1379,26 @@ file_put: | |||
1379 | static ssize_t (*ucma_cmd_table[])(struct ucma_file *file, | 1379 | static ssize_t (*ucma_cmd_table[])(struct ucma_file *file, |
1380 | const char __user *inbuf, | 1380 | const char __user *inbuf, |
1381 | int in_len, int out_len) = { | 1381 | int in_len, int out_len) = { |
1382 | [RDMA_USER_CM_CMD_CREATE_ID] = ucma_create_id, | 1382 | [RDMA_USER_CM_CMD_CREATE_ID] = ucma_create_id, |
1383 | [RDMA_USER_CM_CMD_DESTROY_ID] = ucma_destroy_id, | 1383 | [RDMA_USER_CM_CMD_DESTROY_ID] = ucma_destroy_id, |
1384 | [RDMA_USER_CM_CMD_BIND_ADDR] = ucma_bind_addr, | 1384 | [RDMA_USER_CM_CMD_BIND_IP] = ucma_bind_ip, |
1385 | [RDMA_USER_CM_CMD_RESOLVE_ADDR] = ucma_resolve_addr, | 1385 | [RDMA_USER_CM_CMD_RESOLVE_IP] = ucma_resolve_ip, |
1386 | [RDMA_USER_CM_CMD_RESOLVE_ROUTE]= ucma_resolve_route, | 1386 | [RDMA_USER_CM_CMD_RESOLVE_ROUTE] = ucma_resolve_route, |
1387 | [RDMA_USER_CM_CMD_QUERY_ROUTE] = ucma_query_route, | 1387 | [RDMA_USER_CM_CMD_QUERY_ROUTE] = ucma_query_route, |
1388 | [RDMA_USER_CM_CMD_CONNECT] = ucma_connect, | 1388 | [RDMA_USER_CM_CMD_CONNECT] = ucma_connect, |
1389 | [RDMA_USER_CM_CMD_LISTEN] = ucma_listen, | 1389 | [RDMA_USER_CM_CMD_LISTEN] = ucma_listen, |
1390 | [RDMA_USER_CM_CMD_ACCEPT] = ucma_accept, | 1390 | [RDMA_USER_CM_CMD_ACCEPT] = ucma_accept, |
1391 | [RDMA_USER_CM_CMD_REJECT] = ucma_reject, | 1391 | [RDMA_USER_CM_CMD_REJECT] = ucma_reject, |
1392 | [RDMA_USER_CM_CMD_DISCONNECT] = ucma_disconnect, | 1392 | [RDMA_USER_CM_CMD_DISCONNECT] = ucma_disconnect, |
1393 | [RDMA_USER_CM_CMD_INIT_QP_ATTR] = ucma_init_qp_attr, | 1393 | [RDMA_USER_CM_CMD_INIT_QP_ATTR] = ucma_init_qp_attr, |
1394 | [RDMA_USER_CM_CMD_GET_EVENT] = ucma_get_event, | 1394 | [RDMA_USER_CM_CMD_GET_EVENT] = ucma_get_event, |
1395 | [RDMA_USER_CM_CMD_GET_OPTION] = NULL, | 1395 | [RDMA_USER_CM_CMD_GET_OPTION] = NULL, |
1396 | [RDMA_USER_CM_CMD_SET_OPTION] = ucma_set_option, | 1396 | [RDMA_USER_CM_CMD_SET_OPTION] = ucma_set_option, |
1397 | [RDMA_USER_CM_CMD_NOTIFY] = ucma_notify, | 1397 | [RDMA_USER_CM_CMD_NOTIFY] = ucma_notify, |
1398 | [RDMA_USER_CM_CMD_JOIN_MCAST] = ucma_join_multicast, | 1398 | [RDMA_USER_CM_CMD_JOIN_IP_MCAST] = ucma_join_ip_multicast, |
1399 | [RDMA_USER_CM_CMD_LEAVE_MCAST] = ucma_leave_multicast, | 1399 | [RDMA_USER_CM_CMD_LEAVE_MCAST] = ucma_leave_multicast, |
1400 | [RDMA_USER_CM_CMD_MIGRATE_ID] = ucma_migrate_id, | 1400 | [RDMA_USER_CM_CMD_MIGRATE_ID] = ucma_migrate_id, |
1401 | [RDMA_USER_CM_CMD_QUERY] = ucma_query | 1401 | [RDMA_USER_CM_CMD_QUERY] = ucma_query |
1402 | }; | 1402 | }; |
1403 | 1403 | ||
1404 | static ssize_t ucma_write(struct file *filp, const char __user *buf, | 1404 | static ssize_t ucma_write(struct file *filp, const char __user *buf, |
diff --git a/include/uapi/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h index ea79253ceb13..79f68f7c9fd2 100644 --- a/include/uapi/rdma/rdma_user_cm.h +++ b/include/uapi/rdma/rdma_user_cm.h | |||
@@ -45,8 +45,8 @@ | |||
45 | enum { | 45 | enum { |
46 | RDMA_USER_CM_CMD_CREATE_ID, | 46 | RDMA_USER_CM_CMD_CREATE_ID, |
47 | RDMA_USER_CM_CMD_DESTROY_ID, | 47 | RDMA_USER_CM_CMD_DESTROY_ID, |
48 | RDMA_USER_CM_CMD_BIND_ADDR, | 48 | RDMA_USER_CM_CMD_BIND_IP, |
49 | RDMA_USER_CM_CMD_RESOLVE_ADDR, | 49 | RDMA_USER_CM_CMD_RESOLVE_IP, |
50 | RDMA_USER_CM_CMD_RESOLVE_ROUTE, | 50 | RDMA_USER_CM_CMD_RESOLVE_ROUTE, |
51 | RDMA_USER_CM_CMD_QUERY_ROUTE, | 51 | RDMA_USER_CM_CMD_QUERY_ROUTE, |
52 | RDMA_USER_CM_CMD_CONNECT, | 52 | RDMA_USER_CM_CMD_CONNECT, |
@@ -59,7 +59,7 @@ enum { | |||
59 | RDMA_USER_CM_CMD_GET_OPTION, | 59 | RDMA_USER_CM_CMD_GET_OPTION, |
60 | RDMA_USER_CM_CMD_SET_OPTION, | 60 | RDMA_USER_CM_CMD_SET_OPTION, |
61 | RDMA_USER_CM_CMD_NOTIFY, | 61 | RDMA_USER_CM_CMD_NOTIFY, |
62 | RDMA_USER_CM_CMD_JOIN_MCAST, | 62 | RDMA_USER_CM_CMD_JOIN_IP_MCAST, |
63 | RDMA_USER_CM_CMD_LEAVE_MCAST, | 63 | RDMA_USER_CM_CMD_LEAVE_MCAST, |
64 | RDMA_USER_CM_CMD_MIGRATE_ID, | 64 | RDMA_USER_CM_CMD_MIGRATE_ID, |
65 | RDMA_USER_CM_CMD_QUERY | 65 | RDMA_USER_CM_CMD_QUERY |
@@ -96,13 +96,13 @@ struct rdma_ucm_destroy_id_resp { | |||
96 | __u32 events_reported; | 96 | __u32 events_reported; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | struct rdma_ucm_bind_addr { | 99 | struct rdma_ucm_bind_ip { |
100 | __u64 response; | 100 | __u64 response; |
101 | struct sockaddr_in6 addr; | 101 | struct sockaddr_in6 addr; |
102 | __u32 id; | 102 | __u32 id; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | struct rdma_ucm_resolve_addr { | 105 | struct rdma_ucm_resolve_ip { |
106 | struct sockaddr_in6 src_addr; | 106 | struct sockaddr_in6 src_addr; |
107 | struct sockaddr_in6 dst_addr; | 107 | struct sockaddr_in6 dst_addr; |
108 | __u32 id; | 108 | __u32 id; |
@@ -216,7 +216,7 @@ struct rdma_ucm_notify { | |||
216 | __u32 event; | 216 | __u32 event; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | struct rdma_ucm_join_mcast { | 219 | struct rdma_ucm_join_ip_mcast { |
220 | __u64 response; /* rdma_ucm_create_id_resp */ | 220 | __u64 response; /* rdma_ucm_create_id_resp */ |
221 | __u64 uid; | 221 | __u64 uid; |
222 | struct sockaddr_in6 addr; | 222 | struct sockaddr_in6 addr; |