Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/cxgb4: notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event
@ 2025-01-03 10:07 Anumula Murali Mohan Reddy
  2025-01-05  9:06 ` Leon Romanovsky
  0 siblings, 1 reply; 2+ messages in thread
From: Anumula Murali Mohan Reddy @ 2025-01-03 10:07 UTC (permalink / raw)
  To: jgg, leonro; +Cc: linux-rdma, bharat, Anumula Murali Mohan Reddy

This patch sends IB_EVENT_QP_LAST_WQE_REACHED event on a QP that is in
error state and associated with an SRQ. This behaviour is incorporated
in flush_qp() which is called when QP transitions to error state.
Supports SRQ drain functionality added by commit 844bc12e6da3 ("IB/core:
add support for draining Shared receive queues")

Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
---
 drivers/infiniband/hw/cxgb4/qp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 7b5c4522b426..10f61bc16dd5 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1599,6 +1599,7 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
 	int count;
 	int rq_flushed = 0, sq_flushed;
 	unsigned long flag;
+	struct ib_event ev;
 
 	pr_debug("qhp %p rchp %p schp %p\n", qhp, rchp, schp);
 
@@ -1607,6 +1608,14 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
 	if (schp != rchp)
 		spin_lock(&schp->lock);
 	spin_lock(&qhp->lock);
+	if (qhp->srq) {
+		if (qhp->attr.state == C4IW_QP_STATE_ERROR && qhp->ibqp.event_handler) {
+			ev.device = qhp->ibqp.device;
+			ev.element.qp = &qhp->ibqp;
+			ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
+			qhp->ibqp.event_handler(&ev, qhp->ibqp.qp_context);
+		}
+	}
 
 	if (qhp->wq.flushed) {
 		spin_unlock(&qhp->lock);
-- 
2.39.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH for-rc] RDMA/cxgb4: notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event
  2025-01-03 10:07 [PATCH for-rc] RDMA/cxgb4: notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event Anumula Murali Mohan Reddy
@ 2025-01-05  9:06 ` Leon Romanovsky
  0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2025-01-05  9:06 UTC (permalink / raw)
  To: Anumula Murali Mohan Reddy; +Cc: jgg, linux-rdma, bharat

On Fri, Jan 03, 2025 at 03:37:21PM +0530, Anumula Murali Mohan Reddy wrote:
> This patch sends IB_EVENT_QP_LAST_WQE_REACHED event on a QP that is in
> error state and associated with an SRQ. This behaviour is incorporated
> in flush_qp() which is called when QP transitions to error state.
> Supports SRQ drain functionality added by commit 844bc12e6da3 ("IB/core:
> add support for draining Shared receive queues")
> 
> Signed-off-by: Anumula Murali Mohan Reddy <anumula@chelsio.com>
> Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
> ---
>  drivers/infiniband/hw/cxgb4/qp.c | 9 +++++++++
>  1 file changed, 9 insertions(+)

Please add fixes line.

> 
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index 7b5c4522b426..10f61bc16dd5 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -1599,6 +1599,7 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
>  	int count;
>  	int rq_flushed = 0, sq_flushed;
>  	unsigned long flag;
> +	struct ib_event ev;
>  
>  	pr_debug("qhp %p rchp %p schp %p\n", qhp, rchp, schp);
>  
> @@ -1607,6 +1608,14 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp,
>  	if (schp != rchp)
>  		spin_lock(&schp->lock);
>  	spin_lock(&qhp->lock);
> +	if (qhp->srq) {

Why is this event limited to QP with SRQ only?

Thanks

> +		if (qhp->attr.state == C4IW_QP_STATE_ERROR && qhp->ibqp.event_handler) {
> +			ev.device = qhp->ibqp.device;
> +			ev.element.qp = &qhp->ibqp;
> +			ev.event = IB_EVENT_QP_LAST_WQE_REACHED;
> +			qhp->ibqp.event_handler(&ev, qhp->ibqp.qp_context);
> +		}
> +	}
>  
>  	if (qhp->wq.flushed) {
>  		spin_unlock(&qhp->lock);
> -- 
> 2.39.3
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-05  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-03 10:07 [PATCH for-rc] RDMA/cxgb4: notify rdma stack for IB_EVENT_QP_LAST_WQE_REACHED event Anumula Murali Mohan Reddy
2025-01-05  9:06 ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox