]> git.openfabrics.org - ~shefty/libibverbs.git/commitdiff
Make the gid argument to ibv_attach_mcast and ibv_detach_mcast const
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Sun, 19 Jul 2009 05:26:34 +0000 (23:26 -0600)
committerRoland Dreier <rolandd@cisco.com>
Wed, 22 Jul 2009 19:34:03 +0000 (12:34 -0700)
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>
include/infiniband/driver.h
include/infiniband/verbs.h
man/ibv_attach_mcast.3
src/cmd.c
src/verbs.c

index 67a3bf8010c65ed694208de3be9745a0821c6ea2..e54e0e3d7b5185b61ecb68f2915685f0caa667d1 100644 (file)
@@ -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);
index a04cc6221e1856b59f86510420f1764937ea4137..226d85e15f03f765a86b469e1c84b30067a2a942 100644 (file)
@@ -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
index 7d83d568b826fe67b5af739e6736692fad55ebed..722ac9f468e3397636ad0555ab542b9e5475b91e 100644 (file)
@@ -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"
index 66d7134ba8d00ba1148724850f112fc77f99daec..c2e76cfdf80edcb366b14c5a473fcad3231aff83 100644 (file)
--- 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;
 
index 9e370ceed6b896232b221b2d46c4aec31d576ec6..477e412986f9d404802efe7ee1146dc0a4ecab4c 100644 (file)
@@ -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);
 }