LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update
@ 2007-04-26 20:20 Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes Steve Wise
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:20 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Hey Roland,

Here are some bug fixes to the iw_cxgb3 driver that I'd like merged for
2.6.22.  The 1st patch has been posted before, but I didn't see it in
your for-2.6.22 branch, so I'm posting it again.  

Jeff, 

The last patch updates the cxgb3 required firmware version.  It is
included in this series because its required by the patch preceeding it
in the series.

Steve.

Shortlog:

Steve Wise:
      Fix TERM codes.
      Fail qp creation if the requested max_inline is too large.
      Initialize cpu_idx field in cpl_close_listserv_req message.
      Support for new abort logic.
      Update required firmware revision to 4.0.0.

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

* [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes.
  2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
@ 2007-04-26 20:21 ` Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 2/5] iw_cxgb3: Fail qp creation if the requested max_inline is too large Steve Wise
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:21 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Fix TERM codes.

Fix TERMINATE layer, type, and ecode values based on
conformance testing.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/iwch_qp.c |   69 ++++++++++++++++++---------------
 1 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_qp.c b/drivers/infiniband/hw/cxgb3/iwch_qp.c
index 0a472c9..714dddb 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -471,43 +471,62 @@ int iwch_bind_mw(struct ib_qp *qp,
 	return err;
 }
 
-static void build_term_codes(int t3err, u8 *layer_type, u8 *ecode, int tagged)
+static inline void build_term_codes(struct respQ_msg_t *rsp_msg,
+				    u8 *layer_type, u8 *ecode)
 {
-	switch (t3err) {
+	int status = TPT_ERR_INTERNAL_ERR;
+	int tagged = 0;
+	int opcode = -1;
+	int rqtype = 0;
+	int send_inv = 0;
+
+	if (rsp_msg) {
+		status = CQE_STATUS(rsp_msg->cqe);
+		opcode = CQE_OPCODE(rsp_msg->cqe);
+		rqtype = RQ_TYPE(rsp_msg->cqe);
+		send_inv = (opcode == T3_SEND_WITH_INV) ||
+		           (opcode == T3_SEND_WITH_SE_INV);
+		tagged = (opcode == T3_RDMA_WRITE) ||
+			 (rqtype && (opcode == T3_READ_RESP));
+	}
+
+	switch (status) {
 	case TPT_ERR_STAG:
-		if (tagged == 1) {
-			*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
-			*ecode = DDPT_INV_STAG;
-		} else if (tagged == 2) {
+		if (send_inv) {
+			*layer_type = LAYER_RDMAP|RDMAP_REMOTE_OP;
+			*ecode = RDMAP_CANT_INV_STAG;
+		} else {
 			*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
 			*ecode = RDMAP_INV_STAG;
 		}
 		break;
 	case TPT_ERR_PDID:
+		*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
+		if ((opcode == T3_SEND_WITH_INV) ||
+		    (opcode == T3_SEND_WITH_SE_INV))
+			*ecode = RDMAP_CANT_INV_STAG;
+		else
+			*ecode = RDMAP_STAG_NOT_ASSOC;
+		break;
 	case TPT_ERR_QPID:
+		*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
+		*ecode = RDMAP_STAG_NOT_ASSOC;
+		break;
 	case TPT_ERR_ACCESS:
-		if (tagged == 1) {
-			*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
-			*ecode = DDPT_STAG_NOT_ASSOC;
-		} else if (tagged == 2) {
-			*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
-			*ecode = RDMAP_STAG_NOT_ASSOC;
-		}
+		*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
+		*ecode = RDMAP_ACC_VIOL;
 		break;
 	case TPT_ERR_WRAP:
 		*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
 		*ecode = RDMAP_TO_WRAP;
 		break;
 	case TPT_ERR_BOUND:
-		if (tagged == 1) {
+		if (tagged) {
 			*layer_type = LAYER_DDP|DDP_TAGGED_ERR;
 			*ecode = DDPT_BASE_BOUNDS;
-		} else if (tagged == 2) {
+		} else {
 			*layer_type = LAYER_RDMAP|RDMAP_REMOTE_PROT;
 			*ecode = RDMAP_BASE_BOUNDS;
-		} else {
-			*layer_type = LAYER_DDP|DDP_UNTAGGED_ERR;
-			*ecode = DDPU_MSG_TOOBIG;
 		}
 		break;
 	case TPT_ERR_INVALIDATE_SHARED_MR:
@@ -591,8 +610,6 @@ int iwch_post_terminate(struct iwch_qp *
 {
 	union t3_wr *wqe;
 	struct terminate_message *term;
-	int status;
-	int tagged = 0;
 	struct sk_buff *skb;
 
 	PDBG("%s %d\n", __FUNCTION__, __LINE__);
@@ -610,17 +627,7 @@ int iwch_post_terminate(struct iwch_qp *
 
 	/* immediate data starts here. */
 	term = (struct terminate_message *)wqe->send.sgl;
-	if (rsp_msg) {
-		status = CQE_STATUS(rsp_msg->cqe);
-		if (CQE_OPCODE(rsp_msg->cqe) == T3_RDMA_WRITE)
-			tagged = 1;
-		if ((CQE_OPCODE(rsp_msg->cqe) == T3_READ_REQ) ||
-		    (CQE_OPCODE(rsp_msg->cqe) == T3_READ_RESP))
-			tagged = 2;
-	} else {
-		status = TPT_ERR_INTERNAL_ERR;
-	}
-	build_term_codes(status, &term->layer_etype, &term->ecode, tagged);
+	build_term_codes(rsp_msg, &term->layer_etype, &term->ecode);
 	build_fw_riwrh((void *)wqe, T3_WR_SEND,
 		       T3_COMPLETION_FLAG | T3_NOTIFY_FLAG, 1,
 		       qhp->ep->hwtid, 5);

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

* [PATCH 2.6.22 2/5] iw_cxgb3: Fail qp creation if the requested max_inline is too large.
  2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes Steve Wise
@ 2007-04-26 20:21 ` Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 3/5] iw_cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message Steve Wise
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:21 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Fail qp creation if the requested max_inline is too large.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/cxio_wr.h       |    1 +
 drivers/infiniband/hw/cxgb3/iwch_provider.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/cxio_wr.h b/drivers/infiniband/hw/cxgb3/cxio_wr.h
index 90d7b89..ff7290e 100644
--- a/drivers/infiniband/hw/cxgb3/cxio_wr.h
+++ b/drivers/infiniband/hw/cxgb3/cxio_wr.h
@@ -38,6 +38,7 @@ #include <linux/timer.h>
 #include "firmware_exports.h"
 
 #define T3_MAX_SGE      4
+#define T3_MAX_INLINE	64
 
 #define Q_EMPTY(rptr,wptr) ((rptr)==(wptr))
 #define Q_FULL(rptr,wptr,size_log2)  ( (((wptr)-(rptr))>>(size_log2)) && \
diff --git a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
index 24e0df0..b1128ec 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
@@ -780,6 +780,9 @@ static struct ib_qp *iwch_create_qp(stru
 	if (rqsize > T3_MAX_RQ_SIZE)
 		return ERR_PTR(-EINVAL);
 
+	if (attrs->cap.max_inline_data > T3_MAX_INLINE)
+		return ERR_PTR(-EINVAL);
+
 	/*
 	 * NOTE: The SQ and total WQ sizes don't need to be
 	 * a power of two.  However, all the code assumes

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

* [PATCH 2.6.22 3/5] iw_cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message.
  2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 2/5] iw_cxgb3: Fail qp creation if the requested max_inline is too large Steve Wise
@ 2007-04-26 20:21 ` Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
  4 siblings, 0 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:21 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Initialize cpu_idx field in cpl_close_listserv_req message.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/iwch_cm.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 2d2de9b..a990423 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1187,6 +1187,7 @@ static int listen_stop(struct iwch_liste
 	}
 	req = (struct cpl_close_listserv_req *) skb_put(skb, sizeof(*req));
 	req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+	req->cpu_idx = 0;
 	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid));
 	skb->priority = 1;
 	ep->com.tdev->send(ep->com.tdev, skb);

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

* [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic.
  2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
                   ` (2 preceding siblings ...)
  2007-04-26 20:21 ` [PATCH 2.6.22 3/5] iw_cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message Steve Wise
@ 2007-04-26 20:21 ` Steve Wise
  2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
  4 siblings, 0 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:21 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Support for new abort logic.

The HW now posts 2 ABORT_RPL and/or PEER_ABORT_REQ messages.  We need
to handle them by silenty dropping the 1st but mark that we're ready
for the final message.  This plugs some close races between the uP and HW.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/infiniband/hw/cxgb3/iwch_cm.c |   18 ++++++++++++++++++
 drivers/infiniband/hw/cxgb3/iwch_cm.h |    6 ++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index a990423..3a46a97 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1107,6 +1107,15 @@ static int abort_rpl(struct t3cdev *tdev
 
 	PDBG("%s ep %p\n", __FUNCTION__, ep);
 
+	/*
+ 	 * We get 2 abort replies from the HW.  The first one must
+	 * be ignored except for scribbling that we need one more.
+	 */
+	if (!(ep->flags & ABORT_REQ_IN_PROGRESS)) {
+		ep->flags |= ABORT_REQ_IN_PROGRESS;
+		return CPL_RET_BUF_DONE;
+	}
+
 	close_complete_upcall(ep);
 	state_set(&ep->com, DEAD);
 	release_ep_resources(ep);
@@ -1474,6 +1483,15 @@ static int peer_abort(struct t3cdev *tde
 	int ret;
 	int state;
 
+	/*
+ 	 * We get 2 peer aborts from the HW.  The first one must
+	 * be ignored except for scribbling that we need one more.
+	 */
+	if (!(ep->flags & PEER_ABORT_IN_PROGRESS)) {
+		ep->flags |= PEER_ABORT_IN_PROGRESS;
+		return CPL_RET_BUF_DONE;
+	}
+
 	if (is_neg_adv_abort(req->status)) {
 		PDBG("%s neg_adv_abort ep %p tid %d\n", __FUNCTION__, ep,
 		     ep->hwtid);
diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.h b/drivers/infiniband/hw/cxgb3/iwch_cm.h
index 0c6f281..21a388c 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.h
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.h
@@ -143,6 +143,11 @@ enum iwch_ep_state {
 	DEAD,
 };
 
+enum iwch_ep_flags {
+	PEER_ABORT_IN_PROGRESS	= (1 << 0),
+	ABORT_REQ_IN_PROGRESS	= (1 << 1),
+};
+
 struct iwch_ep_common {
 	struct iw_cm_id *cm_id;
 	struct iwch_qp *qp;
@@ -181,6 +186,7 @@ struct iwch_ep {
 	u16 plen;
 	u32 ird;
 	u32 ord;
+	u32 flags;
 };
 
 static inline struct iwch_ep *to_ep(struct iw_cm_id *cm_id)

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

* [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0.
  2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
                   ` (3 preceding siblings ...)
  2007-04-26 20:21 ` [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic Steve Wise
@ 2007-04-26 20:21 ` Steve Wise
  2007-04-27  3:12   ` Roland Dreier
  2007-04-30 23:59   ` Roland Dreier
  4 siblings, 2 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-26 20:21 UTC (permalink / raw)
  To: rdreier, jeff; +Cc: divy, general, linux-kernel, netdev


Update required firmware revision to 4.0.0.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---

 drivers/net/cxgb3/version.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cxgb3/version.h b/drivers/net/cxgb3/version.h
index 042e27e..b112317 100644
--- a/drivers/net/cxgb3/version.h
+++ b/drivers/net/cxgb3/version.h
@@ -38,7 +38,7 @@ #define DRV_NAME "cxgb3"
 #define DRV_VERSION "1.0-ko"
 
 /* Firmware version */
-#define FW_VERSION_MAJOR 3
-#define FW_VERSION_MINOR 3
+#define FW_VERSION_MAJOR 4
+#define FW_VERSION_MINOR 0
 #define FW_VERSION_MICRO 0
 #endif				/* __CHELSIO_VERSION_H */

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

* Re: [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0.
  2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
@ 2007-04-27  3:12   ` Roland Dreier
  2007-04-27 13:03     ` Steve Wise
  2007-04-27 16:52     ` Divy Le Ray
  2007-04-30 23:59   ` Roland Dreier
  1 sibling, 2 replies; 10+ messages in thread
From: Roland Dreier @ 2007-04-27  3:12 UTC (permalink / raw)
  To: Steve Wise; +Cc: jeff, divy, general, linux-kernel, netdev

 > Update required firmware revision to 4.0.0.

Hmm... should we fold this into the earlier patch, which actually
needs this new FW?  Or at least merge this patch first?

Also, is it cool with everyone to require a new FW, even for users who
might not be using (or even building) the RDMA driver?  I'm not sure
what a good solution would be really, so maybe the pain of forcing
everyone to update FW is the least bad thing to do.

 - R.

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

* Re: [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0.
  2007-04-27  3:12   ` Roland Dreier
@ 2007-04-27 13:03     ` Steve Wise
  2007-04-27 16:52     ` Divy Le Ray
  1 sibling, 0 replies; 10+ messages in thread
From: Steve Wise @ 2007-04-27 13:03 UTC (permalink / raw)
  To: Roland Dreier; +Cc: jeff, divy, general, linux-kernel, netdev

On Thu, 2007-04-26 at 20:12 -0700, Roland Dreier wrote:
>  > Update required firmware revision to 4.0.0.
> 
> Hmm... should we fold this into the earlier patch, which actually
> needs this new FW?  Or at least merge this patch first?
> 

I separated it only because cxgb3 is maintained by Jeff.  Feel free to
make it one commit.  That is the proper way IMO. But I didn't know what
SOP was for changes that hit different maintainers but are prerequisites
of each other...


> Also, is it cool with everyone to require a new FW, even for users who
> might not be using (or even building) the RDMA driver?  I'm not sure
> what a good solution would be really, so maybe the pain of forcing
> everyone to update FW is the least bad thing to do.
>  - R.

I was asked to package the firmware version change along with my rdma
changes by Divy since they didn't have any other cxgb3 changes right
now.  I believe Chelsio wants folks on this new firmware asap.


Steve.






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

* Re: [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0.
  2007-04-27  3:12   ` Roland Dreier
  2007-04-27 13:03     ` Steve Wise
@ 2007-04-27 16:52     ` Divy Le Ray
  1 sibling, 0 replies; 10+ messages in thread
From: Divy Le Ray @ 2007-04-27 16:52 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Steve Wise, jeff, general, linux-kernel, netdev

Roland Dreier wrote:
>  > Update required firmware revision to 4.0.0.
>
> Hmm... should we fold this into the earlier patch, which actually
> needs this new FW?  Or at least merge this patch first?
>
> Also, is it cool with everyone to require a new FW, even for users who
> might not be using (or even building) the RDMA driver?  I'm not sure
> what a good solution would be really, so maybe the pain of forcing
> everyone to update FW is the least bad thing to do.
>
>  
Hi Roland,

The FW update required code changes in the RDMA driver, so Steve took 
care of submitting the update patch.
The new FW is required for the NIC driver too.

Cheers,
Divy

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

* Re: [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0.
  2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
  2007-04-27  3:12   ` Roland Dreier
@ 2007-04-30 23:59   ` Roland Dreier
  1 sibling, 0 replies; 10+ messages in thread
From: Roland Dreier @ 2007-04-30 23:59 UTC (permalink / raw)
  To: Steve Wise; +Cc: jeff, divy, general, linux-kernel, netdev

Thanks, I applied all 5, with the FW version change rolled up into #4/5.

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

end of thread, other threads:[~2007-04-30 23:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 20:20 [PATCH 2.6.22 0/5] iw_cxgb3: Bug Fixes + Firmware update Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 1/5] iw_cxgb3: Fix TERM codes Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 2/5] iw_cxgb3: Fail qp creation if the requested max_inline is too large Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 3/5] iw_cxgb3: Initialize cpu_idx field in cpl_close_listserv_req message Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 4/5] iw_cxgb3: Support for new abort logic Steve Wise
2007-04-26 20:21 ` [PATCH 2.6.22 5/5] iw_cxgb3: Update required firmware revision to 4.0.0 Steve Wise
2007-04-27  3:12   ` Roland Dreier
2007-04-27 13:03     ` Steve Wise
2007-04-27 16:52     ` Divy Le Ray
2007-04-30 23:59   ` Roland Dreier

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).