|
@@ -392,6 +392,20 @@ static inline void qdio_stop_polling(struct qdio_q *q)
|
|
set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
|
|
set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline void account_sbals(struct qdio_q *q, int count)
|
|
|
|
+{
|
|
|
|
+ int pos = 0;
|
|
|
|
+
|
|
|
|
+ q->q_stats.nr_sbal_total += count;
|
|
|
|
+ if (count == QDIO_MAX_BUFFERS_MASK) {
|
|
|
|
+ q->q_stats.nr_sbals[7]++;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ while (count >>= 1)
|
|
|
|
+ pos++;
|
|
|
|
+ q->q_stats.nr_sbals[pos]++;
|
|
|
|
+}
|
|
|
|
+
|
|
static void announce_buffer_error(struct qdio_q *q, int count)
|
|
static void announce_buffer_error(struct qdio_q *q, int count)
|
|
{
|
|
{
|
|
q->qdio_error |= QDIO_ERROR_SLSB_STATE;
|
|
q->qdio_error |= QDIO_ERROR_SLSB_STATE;
|
|
@@ -487,16 +501,22 @@ static int get_inbound_buffer_frontier(struct qdio_q *q)
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
if (atomic_sub(count, &q->nr_buf_used) == 0)
|
|
if (atomic_sub(count, &q->nr_buf_used) == 0)
|
|
qperf_inc(q, inbound_queue_full);
|
|
qperf_inc(q, inbound_queue_full);
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ account_sbals(q, count);
|
|
break;
|
|
break;
|
|
case SLSB_P_INPUT_ERROR:
|
|
case SLSB_P_INPUT_ERROR:
|
|
announce_buffer_error(q, count);
|
|
announce_buffer_error(q, count);
|
|
/* process the buffer, the upper layer will take care of it */
|
|
/* process the buffer, the upper layer will take care of it */
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ account_sbals_error(q, count);
|
|
break;
|
|
break;
|
|
case SLSB_CU_INPUT_EMPTY:
|
|
case SLSB_CU_INPUT_EMPTY:
|
|
case SLSB_P_INPUT_NOT_INIT:
|
|
case SLSB_P_INPUT_NOT_INIT:
|
|
case SLSB_P_INPUT_ACK:
|
|
case SLSB_P_INPUT_ACK:
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ q->q_stats.nr_sbal_nop++;
|
|
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop");
|
|
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in nop");
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
@@ -643,15 +663,21 @@ static int get_outbound_buffer_frontier(struct qdio_q *q)
|
|
|
|
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ account_sbals(q, count);
|
|
break;
|
|
break;
|
|
case SLSB_P_OUTPUT_ERROR:
|
|
case SLSB_P_OUTPUT_ERROR:
|
|
announce_buffer_error(q, count);
|
|
announce_buffer_error(q, count);
|
|
/* process the buffer, the upper layer will take care of it */
|
|
/* process the buffer, the upper layer will take care of it */
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
q->first_to_check = add_buf(q->first_to_check, count);
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
atomic_sub(count, &q->nr_buf_used);
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ account_sbals_error(q, count);
|
|
break;
|
|
break;
|
|
case SLSB_CU_OUTPUT_PRIMED:
|
|
case SLSB_CU_OUTPUT_PRIMED:
|
|
/* the adapter has not fetched the output yet */
|
|
/* the adapter has not fetched the output yet */
|
|
|
|
+ if (q->irq_ptr->perf_stat_enabled)
|
|
|
|
+ q->q_stats.nr_sbal_nop++;
|
|
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d", q->nr);
|
|
DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "out primed:%1d", q->nr);
|
|
break;
|
|
break;
|
|
case SLSB_P_OUTPUT_NOT_INIT:
|
|
case SLSB_P_OUTPUT_NOT_INIT:
|