linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Harish Chegondi
	<harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Mike Marciniszyn
	<mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: [PATCH 32/37] IB/rdmavt: Add driver notification for new AH
Date: Mon, 07 Dec 2015 15:45:19 -0500	[thread overview]
Message-ID: <20151207204518.8144.70730.stgit@phlsvslse11.ph.intel.com> (raw)
In-Reply-To: <20151207204046.8144.18752.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>

Drivers may need to do some work once an address handle has been
created. Add a driver function for this purpose.

Reviewed-by: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Reviewed-by: Harish Chegondi <harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/infiniband/sw/rdmavt/ah.c |    7 +++++-
 include/rdma/rdma_vt.h            |   41 +++++++++++++++++++++++--------------
 2 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/drivers/infiniband/sw/rdmavt/ah.c b/drivers/infiniband/sw/rdmavt/ah.c
index 3e3d758..982c2ae 100644
--- a/drivers/infiniband/sw/rdmavt/ah.c
+++ b/drivers/infiniband/sw/rdmavt/ah.c
@@ -86,8 +86,8 @@ int rvt_check_ah(struct ib_device *ibdev,
 		    !(ah_attr->ah_flags & IB_AH_GRH))
 			return -EINVAL;
 	}
-	if (rdi->driver_f.check_ah(ibdev, ah_attr))
-		return -EINVAL;
+	if (rdi->driver_f.check_ah)
+		return rdi->driver_f.check_ah(ibdev, ah_attr);
 	return 0;
 }
 EXPORT_SYMBOL(rvt_check_ah);
@@ -126,6 +126,9 @@ struct ib_ah *rvt_create_ah(struct ib_pd *pd,
 	ah->attr = *ah_attr;
 	atomic_set(&ah->refcount, 0);
 
+	if (dev->driver_f.notify_new_ah)
+		dev->driver_f.notify_new_ah(pd->device, ah_attr, ah);
+
 	return &ah->ibah;
 }
 
diff --git a/include/rdma/rdma_vt.h b/include/rdma/rdma_vt.h
index 4ccae84..f75e7c7 100644
--- a/include/rdma/rdma_vt.h
+++ b/include/rdma/rdma_vt.h
@@ -470,9 +470,21 @@ struct rvt_driver_params {
 	int nports;
 };
 
-/*
- * Functions that drivers are required to support
- */
+/* Protection domain */
+struct rvt_pd {
+	struct ib_pd ibpd;
+	int user;               /* non-zero if created from user space */
+};
+
+/* Address handle */
+struct rvt_ah {
+	struct ib_ah ibah;
+	struct ib_ah_attr attr;
+	atomic_t refcount;
+	u8 vl;
+	u8 log_pmtu;
+};
+
 struct rvt_dev_info;
 struct rvt_driver_provided {
 	/*
@@ -481,23 +493,20 @@ struct rvt_driver_provided {
 	 * instead drivers are responsible for setting the correct callback for
 	 * this.
 	 */
+
+	/* -------------------*/
+	/* Required functions */
+	/* -------------------*/
 	int (*port_callback)(struct ib_device *, u8, struct kobject *);
 	const char * (*get_card_name)(struct rvt_dev_info *rdi);
 	struct pci_dev * (*get_pci_dev)(struct rvt_dev_info *rdi);
-	int (*check_ah)(struct ib_device *, struct ib_ah_attr *);
-};
 
-/* Protection domain */
-struct rvt_pd {
-	struct ib_pd ibpd;
-	int user;               /* non-zero if created from user space */
-};
-
-/* Address handle */
-struct rvt_ah {
-	struct ib_ah ibah;
-	struct ib_ah_attr attr;
-	atomic_t refcount;
+	/*--------------------*/
+	/* Optional functions */
+	/*--------------------*/
+	int (*check_ah)(struct ib_device *, struct ib_ah_attr *);
+	void (*notify_new_ah)(struct ib_device *, struct ib_ah_attr *,
+			      struct rvt_ah *);
 };
 
 struct rvt_dev_info {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-12-07 20:45 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 20:42 [PATCH 00/37] Add rdma verbs transport library Dennis Dalessandro
     [not found] ` <20151207204046.8144.18752.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 20:43   ` [PATCH 01/37] IB/rdmavt: Create module framework and handle driver registration Dennis Dalessandro
     [not found]     ` <20151207204300.8144.20089.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:28       ` Hefty, Sean
2015-12-08  5:55       ` Leon Romanovsky
     [not found]         ` <20151208055545.GC7313-2ukJVAZIZ/Y@public.gmane.org>
2015-12-08 23:06           ` Dennis Dalessandro
     [not found]             ` <20151208230612.GB14221-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-08 23:10               ` Hefty, Sean
2015-12-10 11:49       ` Haggai Eran
     [not found]         ` <566966CB.4080700-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-10 13:18           ` Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 02/37] IB/rdmavt: Consolidate dma ops in rdmavt Dennis Dalessandro
     [not found]     ` <20151207204305.8144.7038.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-08  6:08       ` Leon Romanovsky
     [not found]         ` <20151208060821.GD7313-2ukJVAZIZ/Y@public.gmane.org>
2015-12-10 16:17           ` Dennis Dalessandro
     [not found]             ` <20151210161708.GA13412-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 17:44               ` Jason Gunthorpe
     [not found]                 ` <20151210174413.GB21482-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-10 23:41                   ` Christoph Hellwig
     [not found]                     ` <20151210234112.GA15546-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-11  0:29                       ` Jason Gunthorpe
     [not found]                         ` <20151211002950.GA5964-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-11  0:46                           ` Christoph Hellwig
     [not found]                             ` <20151211004624.GA9994-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-11  6:02                               ` Jason Gunthorpe
     [not found]                                 ` <20151211060202.GA16513-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-11 14:10                                   ` Christoph Hellwig
2015-12-10 17:52               ` Leon Romanovsky
     [not found]                 ` <20151210175231.GD8662-2ukJVAZIZ/Y@public.gmane.org>
2015-12-10 19:52                   ` Dennis Dalessandro
2015-12-10 12:07       ` Haggai Eran
2015-12-07 20:43   ` [PATCH 03/37] IB/rdmavt: Add protection domain to rdmavt Dennis Dalessandro
     [not found]     ` <20151207204309.8144.26707.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:13       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373AAFE7252-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-08 19:08           ` ira.weiny
     [not found]             ` <20151208190854.GA16976-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-08 19:17               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A82373AAFE79BE-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-08 19:52                   ` ira.weiny
     [not found]                     ` <20151208195236.GC16976-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 16:49                       ` Dennis Dalessandro
     [not found]                         ` <20151210164939.GD13412-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 18:59                           ` ira.weiny
     [not found]                             ` <20151210185944.GA7855-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 19:10                               ` Hefty, Sean
2015-12-08  6:28       ` Leon Romanovsky
     [not found]         ` <20151208062816.GE7313-2ukJVAZIZ/Y@public.gmane.org>
2015-12-08  7:20           ` Leon Romanovsky
     [not found]             ` <20151208072027.GF7313-2ukJVAZIZ/Y@public.gmane.org>
2015-12-10 16:45               ` Dennis Dalessandro
2015-12-10 16:40           ` Dennis Dalessandro
     [not found]             ` <20151210164047.GB13412-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 17:54               ` Leon Romanovsky
2015-12-07 20:43   ` [PATCH 04/37] IB/rdmavt: Add ib core device attributes to rvt driver params list Dennis Dalessandro
     [not found]     ` <20151207204314.8144.46170.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-10 12:26       ` Haggai Eran
     [not found]         ` <56696F63.90707-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-10 13:25           ` Dennis Dalessandro
     [not found]             ` <20151210132523.GB11526-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 15:12               ` Haggai Eran
     [not found]                 ` <56699674.3030900-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-10 15:22                   ` Dennis Dalessandro
2015-12-10 12:29       ` Haggai Eran
     [not found]         ` <5669701E.7090302-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-12-10 13:35           ` Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 05/37] IB/rdmavt: Macroize override checks during driver registration Dennis Dalessandro
     [not found]     ` <20151207204318.8144.29135.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:23       ` Hefty, Sean
2015-12-07 20:43   ` [PATCH 06/37] IB/rdmavt: Add query and modify device stubs Dennis Dalessandro
     [not found]     ` <20151207204322.8144.60452.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:26       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373AAFE72C8-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-07 21:39           ` Jason Gunthorpe
     [not found]             ` <20151207213904.GA3113-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-12-08  7:29               ` Leon Romanovsky
2015-12-07 20:43   ` [PATCH 07/37] IB/rdmavt: Add query and modify port stubs Dennis Dalessandro
     [not found]     ` <20151207204327.8144.17959.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-08  8:06       ` Leon Romanovsky
2015-12-07 20:43   ` [PATCH 08/37] IB/rdmavt: Add pkey query stub Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 09/37] IB/rdmavt: Add query gid stub Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 10/37] IB/rdmavt: Alloc and dealloc ucontexts Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 11/37] IB/rdmavt: Add queue pair function stubs Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 12/37] IB/rdmavt: Add address handle stubs Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 13/37] IB/rdmavt: Add memory region stubs Dennis Dalessandro
2015-12-07 20:43   ` [PATCH 14/37] IB/rdmavt: Add SRQ stubs Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 15/37] IB/rdmavt: Add multicast stubs Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 16/37] IB/rdmavt: Add process MAD stub Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 17/37] IB/rdmavt: Add mmap stub Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 18/37] IB/rdmavt: Add get port immutable stub Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 19/37] IB/rdmavt: Add completion queue function stubs Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 20/37] IB/rdamvt: Add post send and recv stubs Dennis Dalessandro
     [not found]     ` <20151207204425.8144.34725.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-08 10:28       ` Moni Shoua
2015-12-07 20:44   ` [PATCH 21/37] IB/rdmavt: Move MR datastructures into rvt Dennis Dalessandro
     [not found]     ` <20151207204429.8144.62688.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:39       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373AAFE7322-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-14 16:07           ` Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 22/37] IB/rdmavt: Add queue pair data structure to rdmavt Dennis Dalessandro
     [not found]     ` <20151207204433.8144.93461.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-07 21:48       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A82373AAFE733B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-10 19:06           ` Dennis Dalessandro
     [not found]             ` <20151210190656.GE13412-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 19:12               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A82373AAFE87E8-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-14 16:29                   ` Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 23/37] IB/rdmavt: Move driver helper functions to a common structure Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 24/37] IB/rdmavt: Add device specific info prints Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 25/37] IB/rdmavt: Add the start of capability flags Dennis Dalessandro
2015-12-07 20:44   ` [PATCH 26/37] IB/rdmavt: Move memory registration into rdmavt Dennis Dalessandro
     [not found]     ` <20151207204451.8144.52356.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-10 14:24       ` Sagi Grimberg
     [not found]         ` <56698B2C.2010806-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-10 15:14           ` Dennis Dalessandro
     [not found]             ` <20151210151455.GD11526-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-10 15:25               ` Christoph Hellwig
2015-12-07 20:44   ` [PATCH 27/37] IB/rdmavt: Do not use rvt prints which rely on driver too early Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 28/37] IB/rdmavt: Add common LID defines to rdmavt Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 29/37] IB/rdmavt: Add AH " Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 30/37] IB/rdmavt: Move SRQ data structure into rdmavt Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 31/37] IB/rdmavt: Add an ibport data structure to rdmavt Dennis Dalessandro
2015-12-07 20:45   ` Dennis Dalessandro [this message]
2015-12-07 20:45   ` [PATCH 33/37] IB/rdmavt: Break rdma_vt main include header file up Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 34/37] IB/rdmavt: Initialize and teardown of qpn table Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 35/37] IB/rdmavt: Add mmap related functions Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 36/37] IB/rdmavt: Add pkey support Dennis Dalessandro
2015-12-07 20:45   ` [PATCH 37/37] IB/rdmavt: Add support for new memory registration API Dennis Dalessandro
     [not found]     ` <20151207204540.8144.94303.stgit-K+u1se/DcYrLESAwzcoQNrvm/XP+8Wra@public.gmane.org>
2015-12-10 15:02       ` Sagi Grimberg
     [not found]         ` <5669940D.4040402-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-14 16:18           ` Sagi Grimberg
     [not found]             ` <566EEBE8.8020007-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-14 17:14               ` Dennis Dalessandro
     [not found]                 ` <20151214171440.GC23833-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-16 13:21                   ` Sagi Grimberg
     [not found]                     ` <5671653E.40501-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-16 14:22                       ` Dennis Dalessandro
     [not found]                         ` <20151216142224.GA28117-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-16 14:37                           ` Sagi Grimberg
     [not found]                             ` <56717733.7070105-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-12-17 15:52                               ` Dennis Dalessandro
     [not found]                                 ` <20151217155228.GA29455-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-12-17 16:35                                   ` Christoph Hellwig
     [not found]                                     ` <20151217163553.GA22222-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2015-12-17 16:49                                       ` Dennis Dalessandro
2015-12-07 21:17   ` [PATCH 00/37] Add rdma verbs transport library Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A82373AAFE7265-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-12-08 22:59       ` Dennis Dalessandro
2015-12-09 12:21   ` Moni Shoua
     [not found]     ` <CAG9sBKPYwG3ug+CEOV--tLXcaa-M_1k5W6+LUeO7RciiRmeh7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-12-09 17:11       ` Dennis Dalessandro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151207204518.8144.70730.stgit@phlsvslse11.ph.intel.com \
    --to=dennis.dalessandro-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=harish.chegondi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).