diff mbox

[2/4] nvmet-rdma: notify QP on Last WQE Reached event arrival

Message ID 1516197178-26493-3-git-send-email-maxg@mellanox.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Max Gurtovoy Jan. 17, 2018, 1:52 p.m. UTC
In order to avoid resource leakage for QP associated with
a Shared Receive Queue (SRQ), notify it on Last WQE Reached
event arrival.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
---
 drivers/nvme/target/rdma.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Steve Wise Jan. 17, 2018, 3:37 p.m. UTC | #1
> 
> In order to avoid resource leakage for QP associated with
> a Shared Receive Queue (SRQ), notify it on Last WQE Reached
> event arrival.
> 
> Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
> ---
>  drivers/nvme/target/rdma.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index 4991290..99a14a7 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -1151,6 +1151,9 @@ static void nvmet_rdma_qp_event(struct ib_event
> *event, void *priv)
>  	case IB_EVENT_COMM_EST:
>  		rdma_notify(queue->cm_id, event->event);
>  		break;
> +	case IB_EVENT_QP_LAST_WQE_REACHED:
> +		ib_notify_qp(queue->cm_id->qp, event->event);
> +		break;
>  	default:
>  		pr_err("received IB QP event: %s (%d)\n",
>  		       ib_event_msg(event->event), event->event);

I wonder if this could be handled in ib_dispatch_event() for all ULPS?



--
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
Bart Van Assche Jan. 18, 2018, 6:04 p.m. UTC | #2
On Wed, 2018-01-17 at 09:37 -0600, Steve Wise wrote:
> > 

> > In order to avoid resource leakage for QP associated with

> > a Shared Receive Queue (SRQ), notify it on Last WQE Reached

> > event arrival.

> > 

> > Signed-off-by: Max Gurtovoy <maxg@mellanox.com>

> > ---

> >  drivers/nvme/target/rdma.c | 3 +++

> >  1 file changed, 3 insertions(+)

> > 

> > diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c

> > index 4991290..99a14a7 100644

> > --- a/drivers/nvme/target/rdma.c

> > +++ b/drivers/nvme/target/rdma.c

> > @@ -1151,6 +1151,9 @@ static void nvmet_rdma_qp_event(struct ib_event

> > *event, void *priv)

> >  	case IB_EVENT_COMM_EST:

> >  		rdma_notify(queue->cm_id, event->event);

> >  		break;

> > +	case IB_EVENT_QP_LAST_WQE_REACHED:

> > +		ib_notify_qp(queue->cm_id->qp, event->event);

> > +		break;

> >  	default:

> >  		pr_err("received IB QP event: %s (%d)\n",

> >  		       ib_event_msg(event->event), event->event);

> 

> I wonder if this could be handled in ib_dispatch_event() for all ULPS?


As far as I can see all ib_dispatch_event() calls for IB_EVENT_QP_LAST_WQE_REACHED
set element.qp in struct ib_event. So I'd also like to see this proposal to be 
explored further.

Thanks,

Bart.
diff mbox

Patch

diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index 4991290..99a14a7 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -1151,6 +1151,9 @@  static void nvmet_rdma_qp_event(struct ib_event *event, void *priv)
 	case IB_EVENT_COMM_EST:
 		rdma_notify(queue->cm_id, event->event);
 		break;
+	case IB_EVENT_QP_LAST_WQE_REACHED:
+		ib_notify_qp(queue->cm_id->qp, event->event);
+		break;
 	default:
 		pr_err("received IB QP event: %s (%d)\n",
 		       ib_event_msg(event->event), event->event);