mirror of https://gitee.com/openkylin/linux.git
s390/qdio: add statistics helper macro
qperf_inc() takes a queue as input, but actually updates the statistics in its qdio_irq parent. In some contexts we already have access to the qdio_irq struct, and can avoid the additional dereference. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
d86f71fd43
commit
4611281021
|
@ -317,13 +317,15 @@ struct qdio_irq {
|
|||
|
||||
#define qperf(__qdev, __attr) ((__qdev)->perf_stat.(__attr))
|
||||
|
||||
#define qperf_inc(__q, __attr) \
|
||||
#define QDIO_PERF_STAT_INC(__irq, __attr) \
|
||||
({ \
|
||||
struct qdio_irq *qdev = (__q)->irq_ptr; \
|
||||
struct qdio_irq *qdev = __irq; \
|
||||
if (qdev->perf_stat_enabled) \
|
||||
(qdev->perf_stat.__attr)++; \
|
||||
})
|
||||
|
||||
#define qperf_inc(__q, __attr) QDIO_PERF_STAT_INC((__q)->irq_ptr, __attr)
|
||||
|
||||
static inline void account_sbals_error(struct qdio_q *q, int count)
|
||||
{
|
||||
q->q_stats.nr_sbal_error += count;
|
||||
|
|
|
@ -963,7 +963,7 @@ static void qdio_int_handler_pci(struct qdio_irq *irq_ptr)
|
|||
/* skip if polling is enabled or already in work */
|
||||
if (test_and_set_bit(QDIO_QUEUE_IRQS_DISABLED,
|
||||
&q->u.in.queue_irq_state)) {
|
||||
qperf_inc(q, int_discarded);
|
||||
QDIO_PERF_STAT_INC(irq_ptr, int_discarded);
|
||||
continue;
|
||||
}
|
||||
q->u.in.queue_start_poll(q->irq_ptr->cdev, q->nr,
|
||||
|
|
|
@ -146,7 +146,7 @@ static inline void tiqdio_call_inq_handlers(struct qdio_irq *irq)
|
|||
/* skip if polling is enabled or already in work */
|
||||
if (test_and_set_bit(QDIO_QUEUE_IRQS_DISABLED,
|
||||
&q->u.in.queue_irq_state)) {
|
||||
qperf_inc(q, int_discarded);
|
||||
QDIO_PERF_STAT_INC(irq, int_discarded);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ static void tiqdio_thinint_handler(struct airq_struct *airq, bool floating)
|
|||
|
||||
tiqdio_call_inq_handlers(irq);
|
||||
|
||||
qperf_inc(q, adapter_int);
|
||||
QDIO_PERF_STAT_INC(irq, adapter_int);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue