diff mbox

[4/9] ib: Add udata argument to create_ah

Message ID 1472774969-18997-5-git-send-email-knut.omang@oracle.com (mailing list archive)
State Superseded
Headers show

Commit Message

Knut Omang Sept. 2, 2016, 12:09 a.m. UTC
Most of the ib device driver entry points supports optional
device specific parameter transfer between user space and kernel space
via the udata argument - add a similar argument for ib_create_ah.

Update all infiniband drivers to include this agument
in their driver entry point implementation.

Signed-off-by: Knut Omang <knut.omang@oracle.com>
---
 drivers/infiniband/core/uverbs_cmd.c         | 10 +++++++++-
 drivers/infiniband/core/verbs.c              |  2 +-
 drivers/infiniband/hw/cxgb3/iwch_provider.c  |  3 ++-
 drivers/infiniband/hw/cxgb4/provider.c       |  3 ++-
 drivers/infiniband/hw/mlx4/ah.c              |  3 ++-
 drivers/infiniband/hw/mlx4/mlx4_ib.h         |  3 ++-
 drivers/infiniband/hw/mlx5/ah.c              |  3 ++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h         |  3 ++-
 drivers/infiniband/hw/mthca/mthca_provider.c |  3 ++-
 drivers/infiniband/hw/nes/nes_verbs.c        |  3 ++-
 drivers/infiniband/hw/ocrdma/ocrdma_ah.c     |  5 +++--
 drivers/infiniband/hw/ocrdma/ocrdma_ah.h     |  3 ++-
 drivers/infiniband/hw/usnic/usnic_ib_verbs.c |  3 ++-
 drivers/infiniband/hw/usnic/usnic_ib_verbs.h |  3 ++-
 drivers/infiniband/sw/rxe/rxe_verbs.c        |  3 ++-
 include/rdma/ib_verbs.h                      |  3 ++-
 16 files changed, 39 insertions(+), 17 deletions(-)

Comments

kernel test robot Sept. 2, 2016, 12:38 a.m. UTC | #1
Hi Knut,

[auto build test ERROR on rdma/master]
[also build test ERROR on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Knut-Omang/SIF-related-verbs-patches/20160902-081205
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 5.4.0-6) 5.4.0 20160609
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All errors (new ones prefixed by >>):

   drivers/infiniband/hw/i40iw/i40iw_verbs.c: In function 'i40iw_init_rdma_device':
>> drivers/infiniband/hw/i40iw/i40iw_verbs.c:2650:27: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     iwibdev->ibdev.create_ah = i40iw_create_ah;
                              ^
   cc1: some warnings being treated as errors

vim +2650 drivers/infiniband/hw/i40iw/i40iw_verbs.c

d3749841 Faisal Latif      2016-01-20  2634  	iwibdev->ibdev.dealloc_ucontext = i40iw_dealloc_ucontext;
d3749841 Faisal Latif      2016-01-20  2635  	iwibdev->ibdev.mmap = i40iw_mmap;
d3749841 Faisal Latif      2016-01-20  2636  	iwibdev->ibdev.alloc_pd = i40iw_alloc_pd;
d3749841 Faisal Latif      2016-01-20  2637  	iwibdev->ibdev.dealloc_pd = i40iw_dealloc_pd;
d3749841 Faisal Latif      2016-01-20  2638  	iwibdev->ibdev.create_qp = i40iw_create_qp;
d3749841 Faisal Latif      2016-01-20  2639  	iwibdev->ibdev.modify_qp = i40iw_modify_qp;
d3749841 Faisal Latif      2016-01-20  2640  	iwibdev->ibdev.query_qp = i40iw_query_qp;
d3749841 Faisal Latif      2016-01-20  2641  	iwibdev->ibdev.destroy_qp = i40iw_destroy_qp;
d3749841 Faisal Latif      2016-01-20  2642  	iwibdev->ibdev.create_cq = i40iw_create_cq;
d3749841 Faisal Latif      2016-01-20  2643  	iwibdev->ibdev.destroy_cq = i40iw_destroy_cq;
d3749841 Faisal Latif      2016-01-20  2644  	iwibdev->ibdev.get_dma_mr = i40iw_get_dma_mr;
d3749841 Faisal Latif      2016-01-20  2645  	iwibdev->ibdev.reg_user_mr = i40iw_reg_user_mr;
d3749841 Faisal Latif      2016-01-20  2646  	iwibdev->ibdev.dereg_mr = i40iw_dereg_mr;
b40f4757 Christoph Lameter 2016-05-16  2647  	iwibdev->ibdev.alloc_hw_stats = i40iw_alloc_hw_stats;
b40f4757 Christoph Lameter 2016-05-16  2648  	iwibdev->ibdev.get_hw_stats = i40iw_get_hw_stats;
d3749841 Faisal Latif      2016-01-20  2649  	iwibdev->ibdev.query_device = i40iw_query_device;
d3749841 Faisal Latif      2016-01-20 @2650  	iwibdev->ibdev.create_ah = i40iw_create_ah;
d3749841 Faisal Latif      2016-01-20  2651  	iwibdev->ibdev.destroy_ah = i40iw_destroy_ah;
c2b75ef7 Ismail, Mustafa   2016-04-18  2652  	iwibdev->ibdev.drain_sq = i40iw_drain_sq;
c2b75ef7 Ismail, Mustafa   2016-04-18  2653  	iwibdev->ibdev.drain_rq = i40iw_drain_rq;
b7aee855 Ismail, Mustafa   2016-04-18  2654  	iwibdev->ibdev.alloc_mr = i40iw_alloc_mr;
b7aee855 Ismail, Mustafa   2016-04-18  2655  	iwibdev->ibdev.map_mr_sg = i40iw_map_mr_sg;
d3749841 Faisal Latif      2016-01-20  2656  	iwibdev->ibdev.iwcm = kzalloc(sizeof(*iwibdev->ibdev.iwcm), GFP_KERNEL);
d3749841 Faisal Latif      2016-01-20  2657  	if (!iwibdev->ibdev.iwcm) {
d3749841 Faisal Latif      2016-01-20  2658  		ib_dealloc_device(&iwibdev->ibdev);

:::::: The code at line 2650 was first introduced by commit
:::::: d37498417947cb2299fc749ae4af1d204c768cba i40iw: add files for iwarp interface

:::::: TO: Faisal Latif <faisal.latif@intel.com>
:::::: CC: Doug Ledford <dledford@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Sept. 2, 2016, 12:39 a.m. UTC | #2
Hi Knut,

[auto build test WARNING on rdma/master]
[also build test WARNING on v4.8-rc4 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url:    https://github.com/0day-ci/linux/commits/Knut-Omang/SIF-related-verbs-patches/20160902-081205
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master
config: tile-allyesconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=tile 

All warnings (new ones prefixed by >>):

   drivers/infiniband/hw/i40iw/i40iw_verbs.c: In function 'i40iw_init_rdma_device':
>> drivers/infiniband/hw/i40iw/i40iw_verbs.c:2650:27: warning: assignment from incompatible pointer type [enabled by default]

vim +2650 drivers/infiniband/hw/i40iw/i40iw_verbs.c

d3749841 Faisal Latif      2016-01-20  2634  	iwibdev->ibdev.dealloc_ucontext = i40iw_dealloc_ucontext;
d3749841 Faisal Latif      2016-01-20  2635  	iwibdev->ibdev.mmap = i40iw_mmap;
d3749841 Faisal Latif      2016-01-20  2636  	iwibdev->ibdev.alloc_pd = i40iw_alloc_pd;
d3749841 Faisal Latif      2016-01-20  2637  	iwibdev->ibdev.dealloc_pd = i40iw_dealloc_pd;
d3749841 Faisal Latif      2016-01-20  2638  	iwibdev->ibdev.create_qp = i40iw_create_qp;
d3749841 Faisal Latif      2016-01-20  2639  	iwibdev->ibdev.modify_qp = i40iw_modify_qp;
d3749841 Faisal Latif      2016-01-20  2640  	iwibdev->ibdev.query_qp = i40iw_query_qp;
d3749841 Faisal Latif      2016-01-20  2641  	iwibdev->ibdev.destroy_qp = i40iw_destroy_qp;
d3749841 Faisal Latif      2016-01-20  2642  	iwibdev->ibdev.create_cq = i40iw_create_cq;
d3749841 Faisal Latif      2016-01-20  2643  	iwibdev->ibdev.destroy_cq = i40iw_destroy_cq;
d3749841 Faisal Latif      2016-01-20  2644  	iwibdev->ibdev.get_dma_mr = i40iw_get_dma_mr;
d3749841 Faisal Latif      2016-01-20  2645  	iwibdev->ibdev.reg_user_mr = i40iw_reg_user_mr;
d3749841 Faisal Latif      2016-01-20  2646  	iwibdev->ibdev.dereg_mr = i40iw_dereg_mr;
b40f4757 Christoph Lameter 2016-05-16  2647  	iwibdev->ibdev.alloc_hw_stats = i40iw_alloc_hw_stats;
b40f4757 Christoph Lameter 2016-05-16  2648  	iwibdev->ibdev.get_hw_stats = i40iw_get_hw_stats;
d3749841 Faisal Latif      2016-01-20  2649  	iwibdev->ibdev.query_device = i40iw_query_device;
d3749841 Faisal Latif      2016-01-20 @2650  	iwibdev->ibdev.create_ah = i40iw_create_ah;
d3749841 Faisal Latif      2016-01-20  2651  	iwibdev->ibdev.destroy_ah = i40iw_destroy_ah;
c2b75ef7 Ismail, Mustafa   2016-04-18  2652  	iwibdev->ibdev.drain_sq = i40iw_drain_sq;
c2b75ef7 Ismail, Mustafa   2016-04-18  2653  	iwibdev->ibdev.drain_rq = i40iw_drain_rq;
b7aee855 Ismail, Mustafa   2016-04-18  2654  	iwibdev->ibdev.alloc_mr = i40iw_alloc_mr;
b7aee855 Ismail, Mustafa   2016-04-18  2655  	iwibdev->ibdev.map_mr_sg = i40iw_map_mr_sg;
d3749841 Faisal Latif      2016-01-20  2656  	iwibdev->ibdev.iwcm = kzalloc(sizeof(*iwibdev->ibdev.iwcm), GFP_KERNEL);
d3749841 Faisal Latif      2016-01-20  2657  	if (!iwibdev->ibdev.iwcm) {
d3749841 Faisal Latif      2016-01-20  2658  		ib_dealloc_device(&iwibdev->ibdev);

:::::: The code at line 2650 was first introduced by commit
:::::: d37498417947cb2299fc749ae4af1d204c768cba i40iw: add files for iwarp interface

:::::: TO: Faisal Latif <faisal.latif@intel.com>
:::::: CC: Doug Ledford <dledford@redhat.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
Knut Omang Sept. 2, 2016, 8:01 a.m. UTC | #3
Good catch by the robot - I am obviously missing a few options in my test .config
Will fix both of these.

Knut

On Fri, 2016-09-02 at 08:39 +0800, kbuild test robot wrote:
> Hi Knut,
> 
> [auto build test WARNING on rdma/master]
> [also build test WARNING on v4.8-rc4 next-20160825]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> [Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch
> series was built on]
> [Check https://git-scm.com/docs/git-format-patch for more information]
> 
> url:    https://github.com/0day-ci/linux/commits/Knut-Omang/SIF-related-verbs-patches/20160902-081205
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git master
> config: tile-allyesconfig (attached as .config)
> compiler: tilegx-linux-gcc (GCC) 4.6.2
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=tile 
> 
> All warnings (new ones prefixed by >>):
> 
>    drivers/infiniband/hw/i40iw/i40iw_verbs.c: In function 'i40iw_init_rdma_device':
> > 
> > > 
> > > drivers/infiniband/hw/i40iw/i40iw_verbs.c:2650:27: warning: assignment from incompatible pointer type [enabled by default]
> vim +2650 drivers/infiniband/hw/i40iw/i40iw_verbs.c
> 
> d3749841 Faisal Latif      2016-01-20  2634  	iwibdev->ibdev.dealloc_ucontext = i40iw_dealloc_ucontext;
> d3749841 Faisal Latif      2016-01-20  2635  	iwibdev->ibdev.mmap = i40iw_mmap;
> d3749841 Faisal Latif      2016-01-20  2636  	iwibdev->ibdev.alloc_pd = i40iw_alloc_pd;
> d3749841 Faisal Latif      2016-01-20  2637  	iwibdev->ibdev.dealloc_pd = i40iw_dealloc_pd;
> d3749841 Faisal Latif      2016-01-20  2638  	iwibdev->ibdev.create_qp = i40iw_create_qp;
> d3749841 Faisal Latif      2016-01-20  2639  	iwibdev->ibdev.modify_qp = i40iw_modify_qp;
> d3749841 Faisal Latif      2016-01-20  2640  	iwibdev->ibdev.query_qp = i40iw_query_qp;
> d3749841 Faisal Latif      2016-01-20  2641  	iwibdev->ibdev.destroy_qp = i40iw_destroy_qp;
> d3749841 Faisal Latif      2016-01-20  2642  	iwibdev->ibdev.create_cq = i40iw_create_cq;
> d3749841 Faisal Latif      2016-01-20  2643  	iwibdev->ibdev.destroy_cq = i40iw_destroy_cq;
> d3749841 Faisal Latif      2016-01-20  2644  	iwibdev->ibdev.get_dma_mr = i40iw_get_dma_mr;
> d3749841 Faisal Latif      2016-01-20  2645  	iwibdev->ibdev.reg_user_mr = i40iw_reg_user_mr;
> d3749841 Faisal Latif      2016-01-20  2646  	iwibdev->ibdev.dereg_mr = i40iw_dereg_mr;
> b40f4757 Christoph Lameter 2016-05-16  2647  	iwibdev->ibdev.alloc_hw_stats = i40iw_alloc_hw_stats;
> b40f4757 Christoph Lameter 2016-05-16  2648  	iwibdev->ibdev.get_hw_stats = i40iw_get_hw_stats;
> d3749841 Faisal Latif      2016-01-20  2649  	iwibdev->ibdev.query_device = i40iw_query_device;
> d3749841 Faisal Latif      2016-01-20 @2650  	iwibdev->ibdev.create_ah = i40iw_create_ah;
> d3749841 Faisal Latif      2016-01-20  2651  	iwibdev->ibdev.destroy_ah = i40iw_destroy_ah;
> c2b75ef7 Ismail, Mustafa   2016-04-18  2652  	iwibdev->ibdev.drain_sq = i40iw_drain_sq;
> c2b75ef7 Ismail, Mustafa   2016-04-18  2653  	iwibdev->ibdev.drain_rq = i40iw_drain_rq;
> b7aee855 Ismail, Mustafa   2016-04-18  2654  	iwibdev->ibdev.alloc_mr = i40iw_alloc_mr;
> b7aee855 Ismail, Mustafa   2016-04-18  2655  	iwibdev->ibdev.map_mr_sg = i40iw_map_mr_sg;
> d3749841 Faisal Latif      2016-01-20  2656  	iwibdev->ibdev.iwcm = kzalloc(sizeof(*iwibdev->ibdev.iwcm), GFP_KERNEL);
> d3749841 Faisal Latif      2016-01-20  2657  	if (!iwibdev->ibdev.iwcm) {
> d3749841 Faisal Latif      2016-01-20  2658  		ib_dealloc_device(&iwibdev->ibdev);
> 
> :::::: The code at line 2650 was first introduced by commit
> :::::: d37498417947cb2299fc749ae4af1d204c768cba i40iw: add files for iwarp interface
> 
> :::::: TO: Faisal Latif <faisal.latif@intel.com>
> :::::: CC: Doug Ledford <dledford@redhat.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
index f664731..dbc5885 100644
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@ -2874,6 +2874,7 @@  ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
 	struct ib_pd			*pd;
 	struct ib_ah			*ah;
 	struct ib_ah_attr		attr;
+	struct ib_udata                 udata;
 	int ret;
 
 	if (out_len < sizeof resp)
@@ -2882,6 +2883,10 @@  ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
 	if (copy_from_user(&cmd, buf, sizeof cmd))
 		return -EFAULT;
 
+	INIT_UDATA(&udata, buf + sizeof cmd,
+		(unsigned long) cmd.response + sizeof resp,
+		in_len - sizeof cmd, out_len - sizeof resp);
+
 	uobj = kmalloc(sizeof *uobj, GFP_KERNEL);
 	if (!uobj)
 		return -ENOMEM;
@@ -2908,14 +2913,17 @@  ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *file,
 	memset(&attr.dmac, 0, sizeof(attr.dmac));
 	memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16);
 
-	ah = ib_create_ah(pd, &attr);
+	ah = pd->device->create_ah(pd, &attr, &udata);
 	if (IS_ERR(ah)) {
 		ret = PTR_ERR(ah);
 		goto err_put;
 	}
 
+	ah->device  = pd->device;
+	ah->pd      = pd;
 	ah->uobject  = uobj;
 	uobj->object = ah;
+	atomic_inc(&pd->usecnt);
 
 	ret = idr_add_uobj(&ib_uverbs_ah_idr, uobj);
 	if (ret)
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index f2b776e..6efe23d 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -293,7 +293,7 @@  struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
 {
 	struct ib_ah *ah;
 
-	ah = pd->device->create_ah(pd, ah_attr);
+	ah = pd->device->create_ah(pd, ah_attr, NULL);
 
 	if (!IS_ERR(ah)) {
 		ah->device  = pd->device;
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 4225479..ffdf530 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -62,7 +62,8 @@ 
 #include "common.h"
 
 static struct ib_ah *iwch_ah_create(struct ib_pd *pd,
-				    struct ib_ah_attr *ah_attr)
+				    struct ib_ah_attr *ah_attr,
+				    struct ib_udata *udata)
 {
 	return ERR_PTR(-ENOSYS);
 }
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index df127ce..b476df0 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -59,7 +59,8 @@  module_param(fastreg_support, int, 0644);
 MODULE_PARM_DESC(fastreg_support, "Advertise fastreg support (default=1)");
 
 static struct ib_ah *c4iw_ah_create(struct ib_pd *pd,
-				    struct ib_ah_attr *ah_attr)
+				    struct ib_ah_attr *ah_attr,
+				    struct ib_udata *udata)
 {
 	return ERR_PTR(-ENOSYS);
 }
diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
index 5fc6233..1ea2ba3 100644
--- a/drivers/infiniband/hw/mlx4/ah.c
+++ b/drivers/infiniband/hw/mlx4/ah.c
@@ -124,7 +124,8 @@  static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
 	return &ah->ibah;
 }
 
-struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
+struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata)
 {
 	struct mlx4_ib_ah *ah;
 	struct ib_ah *ret;
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h
index 7c5832e..c3812e3 100644
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -740,7 +740,8 @@  int mlx4_ib_arm_cq(struct ib_cq *cq, enum ib_cq_notify_flags flags);
 void __mlx4_ib_cq_clean(struct mlx4_ib_cq *cq, u32 qpn, struct mlx4_ib_srq *srq);
 void mlx4_ib_cq_clean(struct mlx4_ib_cq *cq, u32 qpn, struct mlx4_ib_srq *srq);
 
-struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
+struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata);
 int mlx4_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr);
 int mlx4_ib_destroy_ah(struct ib_ah *ah);
 
diff --git a/drivers/infiniband/hw/mlx5/ah.c b/drivers/infiniband/hw/mlx5/ah.c
index 745efa4..b5d0f9a 100644
--- a/drivers/infiniband/hw/mlx5/ah.c
+++ b/drivers/infiniband/hw/mlx5/ah.c
@@ -64,7 +64,8 @@  static struct ib_ah *create_ib_ah(struct mlx5_ib_dev *dev,
 	return &ah->ibah;
 }
 
-struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
+struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata)
 {
 	struct mlx5_ib_ah *ah;
 	struct mlx5_ib_dev *dev = to_mdev(pd->device);
diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h
index a59034a..82a1ccd 100644
--- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
+++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
@@ -726,7 +726,8 @@  void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int wqe_index);
 int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey,
 		 u8 port, const struct ib_wc *in_wc, const struct ib_grh *in_grh,
 		 const void *in_mad, void *response_mad);
-struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
+struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata);
 int mlx5_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr);
 int mlx5_ib_destroy_ah(struct ib_ah *ah);
 struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd,
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 86c60dc..9618e32 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -409,7 +409,8 @@  static int mthca_dealloc_pd(struct ib_pd *pd)
 }
 
 static struct ib_ah *mthca_ah_create(struct ib_pd *pd,
-				     struct ib_ah_attr *ah_attr)
+				     struct ib_ah_attr *ah_attr,
+				     struct ib_udata *udata)
 {
 	int err;
 	struct mthca_ah *ah;
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index f417e1d..76862c9 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -771,7 +771,8 @@  static int nes_dealloc_pd(struct ib_pd *ibpd)
 /**
  * nes_create_ah
  */
-static struct ib_ah *nes_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
+static struct ib_ah *nes_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata)
 {
 	return ERR_PTR(-ENOSYS);
 }
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
index 797362a..c65ac291 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.c
@@ -154,7 +154,8 @@  static inline int set_av_attr(struct ocrdma_dev *dev, struct ocrdma_ah *ah,
 	return status;
 }
 
-struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
+struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr,
+			struct ib_udata *udata)
 {
 	u32 *ahid_addr;
 	int status;
@@ -203,7 +204,7 @@  struct ib_ah *ocrdma_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
 						      &sgid_attr.ndev->ifindex,
 						      NULL);
 		if (status) {
-			pr_err("%s(): Failed to resolve dmac from gid." 
+			pr_err("%s(): Failed to resolve dmac from gid."
 				"status = %d\n", __func__, status);
 			goto av_conf_err;
 		}
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_ah.h b/drivers/infiniband/hw/ocrdma/ocrdma_ah.h
index 3856dd4..327b888a 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_ah.h
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_ah.h
@@ -50,7 +50,8 @@  enum {
 	OCRDMA_AH_L3_TYPE_MASK		= 0x03,
 	OCRDMA_AH_L3_TYPE_SHIFT		= 0x1D /* 29 bits */
 };
-struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *);
+struct ib_ah *ocrdma_create_ah(struct ib_pd *, struct ib_ah_attr *,
+			struct ib_udata *);
 int ocrdma_destroy_ah(struct ib_ah *);
 int ocrdma_query_ah(struct ib_ah *, struct ib_ah_attr *);
 int ocrdma_modify_ah(struct ib_ah *, struct ib_ah_attr *);
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
index a5bfbba..9051193 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
@@ -738,7 +738,8 @@  int usnic_ib_mmap(struct ib_ucontext *context,
 
 /* In ib callbacks section -  Start of stub funcs */
 struct ib_ah *usnic_ib_create_ah(struct ib_pd *pd,
-					struct ib_ah_attr *ah_attr)
+				struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata)
 {
 	usnic_dbg("\n");
 	return ERR_PTR(-EPERM);
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.h b/drivers/infiniband/hw/usnic/usnic_ib_verbs.h
index 0d9d2e6a..1eecd8e 100644
--- a/drivers/infiniband/hw/usnic/usnic_ib_verbs.h
+++ b/drivers/infiniband/hw/usnic/usnic_ib_verbs.h
@@ -75,7 +75,8 @@  int usnic_ib_dealloc_ucontext(struct ib_ucontext *ibcontext);
 int usnic_ib_mmap(struct ib_ucontext *context,
 			struct vm_area_struct *vma);
 struct ib_ah *usnic_ib_create_ah(struct ib_pd *pd,
-					struct ib_ah_attr *ah_attr);
+				struct ib_ah_attr *ah_attr,
+				struct ib_udata *udata);
 int usnic_ib_destroy_ah(struct ib_ah *ah);
 int usnic_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
 			struct ib_send_wr **bad_wr);
diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.c b/drivers/infiniband/sw/rxe/rxe_verbs.c
index 4552be9..64ade0b 100644
--- a/drivers/infiniband/sw/rxe/rxe_verbs.c
+++ b/drivers/infiniband/sw/rxe/rxe_verbs.c
@@ -314,7 +314,8 @@  static int rxe_init_av(struct rxe_dev *rxe, struct ib_ah_attr *attr,
 	return err;
 }
 
-static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
+static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr,
+				struct ib_udata *udata)
 {
 	int err;
 	struct rxe_dev *rxe = to_rdev(ibpd->device);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 8e90dd2..192d591 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1879,7 +1879,8 @@  struct ib_device {
 					       struct ib_udata *udata);
 	int                        (*dealloc_pd)(struct ib_pd *pd);
 	struct ib_ah *             (*create_ah)(struct ib_pd *pd,
-						struct ib_ah_attr *ah_attr);
+						struct ib_ah_attr *ah_attr,
+						struct ib_udata *udata);
 	int                        (*modify_ah)(struct ib_ah *ah,
 						struct ib_ah_attr *ah_attr);
 	int                        (*query_ah)(struct ib_ah *ah,