From: Vipul Pandya <vipul@chelsio.com>
To: linux-rdma@vger.kernel.org, netdev@vger.kernel.org
Cc: roland@purestorage.com, davem@davemloft.net, divy@chelsio.com,
dm@chelsio.com, kumaras@chelsio.com, swise@opengridcomputing.com,
Vipul Pandya <vipul@chelsio.com>
Subject: [PATCH 10/10] RDMA/cxgb4: Add query_qp support in driver to query the qp state before flushing.
Date: Wed, 19 Oct 2011 22:41:04 +0530 [thread overview]
Message-ID: <1319044264-779-11-git-send-email-vipul@chelsio.com> (raw)
In-Reply-To: <1319044264-779-1-git-send-email-vipul@chelsio.com>
Signed-off-by: Vipul Pandya <vipul@chelsio.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 19 +++++++++++++++++++
drivers/infiniband/hw/cxgb4/provider.c | 2 ++
drivers/infiniband/hw/cxgb4/qp.c | 11 +++++++++++
3 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index 9e26b76..8aa1744 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -550,6 +550,23 @@ static inline int c4iw_convert_state(enum ib_qp_state ib_state)
}
}
+static inline int to_ib_qp_state(int c4iw_qp_state)
+{
+ switch (c4iw_qp_state) {
+ case C4IW_QP_STATE_IDLE:
+ return IB_QPS_INIT;
+ case C4IW_QP_STATE_RTS:
+ return IB_QPS_RTS;
+ case C4IW_QP_STATE_CLOSING:
+ return IB_QPS_SQD;
+ case C4IW_QP_STATE_TERMINATE:
+ return IB_QPS_SQE;
+ case C4IW_QP_STATE_ERROR:
+ return IB_QPS_ERR;
+ }
+ return IB_QPS_ERR;
+}
+
static inline u32 c4iw_ib_to_tpt_access(int a)
{
return (a & IB_ACCESS_REMOTE_WRITE ? FW_RI_MEM_ACCESS_REM_WRITE : 0) |
@@ -845,6 +862,8 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd,
struct ib_udata *udata);
int c4iw_ib_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
int attr_mask, struct ib_udata *udata);
+int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
+ int attr_mask, struct ib_qp_init_attr *init_attr);
struct ib_qp *c4iw_get_qp(struct ib_device *dev, int qpn);
u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size);
void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size);
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index db1debc..3cb1128 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -443,6 +443,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
(1ull << IB_USER_VERBS_CMD_REQ_NOTIFY_CQ) |
(1ull << IB_USER_VERBS_CMD_CREATE_QP) |
(1ull << IB_USER_VERBS_CMD_MODIFY_QP) |
+ (1ull << IB_USER_VERBS_CMD_QUERY_QP) |
(1ull << IB_USER_VERBS_CMD_POLL_CQ) |
(1ull << IB_USER_VERBS_CMD_DESTROY_QP) |
(1ull << IB_USER_VERBS_CMD_POST_SEND) |
@@ -465,6 +466,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
dev->ibdev.destroy_ah = c4iw_ah_destroy;
dev->ibdev.create_qp = c4iw_create_qp;
dev->ibdev.modify_qp = c4iw_ib_modify_qp;
+ dev->ibdev.query_qp = c4iw_ib_query_qp;
dev->ibdev.destroy_qp = c4iw_destroy_qp;
dev->ibdev.create_cq = c4iw_create_cq;
dev->ibdev.destroy_cq = c4iw_destroy_cq;
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 215b66a..a7b8713 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1696,3 +1696,14 @@ struct ib_qp *c4iw_get_qp(struct ib_device *dev, int qpn)
PDBG("%s ib_dev %p qpn 0x%x\n", __func__, dev, qpn);
return (struct ib_qp *)get_qhp(to_c4iw_dev(dev), qpn);
}
+
+int c4iw_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
+ int attr_mask, struct ib_qp_init_attr *init_attr)
+{
+ struct c4iw_qp *qhp = to_c4iw_qp(ibqp);
+
+ memset(attr, 0, sizeof *attr);
+ memset(init_attr, 0, sizeof *init_attr);
+ attr->qp_state = to_ib_qp_state(qhp->attr.state);
+ return 0;
+}
--
1.7.1
next prev parent reply other threads:[~2011-10-19 17:13 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-19 17:10 [PATCH 00/10] Doorbell drop recovery for T4 iWARP Vipul Pandya
2011-10-19 17:10 ` [PATCH 02/10] cxgb4: DB Drop Recovery for RDMA and LLD queues Vipul Pandya
2011-10-19 17:10 ` [PATCH 03/10] " Vipul Pandya
[not found] ` <1319044264-779-1-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2011-10-19 17:10 ` [PATCH 01/10] cxgb4: Detect DB FULL events and notify RDMA ULD Vipul Pandya
2011-10-19 17:10 ` [PATCH 04/10] RDMA/cxgb4: Add debugfs rdma memory stats Vipul Pandya
2011-10-19 17:10 ` [PATCH 05/10] RDMA/cxgb4: Add DB Overflow Avoidance Vipul Pandya
[not found] ` <1319044264-779-6-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2011-10-23 15:33 ` Steve Wise
2011-10-19 17:11 ` [PATCH 06/10] RDMA/cxgb4: disable interrupts in c4iw_ev_dispatch() Vipul Pandya
2011-10-19 17:11 ` [PATCH 07/10] RDMA/cxgb4: DB Drop Recovery for RDMA and LLD queues Vipul Pandya
[not found] ` <1319044264-779-8-git-send-email-vipul-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2011-10-19 22:12 ` Roland Dreier
[not found] ` <CAL1RGDWCfJHD+PjXQ3STk4uc-fEyQ2GsQR5ALU6i4-f7w2bXUA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-20 14:32 ` Steve Wise
[not found] ` <4EA030F5.3000007-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2011-10-20 17:17 ` Roland Dreier
[not found] ` <CAL1RGDUDk_MAM+S+MaEcPQzug8TvE-mFAfNqX3FqRApLQu9H2g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-20 17:28 ` Steve Wise
[not found] ` <4EA05A27.9090605-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2011-10-20 20:57 ` David Miller
[not found] ` <20111020.165703.1713724038045504243.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-10-24 15:16 ` Vipul Pandya
[not found] ` <4EA5814F.6080801-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2011-10-24 21:12 ` David Miller
[not found] ` <20111024.171209.1856294221956226756.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2011-10-25 11:34 ` Roland Dreier
2011-10-19 17:11 ` [PATCH 08/10] RDMA/cxgb4: Use vmalloc for debugfs qp dump. Allows dumping thousands of qps Vipul Pandya
2011-10-19 17:11 ` [PATCH 09/10] RDMA/cxgb4: remove kfifo usage Vipul Pandya
2011-10-19 17:11 ` Vipul Pandya [this message]
2012-05-18 9:59 [PATCH 00/10] Doorbell drop recovery for Chelsio T4 iWARP Vipul Pandya
2012-05-18 9:59 ` [PATCH 10/10] RDMA/cxgb4: Add query_qp support in driver to query the qp state before flushing Vipul Pandya
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=1319044264-779-11-git-send-email-vipul@chelsio.com \
--to=vipul@chelsio.com \
--cc=davem@davemloft.net \
--cc=divy@chelsio.com \
--cc=dm@chelsio.com \
--cc=kumaras@chelsio.com \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=roland@purestorage.com \
--cc=swise@opengridcomputing.com \
/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).