* [PATCH v4 1/4] IB: new common API for draining queues
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-17 16:15 ` Steve Wise
[not found] ` <5b4799151723516ec440191b3f0ae98a46b356f0.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:15 ` [PATCH v4 3/4] IB/srp: Use ib_drain_rq() Steve Wise
` (3 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-02-17 16:15 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Add provider-specific drain_sq/drain_rq functions for providers needing
special drain logic.
Add static functions __ib_drain_sq() and __ib_drain_rq() which post noop
WRs to the SQ or RQ and block until their completions are processed.
This ensures the applications completions for work requests posted prior
to the drain work request have all been processed.
Add API functions ib_drain_sq(), ib_drain_rq(), and ib_drain_qp().
For the drain logic to work, the caller must:
ensure there is room in the CQ(s) and QP for the drain work request
and completion.
allocate the CQ using ib_alloc_cq() and the CQ poll context cannot be
IB_POLL_DIRECT.
ensure that there are no other contexts that are posting WRs concurrently.
Otherwise the drain is not guaranteed.
Reviewed-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
drivers/infiniband/core/verbs.c | 164 ++++++++++++++++++++++++++++++++++++++++
include/rdma/ib_verbs.h | 5 ++
2 files changed, 169 insertions(+)
diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index 5af6d02..48dc43c 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1657,3 +1657,167 @@ next_page:
return i;
}
EXPORT_SYMBOL(ib_sg_to_pages);
+
+struct ib_drain_cqe {
+ struct ib_cqe cqe;
+ struct completion done;
+};
+
+static void ib_drain_qp_done(struct ib_cq *cq, struct ib_wc *wc)
+{
+ struct ib_drain_cqe *cqe = container_of(wc->wr_cqe, struct ib_drain_cqe,
+ cqe);
+
+ complete(&cqe->done);
+}
+
+/*
+ * Post a WR and block until its completion is reaped for the SQ.
+ */
+static void __ib_drain_sq(struct ib_qp *qp)
+{
+ struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
+ struct ib_drain_cqe sdrain;
+ struct ib_send_wr swr = {}, *bad_swr;
+ int ret;
+
+ if (qp->send_cq->poll_ctx == IB_POLL_DIRECT) {
+ WARN_ONCE(qp->send_cq->poll_ctx == IB_POLL_DIRECT,
+ "IB_POLL_DIRECT poll_ctx not supported for drain\n");
+ return;
+ }
+
+ swr.wr_cqe = &sdrain.cqe;
+ sdrain.cqe.done = ib_drain_qp_done;
+ init_completion(&sdrain.done);
+
+ ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
+ if (ret) {
+ WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
+ return;
+ }
+
+ ret = ib_post_send(qp, &swr, &bad_swr);
+ if (ret) {
+ WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
+ return;
+ }
+
+ wait_for_completion(&sdrain.done);
+}
+
+/*
+ * Post a WR and block until its completion is reaped for the RQ.
+ */
+static void __ib_drain_rq(struct ib_qp *qp)
+{
+ struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
+ struct ib_drain_cqe rdrain;
+ struct ib_recv_wr rwr = {}, *bad_rwr;
+ int ret;
+
+ if (qp->recv_cq->poll_ctx == IB_POLL_DIRECT) {
+ WARN_ONCE(qp->recv_cq->poll_ctx == IB_POLL_DIRECT,
+ "IB_POLL_DIRECT poll_ctx not supported for drain\n");
+ return;
+ }
+
+ rwr.wr_cqe = &rdrain.cqe;
+ rdrain.cqe.done = ib_drain_qp_done;
+ init_completion(&rdrain.done);
+
+ ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
+ if (ret) {
+ WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
+ return;
+ }
+
+ ret = ib_post_recv(qp, &rwr, &bad_rwr);
+ if (ret) {
+ WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
+ return;
+ }
+
+ wait_for_completion(&rdrain.done);
+}
+
+/**
+ * ib_drain_sq() - Block until all SQ CQEs have been consumed by the
+ * application.
+ * @qp: queue pair to drain
+ *
+ * If the device has a provider-specific drain function, then
+ * call that. Otherwise call the generic drain function
+ * __ib_drain_sq().
+ *
+ * The caller must:
+ *
+ * ensure there is room in the CQ and SQ for the drain work request and
+ * completion.
+ *
+ * allocate the CQ using ib_alloc_cq() and the CQ poll context cannot be
+ * IB_POLL_DIRECT.
+ *
+ * ensure that there are no other contexts that are posting WRs concurrently.
+ * Otherwise the drain is not guaranteed.
+ */
+void ib_drain_sq(struct ib_qp *qp)
+{
+ if (qp->device->drain_sq)
+ qp->device->drain_sq(qp);
+ else
+ __ib_drain_sq(qp);
+}
+EXPORT_SYMBOL(ib_drain_sq);
+
+/**
+ * ib_drain_rq() - Block until all RQ CQEs have been consumed by the
+ * application.
+ * @qp: queue pair to drain
+ *
+ * If the device has a provider-specific drain function, then
+ * call that. Otherwise call the generic drain function
+ * __ib_drain_rq().
+ *
+ * The caller must:
+ *
+ * ensure there is room in the CQ and RQ for the drain work request and
+ * completion.
+ *
+ * allocate the CQ using ib_alloc_cq() and the CQ poll context cannot be
+ * IB_POLL_DIRECT.
+ *
+ * ensure that there are no other contexts that are posting WRs concurrently.
+ * Otherwise the drain is not guaranteed.
+ */
+void ib_drain_rq(struct ib_qp *qp)
+{
+ if (qp->device->drain_rq)
+ qp->device->drain_rq(qp);
+ else
+ __ib_drain_rq(qp);
+}
+EXPORT_SYMBOL(ib_drain_rq);
+
+/**
+ * ib_drain_qp() - Block until all CQEs have been consumed by the
+ * application on both the RQ and SQ.
+ * @qp: queue pair to drain
+ *
+ * The caller must:
+ *
+ * ensure there is room in the CQ(s), SQ, and RQ for drain work requests
+ * and completions.
+ *
+ * allocate the CQs using ib_alloc_cq() and the CQ poll context cannot be
+ * IB_POLL_DIRECT.
+ *
+ * ensure that there are no other contexts that are posting WRs concurrently.
+ * Otherwise the drain is not guaranteed.
+ */
+void ib_drain_qp(struct ib_qp *qp)
+{
+ ib_drain_sq(qp);
+ ib_drain_rq(qp);
+}
+EXPORT_SYMBOL(ib_drain_qp);
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 284b00c..68b7e97 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1846,6 +1846,8 @@ struct ib_device {
int (*check_mr_status)(struct ib_mr *mr, u32 check_mask,
struct ib_mr_status *mr_status);
void (*disassociate_ucontext)(struct ib_ucontext *ibcontext);
+ void (*drain_rq)(struct ib_qp *qp);
+ void (*drain_sq)(struct ib_qp *qp);
struct ib_dma_mapping_ops *dma_ops;
@@ -3094,4 +3096,7 @@ int ib_sg_to_pages(struct ib_mr *mr,
int sg_nents,
int (*set_page)(struct ib_mr *, u64));
+void ib_drain_rq(struct ib_qp *qp);
+void ib_drain_sq(struct ib_qp *qp);
+void ib_drain_qp(struct ib_qp *qp);
#endif /* IB_VERBS_H */
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:15 ` [PATCH v4 1/4] IB: new common API for draining queues Steve Wise
2016-02-17 16:15 ` [PATCH v4 3/4] IB/srp: Use ib_drain_rq() Steve Wise
@ 2016-02-17 16:15 ` Steve Wise
[not found] ` <162a5429342dfd5e16881f4360c0ef858fd39cbd.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:17 ` [PATCH v4 4/4] IB/iser: Use ib_drain_sq() Steve Wise
2016-02-17 21:09 ` [PATCH v4 0/4] new ib_drain_qp() API Doug Ledford
4 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-02-17 16:15 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Add completion objects, named sq_drained and rq_drained, to the c4iw_qp
struct. The queue-specific completion object is signaled when the last
CQE is drained from the CQ for that queue.
Add c4iw_drain_sq() to block until qp->rq_drained is completed.
Add c4iw_drain_rq() to block until qp->sq_drained is completed.
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
drivers/infiniband/hw/cxgb4/cq.c | 9 ++++++++-
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 4 ++++
drivers/infiniband/hw/cxgb4/provider.c | 2 ++
drivers/infiniband/hw/cxgb4/qp.c | 16 ++++++++++++++++
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index cf21df4..b4eeb78 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -815,8 +815,15 @@ static int c4iw_poll_cq_one(struct c4iw_cq *chp, struct ib_wc *wc)
}
}
out:
- if (wq)
+ if (wq) {
+ if (unlikely(qhp->attr.state != C4IW_QP_STATE_RTS)) {
+ if (t4_sq_empty(wq))
+ complete(&qhp->sq_drained);
+ if (t4_rq_empty(wq))
+ complete(&qhp->rq_drained);
+ }
spin_unlock(&qhp->lock);
+ }
return ret;
}
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index fb2de75..7c6a6e1 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -476,6 +476,8 @@ struct c4iw_qp {
wait_queue_head_t wait;
struct timer_list timer;
int sq_sig_all;
+ struct completion rq_drained;
+ struct completion sq_drained;
};
static inline struct c4iw_qp *to_c4iw_qp(struct ib_qp *ibqp)
@@ -1016,6 +1018,8 @@ extern int c4iw_wr_log;
extern int db_fc_threshold;
extern int db_coalescing_threshold;
extern int use_dsgl;
+void c4iw_drain_rq(struct ib_qp *qp);
+void c4iw_drain_sq(struct ib_qp *qp);
#endif
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index ec04272..104662d 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -564,6 +564,8 @@ int c4iw_register_device(struct c4iw_dev *dev)
dev->ibdev.get_protocol_stats = c4iw_get_mib;
dev->ibdev.uverbs_abi_ver = C4IW_UVERBS_ABI_VERSION;
dev->ibdev.get_port_immutable = c4iw_port_immutable;
+ dev->ibdev.drain_sq = c4iw_drain_sq;
+ dev->ibdev.drain_rq = c4iw_drain_rq;
dev->ibdev.iwcm = kmalloc(sizeof(struct iw_cm_verbs), GFP_KERNEL);
if (!dev->ibdev.iwcm)
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index e99345e..7b1b1e8 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1697,6 +1697,8 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
qhp->attr.max_ird = 0;
qhp->sq_sig_all = attrs->sq_sig_type == IB_SIGNAL_ALL_WR;
spin_lock_init(&qhp->lock);
+ init_completion(&qhp->sq_drained);
+ init_completion(&qhp->rq_drained);
mutex_init(&qhp->mutex);
init_waitqueue_head(&qhp->wait);
atomic_set(&qhp->refcnt, 1);
@@ -1888,3 +1890,17 @@ int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
init_attr->sq_sig_type = qhp->sq_sig_all ? IB_SIGNAL_ALL_WR : 0;
return 0;
}
+
+void c4iw_drain_sq(struct ib_qp *ibqp)
+{
+ struct c4iw_qp *qp = to_c4iw_qp(ibqp);
+
+ wait_for_completion(&qp->sq_drained);
+}
+
+void c4iw_drain_rq(struct ib_qp *ibqp)
+{
+ struct c4iw_qp *qp = to_c4iw_qp(ibqp);
+
+ wait_for_completion(&qp->rq_drained);
+}
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 3/4] IB/srp: Use ib_drain_rq()
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:15 ` [PATCH v4 1/4] IB: new common API for draining queues Steve Wise
@ 2016-02-17 16:15 ` Steve Wise
[not found] ` <8a0a024ce256ac8c9be5e46a05f158d6e74a3cb9.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:15 ` [PATCH v4 2/4] iw_cxgb4: add queue drain functions Steve Wise
` (2 subsequent siblings)
4 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-02-17 16:15 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Reviewed-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
---
drivers/infiniband/ulp/srp/ib_srp.c | 40 ++++---------------------------------
1 file changed, 4 insertions(+), 36 deletions(-)
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 03022f6..b6bf204 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -446,49 +446,17 @@ static struct srp_fr_pool *srp_alloc_fr_pool(struct srp_target_port *target)
dev->max_pages_per_mr);
}
-static void srp_drain_done(struct ib_cq *cq, struct ib_wc *wc)
-{
- struct srp_rdma_ch *ch = cq->cq_context;
-
- complete(&ch->done);
-}
-
-static struct ib_cqe srp_drain_cqe = {
- .done = srp_drain_done,
-};
-
/**
* srp_destroy_qp() - destroy an RDMA queue pair
* @ch: SRP RDMA channel.
*
- * Change a queue pair into the error state and wait until all receive
- * completions have been processed before destroying it. This avoids that
- * the receive completion handler can access the queue pair while it is
+ * Drain the qp before destroying it. This avoids that the receive
+ * completion handler can access the queue pair while it is
* being destroyed.
*/
static void srp_destroy_qp(struct srp_rdma_ch *ch)
{
- static struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
- static struct ib_recv_wr wr = { 0 };
- struct ib_recv_wr *bad_wr;
- int ret;
-
- wr.wr_cqe = &srp_drain_cqe;
- /* Destroying a QP and reusing ch->done is only safe if not connected */
- WARN_ON_ONCE(ch->connected);
-
- ret = ib_modify_qp(ch->qp, &attr, IB_QP_STATE);
- WARN_ONCE(ret, "ib_cm_init_qp_attr() returned %d\n", ret);
- if (ret)
- goto out;
-
- init_completion(&ch->done);
- ret = ib_post_recv(ch->qp, &wr, &bad_wr);
- WARN_ONCE(ret, "ib_post_recv() returned %d\n", ret);
- if (ret == 0)
- wait_for_completion(&ch->done);
-
-out:
+ ib_drain_rq(ch->qp);
ib_destroy_qp(ch->qp);
}
@@ -508,7 +476,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch)
if (!init_attr)
return -ENOMEM;
- /* queue_size + 1 for ib_drain_qp */
+ /* queue_size + 1 for ib_drain_rq() */
recv_cq = ib_alloc_cq(dev->dev, ch, target->queue_size + 1,
ch->comp_vector, IB_POLL_SOFTIRQ);
if (IS_ERR(recv_cq)) {
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 4/4] IB/iser: Use ib_drain_sq()
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
` (2 preceding siblings ...)
2016-02-17 16:15 ` [PATCH v4 2/4] iw_cxgb4: add queue drain functions Steve Wise
@ 2016-02-17 16:17 ` Steve Wise
[not found] ` <269ab4c6de9c30bb6beba249302d5f1d1db9b924.1455741337.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 21:09 ` [PATCH v4 0/4] new ib_drain_qp() API Doug Ledford
4 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-02-17 16:17 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
drivers/infiniband/ulp/iser/iscsi_iser.h | 7 -------
drivers/infiniband/ulp/iser/iser_initiator.c | 7 -------
drivers/infiniband/ulp/iser/iser_verbs.c | 15 ++-------------
3 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 95f0a64..0351059 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -458,9 +458,6 @@ struct iser_fr_pool {
* @comp: iser completion context
* @fr_pool: connection fast registration poool
* @pi_support: Indicate device T10-PI support
- * @last: last send wr to signal all flush errors were drained
- * @last_cqe: cqe handler for last wr
- * @last_comp: completes when all connection completions consumed
*/
struct ib_conn {
struct rdma_cm_id *cma_id;
@@ -472,10 +469,7 @@ struct ib_conn {
struct iser_comp *comp;
struct iser_fr_pool fr_pool;
bool pi_support;
- struct ib_send_wr last;
- struct ib_cqe last_cqe;
struct ib_cqe reg_cqe;
- struct completion last_comp;
};
/**
@@ -617,7 +611,6 @@ void iser_cmd_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_ctrl_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_reg_comp(struct ib_cq *cq, struct ib_wc *wc);
-void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc);
void iser_task_rdma_init(struct iscsi_iser_task *task);
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index ed54b38..81ae2e3 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -729,13 +729,6 @@ void iser_dataout_comp(struct ib_cq *cq, struct ib_wc *wc)
kmem_cache_free(ig.desc_cache, desc);
}
-void iser_last_comp(struct ib_cq *cq, struct ib_wc *wc)
-{
- struct ib_conn *ib_conn = wc->qp->qp_context;
-
- complete(&ib_conn->last_comp);
-}
-
void iser_task_rdma_init(struct iscsi_iser_task *iser_task)
{
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 40c0f49..47e1159 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -663,7 +663,6 @@ void iser_conn_release(struct iser_conn *iser_conn)
int iser_conn_terminate(struct iser_conn *iser_conn)
{
struct ib_conn *ib_conn = &iser_conn->ib_conn;
- struct ib_send_wr *bad_wr;
int err = 0;
/* terminate the iser conn only if the conn state is UP */
@@ -688,14 +687,8 @@ int iser_conn_terminate(struct iser_conn *iser_conn)
iser_err("Failed to disconnect, conn: 0x%p err %d\n",
iser_conn, err);
- /* post an indication that all flush errors were consumed */
- err = ib_post_send(ib_conn->qp, &ib_conn->last, &bad_wr);
- if (err) {
- iser_err("conn %p failed to post last wr", ib_conn);
- return 1;
- }
-
- wait_for_completion(&ib_conn->last_comp);
+ /* block until all flush errors are consumed */
+ ib_drain_sq(ib_conn->qp);
}
return 1;
@@ -954,10 +947,6 @@ void iser_conn_init(struct iser_conn *iser_conn)
ib_conn->post_recv_buf_count = 0;
ib_conn->reg_cqe.done = iser_reg_comp;
- ib_conn->last_cqe.done = iser_last_comp;
- ib_conn->last.wr_cqe = &ib_conn->last_cqe;
- ib_conn->last.opcode = IB_WR_SEND;
- init_completion(&ib_conn->last_comp);
}
/**
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v4 0/4] new ib_drain_qp() API
@ 2016-02-17 20:35 Steve Wise
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-02-17 20:35 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
This series creates new helper API functions for draining a queue pair.
It is a rework of an original patch created by Christoph Hellwig as
part of the CQ API rework and was dropped to be resubmitted by me with
iw_cxgb4 support.
Original thread: http://www.spinics.net/lists/linux-rdma/msg30296.html
Changes since v3:
- WARN_ONCE() if the CQ is using IB_POLL_DIRECT context.
- added iser patch to use ib_drain_sq().
- fixed up function comments to specify caller requirements
- checkpatched
Changes since v2:
- created 3 drain API functions: ib_drain_rq(), ib_drain_sq(), and
ib_drain_qp()
- add provider-specific drain function pointers for the sq and rq
- refactored the code a bit
- support for IB_DIRECT_POLL CQs
Changes since v1:
- added comments to the ib_drain_qp() function header specifying the
consumer requirements
- in __ib_drain_qp(), if the ib_post_send() fails, still wait for the
recv wr to drain since we already posted it.
- CC the SRP maintainer, bart.vanassche-XdAiOPVOjtvowKkBSvOlow@public.gmane.org
---
Steve Wise (4):
IB: new common API for draining queues
iw_cxgb4: add queue drain functions
IB/srp: Use ib_drain_rq()
IB/iser: Use ib_drain_sq()
drivers/infiniband/core/verbs.c | 164 +++++++++++++++++++++++++++
drivers/infiniband/hw/cxgb4/cq.c | 9 +-
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 4 +
drivers/infiniband/hw/cxgb4/provider.c | 2 +
drivers/infiniband/hw/cxgb4/qp.c | 16 +++
drivers/infiniband/ulp/iser/iscsi_iser.h | 7 --
drivers/infiniband/ulp/iser/iser_initiator.c | 7 --
drivers/infiniband/ulp/iser/iser_verbs.c | 15 +--
drivers/infiniband/ulp/srp/ib_srp.c | 40 +------
include/rdma/ib_verbs.h | 5 +
10 files changed, 205 insertions(+), 64 deletions(-)
--
2.7.0
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 0/4] new ib_drain_qp() API
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
` (3 preceding siblings ...)
2016-02-17 16:17 ` [PATCH v4 4/4] IB/iser: Use ib_drain_sq() Steve Wise
@ 2016-02-17 21:09 ` Doug Ledford
4 siblings, 0 replies; 21+ messages in thread
From: Doug Ledford @ 2016-02-17 21:09 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
[-- Attachment #1: Type: text/plain, Size: 2203 bytes --]
On 02/17/2016 03:35 PM, Steve Wise wrote:
> This series creates new helper API functions for draining a queue pair.
> It is a rework of an original patch created by Christoph Hellwig as
> part of the CQ API rework and was dropped to be resubmitted by me with
> iw_cxgb4 support.
>
> Original thread: http://www.spinics.net/lists/linux-rdma/msg30296.html
>
>
> Changes since v3:
>
> - WARN_ONCE() if the CQ is using IB_POLL_DIRECT context.
>
> - added iser patch to use ib_drain_sq().
>
> - fixed up function comments to specify caller requirements
>
> - checkpatched
>
>
> Changes since v2:
>
> - created 3 drain API functions: ib_drain_rq(), ib_drain_sq(), and
> ib_drain_qp()
>
> - add provider-specific drain function pointers for the sq and rq
>
> - refactored the code a bit
>
> - support for IB_DIRECT_POLL CQs
>
>
> Changes since v1:
>
> - added comments to the ib_drain_qp() function header specifying the
> consumer requirements
>
> - in __ib_drain_qp(), if the ib_post_send() fails, still wait for the
> recv wr to drain since we already posted it.
>
> - CC the SRP maintainer, bart.vanassche-XdAiOPVOjtvowKkBSvOlow@public.gmane.org
>
> ---
>
> Steve Wise (4):
> IB: new common API for draining queues
> iw_cxgb4: add queue drain functions
> IB/srp: Use ib_drain_rq()
> IB/iser: Use ib_drain_sq()
>
> drivers/infiniband/core/verbs.c | 164 +++++++++++++++++++++++++++
> drivers/infiniband/hw/cxgb4/cq.c | 9 +-
> drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 4 +
> drivers/infiniband/hw/cxgb4/provider.c | 2 +
> drivers/infiniband/hw/cxgb4/qp.c | 16 +++
> drivers/infiniband/ulp/iser/iscsi_iser.h | 7 --
> drivers/infiniband/ulp/iser/iser_initiator.c | 7 --
> drivers/infiniband/ulp/iser/iser_verbs.c | 15 +--
> drivers/infiniband/ulp/srp/ib_srp.c | 40 +------
> include/rdma/ib_verbs.h | 5 +
> 10 files changed, 205 insertions(+), 64 deletions(-)
>
Series looks good now, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] IB: new common API for draining queues
[not found] ` <5b4799151723516ec440191b3f0ae98a46b356f0.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-17 23:35 ` Bart Van Assche
[not found] ` <56C503D0.7060402-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:01 ` Sagi Grimberg
1 sibling, 1 reply; 21+ messages in thread
From: Bart Van Assche @ 2016-02-17 23:35 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
On 02/17/2016 08:15 AM, Steve Wise wrote:
> +static void __ib_drain_sq(struct ib_qp *qp)
> +{
> + struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> + struct ib_drain_cqe sdrain;
> + struct ib_send_wr swr = {}, *bad_swr;
> + int ret;
> +
> + if (qp->send_cq->poll_ctx == IB_POLL_DIRECT) {
> + WARN_ONCE(qp->send_cq->poll_ctx == IB_POLL_DIRECT,
> + "IB_POLL_DIRECT poll_ctx not supported for drain\n");
> + return;
> + }
> +
> + swr.wr_cqe = &sdrain.cqe;
> + sdrain.cqe.done = ib_drain_qp_done;
> + init_completion(&sdrain.done);
> +
> + ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
> + return;
> + }
> +
> + ret = ib_post_send(qp, &swr, &bad_swr);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
> + return;
> + }
> +
> + wait_for_completion(&sdrain.done);
> +}
> +
> +/*
> + * Post a WR and block until its completion is reaped for the RQ.
> + */
> +static void __ib_drain_rq(struct ib_qp *qp)
> +{
> + struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> + struct ib_drain_cqe rdrain;
> + struct ib_recv_wr rwr = {}, *bad_rwr;
> + int ret;
> +
> + if (qp->recv_cq->poll_ctx == IB_POLL_DIRECT) {
> + WARN_ONCE(qp->recv_cq->poll_ctx == IB_POLL_DIRECT,
> + "IB_POLL_DIRECT poll_ctx not supported for drain\n");
> + return;
> + }
> +
> + rwr.wr_cqe = &rdrain.cqe;
> + rdrain.cqe.done = ib_drain_qp_done;
> + init_completion(&rdrain.done);
> +
> + ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
> + return;
> + }
> +
> + ret = ib_post_recv(qp, &rwr, &bad_rwr);
> + if (ret) {
> + WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
> + return;
> + }
> +
> + wait_for_completion(&rdrain.done);
> +}
Hello Steve,
I only have one comment about this patch: are you aware that the six
invocations of WARN_ONCE() can be made less verbose by rewriting if (c)
{ WARN_ONCE(c, m); ... } as if (WARN_ONCE(c, m)) { ... } ?
Bart.
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v4 1/4] IB: new common API for draining queues
[not found] ` <56C503D0.7060402-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-17 23:39 ` Steve Wise
0 siblings, 0 replies; 21+ messages in thread
From: Steve Wise @ 2016-02-17 23:39 UTC (permalink / raw)
To: 'Bart Van Assche', 'Steve Wise',
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Bart Van Assche
> Sent: Wednesday, February 17, 2016 5:36 PM
> To: Steve Wise; linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org; roid-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
> Subject: Re: [PATCH v4 1/4] IB: new common API for draining queues
>
> On 02/17/2016 08:15 AM, Steve Wise wrote:
> > +static void __ib_drain_sq(struct ib_qp *qp)
> > +{
> > + struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> > + struct ib_drain_cqe sdrain;
> > + struct ib_send_wr swr = {}, *bad_swr;
> > + int ret;
> > +
> > + if (qp->send_cq->poll_ctx == IB_POLL_DIRECT) {
> > + WARN_ONCE(qp->send_cq->poll_ctx == IB_POLL_DIRECT,
> > + "IB_POLL_DIRECT poll_ctx not supported for drain\n");
> > + return;
> > + }
> > +
> > + swr.wr_cqe = &sdrain.cqe;
> > + sdrain.cqe.done = ib_drain_qp_done;
> > + init_completion(&sdrain.done);
> > +
> > + ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> > + if (ret) {
> > + WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
> > + return;
> > + }
> > +
> > + ret = ib_post_send(qp, &swr, &bad_swr);
> > + if (ret) {
> > + WARN_ONCE(ret, "failed to drain send queue: %d\n", ret);
> > + return;
> > + }
> > +
> > + wait_for_completion(&sdrain.done);
> > +}
> > +
> > +/*
> > + * Post a WR and block until its completion is reaped for the RQ.
> > + */
> > +static void __ib_drain_rq(struct ib_qp *qp)
> > +{
> > + struct ib_qp_attr attr = { .qp_state = IB_QPS_ERR };
> > + struct ib_drain_cqe rdrain;
> > + struct ib_recv_wr rwr = {}, *bad_rwr;
> > + int ret;
> > +
> > + if (qp->recv_cq->poll_ctx == IB_POLL_DIRECT) {
> > + WARN_ONCE(qp->recv_cq->poll_ctx == IB_POLL_DIRECT,
> > + "IB_POLL_DIRECT poll_ctx not supported for drain\n");
> > + return;
> > + }
> > +
> > + rwr.wr_cqe = &rdrain.cqe;
> > + rdrain.cqe.done = ib_drain_qp_done;
> > + init_completion(&rdrain.done);
> > +
> > + ret = ib_modify_qp(qp, &attr, IB_QP_STATE);
> > + if (ret) {
> > + WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
> > + return;
> > + }
> > +
> > + ret = ib_post_recv(qp, &rwr, &bad_rwr);
> > + if (ret) {
> > + WARN_ONCE(ret, "failed to drain recv queue: %d\n", ret);
> > + return;
> > + }
> > +
> > + wait_for_completion(&rdrain.done);
> > +}
>
> Hello Steve,
>
> I only have one comment about this patch: are you aware that the six
> invocations of WARN_ONCE() can be made less verbose by rewriting if (c)
> { WARN_ONCE(c, m); ... } as if (WARN_ONCE(c, m)) { ... } ?
>
I am now. :) I didn't know WARN* macros returned the condition.
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] IB: new common API for draining queues
[not found] ` <5b4799151723516ec440191b3f0ae98a46b356f0.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 23:35 ` Bart Van Assche
@ 2016-02-21 15:01 ` Sagi Grimberg
[not found] ` <56C9D14B.9010307-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
1 sibling, 1 reply; 21+ messages in thread
From: Sagi Grimberg @ 2016-02-21 15:01 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Thanks Steve, this looks good to me,
Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <162a5429342dfd5e16881f4360c0ef858fd39cbd.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-21 15:01 ` Sagi Grimberg
2016-03-09 12:53 ` Leon Romanovsky
1 sibling, 0 replies; 21+ messages in thread
From: Sagi Grimberg @ 2016-02-21 15:01 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Looks good,
Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 3/4] IB/srp: Use ib_drain_rq()
[not found] ` <8a0a024ce256ac8c9be5e46a05f158d6e74a3cb9.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-21 15:02 ` Sagi Grimberg
0 siblings, 0 replies; 21+ messages in thread
From: Sagi Grimberg @ 2016-02-21 15:02 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Looks good,
Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 4/4] IB/iser: Use ib_drain_sq()
[not found] ` <269ab4c6de9c30bb6beba249302d5f1d1db9b924.1455741337.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2016-02-21 15:02 ` Sagi Grimberg
2016-03-03 10:10 ` Sagi Grimberg
1 sibling, 0 replies; 21+ messages in thread
From: Sagi Grimberg @ 2016-02-21 15:02 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Looks good and works,
Acked-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 1/4] IB: new common API for draining queues
[not found] ` <56C9D14B.9010307-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-02-22 5:39 ` Devesh Sharma
0 siblings, 0 replies; 21+ messages in thread
From: Devesh Sharma @ 2016-02-22 5:39 UTC (permalink / raw)
To: Sagi Grimberg
Cc: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ, Or Gerlitz, Sagi Grimberg,
roid-VPRAkNaXOzVWk0Htik3J/w
Hi Steve,
The patch looks good to me.
Reviewed-by: Devesh Sharma <devesh.sharma-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
On Sun, Feb 21, 2016 at 8:31 PM, Sagi Grimberg <sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> Thanks Steve, this looks good to me,
>
> Reviewed-by: Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
>
> --
> 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
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 4/4] IB/iser: Use ib_drain_sq()
[not found] ` <269ab4c6de9c30bb6beba249302d5f1d1db9b924.1455741337.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:02 ` Sagi Grimberg
@ 2016-03-03 10:10 ` Sagi Grimberg
[not found] ` <56D80D8F.7070700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
1 sibling, 1 reply; 21+ messages in thread
From: Sagi Grimberg @ 2016-03-03 10:10 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
Steve, I prefer that iser will call ib_drain_qp(). It's
harmless from that point of view.
Given that Doug pulled it into his github, I can send an
incremental patch.
Cheers,
Sagi.
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v4 4/4] IB/iser: Use ib_drain_sq()
[not found] ` <56D80D8F.7070700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-03-03 15:17 ` Steve Wise
0 siblings, 0 replies; 21+ messages in thread
From: Steve Wise @ 2016-03-03 15:17 UTC (permalink / raw)
To: 'Sagi Grimberg', linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
> Steve, I prefer that iser will call ib_drain_qp(). It's
> harmless from that point of view.
>
> Given that Doug pulled it into his github, I can send an
> incremental patch.
Sounds good.
Steve
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <162a5429342dfd5e16881f4360c0ef858fd39cbd.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:01 ` Sagi Grimberg
@ 2016-03-09 12:53 ` Leon Romanovsky
[not found] ` <20160309125349.GA1977-2ukJVAZIZ/Y@public.gmane.org>
1 sibling, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2016-03-09 12:53 UTC (permalink / raw)
To: Steve Wise
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
On Wed, Feb 17, 2016 at 08:15:42AM -0800, Steve Wise wrote:
> Add completion objects, named sq_drained and rq_drained, to the c4iw_qp
> struct. The queue-specific completion object is signaled when the last
> CQE is drained from the CQ for that queue.
>
> Add c4iw_drain_sq() to block until qp->rq_drained is completed.
>
> Add c4iw_drain_rq() to block until qp->sq_drained is completed.
Hi Steve,
My knowledge is limited in this driver and I have no illusion that
question sounds naive, but why did you add these functions to this
specific driver? Do the other drivers need such update too?
Thanks
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <20160309125349.GA1977-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-03-09 15:23 ` Steve Wise
2016-03-09 15:28 ` Sagi Grimberg
0 siblings, 1 reply; 21+ messages in thread
From: Steve Wise @ 2016-03-09 15:23 UTC (permalink / raw)
To: leon-2ukJVAZIZ/Y
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
> On Wed, Feb 17, 2016 at 08:15:42AM -0800, Steve Wise wrote:
> > Add completion objects, named sq_drained and rq_drained, to the c4iw_qp
> > struct. The queue-specific completion object is signaled when the last
> > CQE is drained from the CQ for that queue.
> >
> > Add c4iw_drain_sq() to block until qp->rq_drained is completed.
> >
> > Add c4iw_drain_rq() to block until qp->sq_drained is completed.
>
> Hi Steve,
> My knowledge is limited in this driver and I have no illusion that
> question sounds naive, but why did you add these functions to this
> specific driver? Do the other drivers need such update too?
>
> Thanks
Hey Leon,
I added these so iSER and other storage protocols that are or will be using the drain logic will work on cxgb4. IB devices should
not need device-specific drain logic since the common core drain works for IB (and I assume RoCE). iWARP devices, however, require
device-specific logic. Other iwarp drivers are iw_cxgb3 and iw_nes.
Steve.
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
2016-03-09 15:23 ` Steve Wise
@ 2016-03-09 15:28 ` Sagi Grimberg
[not found] ` <56E0412F.4000602-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
0 siblings, 1 reply; 21+ messages in thread
From: Sagi Grimberg @ 2016-03-09 15:28 UTC (permalink / raw)
To: Steve Wise, leon-2ukJVAZIZ/Y
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w
>> Hi Steve,
>> My knowledge is limited in this driver and I have no illusion that
>> question sounds naive, but why did you add these functions to this
>> specific driver? Do the other drivers need such update too?
>>
>> Thanks
>
> Hey Leon,
>
> I added these so iSER and other storage protocols that are or will be using the drain logic will work on cxgb4. IB devices should
> not need device-specific drain logic since the common core drain works for IB (and I assume RoCE). iWARP devices, however, require
> device-specific logic. Other iwarp drivers are iw_cxgb3 and iw_nes.
Yes, this is iWARP specific. Steve was kind enough to fix chelsio
drivers and we need someone to pick up nes so ULPs will be able to run
reliably over it.
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <56E0412F.4000602-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2016-03-10 5:05 ` Leon Romanovsky
[not found] ` <20160310050558.GD1977-2ukJVAZIZ/Y@public.gmane.org>
0 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2016-03-10 5:05 UTC (permalink / raw)
To: Sagi Grimberg, Steve Wise
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w, sagig-VPRAkNaXOzVWk0Htik3J/w,
roid-VPRAkNaXOzVWk0Htik3J/w, faisal.latif-ral2JQCrhuEAvxtiuMwx3w
On Wed, Mar 09, 2016 at 05:28:47PM +0200, Sagi Grimberg wrote:
>
> >>Hi Steve,
> >>My knowledge is limited in this driver and I have no illusion that
> >>question sounds naive, but why did you add these functions to this
> >>specific driver? Do the other drivers need such update too?
> >>
> >>Thanks
> >
> >Hey Leon,
> >
> >I added these so iSER and other storage protocols that are or will be using the drain logic will work on cxgb4. IB devices should
> >not need device-specific drain logic since the common core drain works for IB (and I assume RoCE). iWARP devices, however, require
> >device-specific logic. Other iwarp drivers are iw_cxgb3 and iw_nes.
>
> Yes, this is iWARP specific. Steve was kind enough to fix chelsio
> drivers and we need someone to pick up nes so ULPs will be able to run
> reliably over it.
Steve and Sagi,
Thank you for clarification.
I see that nes driver is supported. Is it still relevant?
NETEFFECT IWARP RNIC DRIVER (IW_NES)
M: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
L: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
W: http://www.intel.com/Products/Server/Adapters/Server-Cluster/Server-Cluster-overview.htm
S: Supported
F: drivers/infiniband/hw/nes/
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <20160310050558.GD1977-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-03-24 10:46 ` Leon Romanovsky
[not found] ` <20160324104659.GC11949-2ukJVAZIZ/Y@public.gmane.org>
0 siblings, 1 reply; 21+ messages in thread
From: Leon Romanovsky @ 2016-03-24 10:46 UTC (permalink / raw)
To: Doug Ledford, faisal.latif-ral2JQCrhuEAvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
ping
On Thu, Mar 10, 2016 at 07:05:58AM +0200, Leon Romanovsky wrote:
> On Wed, Mar 09, 2016 at 05:28:47PM +0200, Sagi Grimberg wrote:
> >
> > Yes, this is iWARP specific. Steve was kind enough to fix chelsio
> > drivers and we need someone to pick up nes so ULPs will be able to run
> > reliably over it.
>
> Steve and Sagi,
> Thank you for clarification.
>
> I see that nes driver is supported. Is it still relevant?
>
> NETEFFECT IWARP RNIC DRIVER (IW_NES)
> M: Faisal Latif <faisal.latif-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> L: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> W: http://www.intel.com/Products/Server/Adapters/Server-Cluster/Server-Cluster-overview.htm
> S: Supported
> F: drivers/infiniband/hw/nes/
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v4 2/4] iw_cxgb4: add queue drain functions
[not found] ` <20160324104659.GC11949-2ukJVAZIZ/Y@public.gmane.org>
@ 2016-03-24 14:36 ` Faisal Latif
0 siblings, 0 replies; 21+ messages in thread
From: Faisal Latif @ 2016-03-24 14:36 UTC (permalink / raw)
To: Doug Ledford, linux-rdma-u79uwXL29TY76Z2rM5mHXA
On Thu, Mar 24, 2016 at 12:46:59PM +0200, Leon Romanovsky wrote:
> ping
>
> On Thu, Mar 10, 2016 at 07:05:58AM +0200, Leon Romanovsky wrote:
> > On Wed, Mar 09, 2016 at 05:28:47PM +0200, Sagi Grimberg wrote:
> > >
> > > Yes, this is iWARP specific. Steve was kind enough to fix chelsio
> > > drivers and we need someone to pick up nes so ULPs will be able to run
> > > reliably over it.
> >
> > Steve and Sagi,
> > Thank you for clarification.
> >
> > I see that nes driver is supported. Is it still relevant?
> >
Sorry as I was on vacation and will get the patch for nes ready.
Thanks
Faisal
--
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
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2016-03-24 14:36 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 20:35 [PATCH v4 0/4] new ib_drain_qp() API Steve Wise
[not found] ` <cover.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 16:15 ` [PATCH v4 1/4] IB: new common API for draining queues Steve Wise
[not found] ` <5b4799151723516ec440191b3f0ae98a46b356f0.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-17 23:35 ` Bart Van Assche
[not found] ` <56C503D0.7060402-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-02-17 23:39 ` Steve Wise
2016-02-21 15:01 ` Sagi Grimberg
[not found] ` <56C9D14B.9010307-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-02-22 5:39 ` Devesh Sharma
2016-02-17 16:15 ` [PATCH v4 3/4] IB/srp: Use ib_drain_rq() Steve Wise
[not found] ` <8a0a024ce256ac8c9be5e46a05f158d6e74a3cb9.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:02 ` Sagi Grimberg
2016-02-17 16:15 ` [PATCH v4 2/4] iw_cxgb4: add queue drain functions Steve Wise
[not found] ` <162a5429342dfd5e16881f4360c0ef858fd39cbd.1455741336.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:01 ` Sagi Grimberg
2016-03-09 12:53 ` Leon Romanovsky
[not found] ` <20160309125349.GA1977-2ukJVAZIZ/Y@public.gmane.org>
2016-03-09 15:23 ` Steve Wise
2016-03-09 15:28 ` Sagi Grimberg
[not found] ` <56E0412F.4000602-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-03-10 5:05 ` Leon Romanovsky
[not found] ` <20160310050558.GD1977-2ukJVAZIZ/Y@public.gmane.org>
2016-03-24 10:46 ` Leon Romanovsky
[not found] ` <20160324104659.GC11949-2ukJVAZIZ/Y@public.gmane.org>
2016-03-24 14:36 ` Faisal Latif
2016-02-17 16:17 ` [PATCH v4 4/4] IB/iser: Use ib_drain_sq() Steve Wise
[not found] ` <269ab4c6de9c30bb6beba249302d5f1d1db9b924.1455741337.git.swise-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2016-02-21 15:02 ` Sagi Grimberg
2016-03-03 10:10 ` Sagi Grimberg
[not found] ` <56D80D8F.7070700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2016-03-03 15:17 ` Steve Wise
2016-02-17 21:09 ` [PATCH v4 0/4] new ib_drain_qp() API Doug Ledford
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).