Re: [PATCH 1/2][RESEND] ehea: error handling improvement

2010-04-23 Thread Thomas Klein

On 04/22/2010 07:36 AM, David Miller wrote:

From: Thomas Klein
Date: Wed, 21 Apr 2010 11:10:55 +0200


Reset a port's resources only if they're actually in an error state

Signed-off-by: Thomas Klein
---

Patch created against net-2.6


I thought you were sorry for wasting my time and that you were going
to follow the directions I gave you last time, and I quote:


3) These are not appropriate for net-2.6 as we are deep in
the -rcX series at this point and only the most diabolical
bug fixes are appropriate.  Therefore, please generate these
against net-next-2.6, thanks.


And here you are generating your patches against net-2.6.  Heck, you
even feel it's worth mentioning explicitly.


Guilty! Allows no excuse. Screwed it. Deeply sorry.



Lucky for you the patches happen to apply cleanly to net-next-2.6 so
I've put them there.


Thanks!
Thomas


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/2][RESEND] ehea: error handling improvement

2010-04-21 Thread David Miller
From: Thomas Klein 
Date: Wed, 21 Apr 2010 11:10:55 +0200

> Reset a port's resources only if they're actually in an error state
> 
> Signed-off-by: Thomas Klein 
> ---
> 
> Patch created against net-2.6

I thought you were sorry for wasting my time and that you were going
to follow the directions I gave you last time, and I quote:


3) These are not appropriate for net-2.6 as we are deep in
   the -rcX series at this point and only the most diabolical
   bug fixes are appropriate.  Therefore, please generate these
   against net-next-2.6, thanks.


And here you are generating your patches against net-2.6.  Heck, you
even feel it's worth mentioning explicitly.

Lucky for you the patches happen to apply cleanly to net-next-2.6 so
I've put them there.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/2][RESEND] ehea: error handling improvement

2010-04-21 Thread Thomas Klein
Reset a port's resources only if they're actually in an error state

Signed-off-by: Thomas Klein 
---

Patch created against net-2.6

diff -Nurp net-2.6.orig/drivers/net/ehea/ehea_main.c 
net-2.6/drivers/net/ehea/ehea_main.c
--- net-2.6.orig/drivers/net/ehea/ehea_main.c   2010-04-21 10:23:21.0 
+0200
+++ net-2.6/drivers/net/ehea/ehea_main.c2010-04-21 10:41:21.0 
+0200
@@ -791,11 +791,17 @@ static struct ehea_cqe *ehea_proc_cqes(s
cqe_counter++;
rmb();
if (cqe->status & EHEA_CQE_STAT_ERR_MASK) {
-   ehea_error("Send Completion Error: Resetting port");
+   ehea_error("Bad send completion status=0x%04X",
+  cqe->status);
+
if (netif_msg_tx_err(pr->port))
ehea_dump(cqe, sizeof(*cqe), "Send CQE");
-   ehea_schedule_port_reset(pr->port);
-   break;
+
+   if (cqe->status & EHEA_CQE_STAT_RESET_MASK) {
+   ehea_error("Resetting port");
+   ehea_schedule_port_reset(pr->port);
+   break;
+   }
}
 
if (netif_msg_tx_done(pr->port))
@@ -901,6 +907,8 @@ static irqreturn_t ehea_qp_aff_irq_handl
struct ehea_eqe *eqe;
struct ehea_qp *qp;
u32 qp_token;
+   u64 resource_type, aer, aerr;
+   int reset_port = 0;
 
eqe = ehea_poll_eq(port->qp_eq);
 
@@ -910,11 +918,24 @@ static irqreturn_t ehea_qp_aff_irq_handl
   eqe->entry, qp_token);
 
qp = port->port_res[qp_token].qp;
-   ehea_error_data(port->adapter, qp->fw_handle);
+
+   resource_type = ehea_error_data(port->adapter, qp->fw_handle,
+   &aer, &aerr);
+
+   if (resource_type == EHEA_AER_RESTYPE_QP) {
+   if ((aer & EHEA_AER_RESET_MASK) ||
+   (aerr & EHEA_AERR_RESET_MASK))
+reset_port = 1;
+   } else
+   reset_port = 1;   /* Reset in case of CQ or EQ error */
+
eqe = ehea_poll_eq(port->qp_eq);
}
 
-   ehea_schedule_port_reset(port);
+   if (reset_port) {
+   ehea_error("Resetting port");
+   ehea_schedule_port_reset(port);
+   }
 
return IRQ_HANDLED;
 }
diff -Nurp net-2.6.orig/drivers/net/ehea/ehea_qmr.c 
net-2.6/drivers/net/ehea/ehea_qmr.c
--- net-2.6.orig/drivers/net/ehea/ehea_qmr.c2010-04-21 10:23:21.0 
+0200
+++ net-2.6/drivers/net/ehea/ehea_qmr.c 2010-04-21 10:41:21.0 +0200
@@ -229,14 +229,14 @@ u64 ehea_destroy_cq_res(struct ehea_cq *
 
 int ehea_destroy_cq(struct ehea_cq *cq)
 {
-   u64 hret;
+   u64 hret, aer, aerr;
if (!cq)
return 0;
 
hcp_epas_dtor(&cq->epas);
hret = ehea_destroy_cq_res(cq, NORMAL_FREE);
if (hret == H_R_STATE) {
-   ehea_error_data(cq->adapter, cq->fw_handle);
+   ehea_error_data(cq->adapter, cq->fw_handle, &aer, &aerr);
hret = ehea_destroy_cq_res(cq, FORCE_FREE);
}
 
@@ -357,7 +357,7 @@ u64 ehea_destroy_eq_res(struct ehea_eq *
 
 int ehea_destroy_eq(struct ehea_eq *eq)
 {
-   u64 hret;
+   u64 hret, aer, aerr;
if (!eq)
return 0;
 
@@ -365,7 +365,7 @@ int ehea_destroy_eq(struct ehea_eq *eq)
 
hret = ehea_destroy_eq_res(eq, NORMAL_FREE);
if (hret == H_R_STATE) {
-   ehea_error_data(eq->adapter, eq->fw_handle);
+   ehea_error_data(eq->adapter, eq->fw_handle, &aer, &aerr);
hret = ehea_destroy_eq_res(eq, FORCE_FREE);
}
 
@@ -540,7 +540,7 @@ u64 ehea_destroy_qp_res(struct ehea_qp *
 
 int ehea_destroy_qp(struct ehea_qp *qp)
 {
-   u64 hret;
+   u64 hret, aer, aerr;
if (!qp)
return 0;
 
@@ -548,7 +548,7 @@ int ehea_destroy_qp(struct ehea_qp *qp)
 
hret = ehea_destroy_qp_res(qp, NORMAL_FREE);
if (hret == H_R_STATE) {
-   ehea_error_data(qp->adapter, qp->fw_handle);
+   ehea_error_data(qp->adapter, qp->fw_handle, &aer, &aerr);
hret = ehea_destroy_qp_res(qp, FORCE_FREE);
}
 
@@ -986,42 +986,45 @@ void print_error_data(u64 *data)
if (length > EHEA_PAGESIZE)
length = EHEA_PAGESIZE;
 
-   if (type == 0x8) /* Queue Pair */
+   if (type == EHEA_AER_RESTYPE_QP)
ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
   "port=%llX", resource, data[6], data[12], data[22]);
-
-   if (type == 0x4) /* Completion Queue */
+   else if (type == EHEA_AER_RESTYPE_CQ)
ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,