aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2009-07-18 23:26:34 -0600
committerRoland Dreier <rolandd@cisco.com>2009-07-22 12:34:03 -0700
commite5ae2208026c398e5c515ef27b5bff3775ee1511 (patch)
tree8ec7fcb0743ba28c70b73d3923985e0af8758248
parent8af67ff9d4faa0d624f058148aee4e3fb0f12aab (diff)
downloadlibibverbs-e5ae2208026c398e5c515ef27b5bff3775ee1511.tar.gz
Make the gid argument to ibv_attach_mcast and ibv_detach_mcast const
ibv_attach_mcast() and ibv_detach_mcast() don't change the gid argument, so the arguments should be const to allow applications to pass in constant gids. This constness flows through to the driver call struct and into the drivers and back into ibv_cmd_attach_mcast()/ibv_cmd_detach_mcast(). Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--include/infiniband/driver.h4
-rw-r--r--include/infiniband/verbs.h8
-rw-r--r--man/ibv_attach_mcast.34
-rw-r--r--src/cmd.c4
-rw-r--r--src/verbs.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/include/infiniband/driver.h b/include/infiniband/driver.h
index 67a3bf8..e54e0e3 100644
--- a/include/infiniband/driver.h
+++ b/include/infiniband/driver.h
@@ -129,8 +129,8 @@ int ibv_cmd_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *wr,
int ibv_cmd_create_ah(struct ibv_pd *pd, struct ibv_ah *ah,
struct ibv_ah_attr *attr);
int ibv_cmd_destroy_ah(struct ibv_ah *ah);
-int ibv_cmd_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid);
-int ibv_cmd_detach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid);
+int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
+int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
int ibv_dontfork_range(void *base, size_t size);
int ibv_dofork_range(void *base, size_t size);
diff --git a/include/infiniband/verbs.h b/include/infiniband/verbs.h
index a04cc62..226d85e 100644
--- a/include/infiniband/verbs.h
+++ b/include/infiniband/verbs.h
@@ -676,9 +676,9 @@ struct ibv_context_ops {
struct ibv_recv_wr **bad_wr);
struct ibv_ah * (*create_ah)(struct ibv_pd *pd, struct ibv_ah_attr *attr);
int (*destroy_ah)(struct ibv_ah *ah);
- int (*attach_mcast)(struct ibv_qp *qp, union ibv_gid *gid,
+ int (*attach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
uint16_t lid);
- int (*detach_mcast)(struct ibv_qp *qp, union ibv_gid *gid,
+ int (*detach_mcast)(struct ibv_qp *qp, const union ibv_gid *gid,
uint16_t lid);
void (*async_event)(struct ibv_async_event *event);
};
@@ -1060,7 +1060,7 @@ int ibv_destroy_ah(struct ibv_ah *ah);
* the fabric appropriately. The port associated with the specified
* QP must also be a member of the multicast group.
*/
-int ibv_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid);
+int ibv_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
/**
* ibv_detach_mcast - Detaches the specified QP from a multicast group.
@@ -1068,7 +1068,7 @@ int ibv_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid);
* @gid: Multicast group GID.
* @lid: Multicast group LID in host byte order.
*/
-int ibv_detach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid);
+int ibv_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid);
/**
* ibv_fork_init - Prepare data structures so that fork() may be used
diff --git a/man/ibv_attach_mcast.3 b/man/ibv_attach_mcast.3
index 7d83d56..722ac9f 100644
--- a/man/ibv_attach_mcast.3
+++ b/man/ibv_attach_mcast.3
@@ -8,10 +8,10 @@ ibv_attach_mcast, ibv_detach_mcast \- attach and detach a queue pair
.nf
.B #include <infiniband/verbs.h>
.sp
-.BI "int ibv_attach_mcast(struct ibv_qp " "*qp" ", union ibv_gid " "*gid" ",
+.BI "int ibv_attach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ",
.BI " uint16_t " "lid" ");
.sp
-.BI "int ibv_detach_mcast(struct ibv_qp " "*qp" ", union ibv_gid " "*gid" ",
+.BI "int ibv_detach_mcast(struct ibv_qp " "*qp" ", const union ibv_gid " "*gid" ",
.BI " uint16_t " "lid" ");
.fi
.SH "DESCRIPTION"
diff --git a/src/cmd.c b/src/cmd.c
index 66d7134..c2e76cf 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -1091,7 +1091,7 @@ int ibv_cmd_destroy_qp(struct ibv_qp *qp)
return 0;
}
-int ibv_cmd_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid)
+int ibv_cmd_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)
{
struct ibv_attach_mcast cmd;
@@ -1107,7 +1107,7 @@ int ibv_cmd_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid)
return 0;
}
-int ibv_cmd_detach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid)
+int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)
{
struct ibv_detach_mcast cmd;
diff --git a/src/verbs.c b/src/verbs.c
index 9e370ce..477e412 100644
--- a/src/verbs.c
+++ b/src/verbs.c
@@ -532,13 +532,13 @@ int __ibv_destroy_ah(struct ibv_ah *ah)
}
default_symver(__ibv_destroy_ah, ibv_destroy_ah);
-int __ibv_attach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid)
+int __ibv_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)
{
return qp->context->ops.attach_mcast(qp, gid, lid);
}
default_symver(__ibv_attach_mcast, ibv_attach_mcast);
-int __ibv_detach_mcast(struct ibv_qp *qp, union ibv_gid *gid, uint16_t lid)
+int __ibv_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)
{
return qp->context->ops.detach_mcast(qp, gid, lid);
}