Commit 69e96207 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Heiko Carstens

s390/qdio: restrict QAOB usage to IQD unicast queues

The IQD mcast queue doesn't support QAOB mode, so skip the
qdio_enable_async_operation() setup call for this queue. This avoids
the allocation of an unneeded QAOB pointer array, and sets up q->use_cq
properly so that drivers are prohibited from using QAOBs for mcast
traffic.

Take this opportunity to streamline the q->use_cq and aob != 0 checks.
The path to qdio_siga_output() is straight-forward, we don't need to
worry about being called with bad operands.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent a6ec414a
...@@ -319,9 +319,7 @@ static int qdio_siga_output(struct qdio_q *q, unsigned int *busy_bit, ...@@ -319,9 +319,7 @@ static int qdio_siga_output(struct qdio_q *q, unsigned int *busy_bit,
int retries = 0, cc; int retries = 0, cc;
unsigned long laob = 0; unsigned long laob = 0;
WARN_ON_ONCE(aob && ((queue_type(q) != QDIO_IQDIO_QFMT) || if (aob) {
!q->u.out.use_cq));
if (q->u.out.use_cq && aob != 0) {
fc = QDIO_SIGA_WRITEQ; fc = QDIO_SIGA_WRITEQ;
laob = aob; laob = aob;
} }
...@@ -621,9 +619,6 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q, ...@@ -621,9 +619,6 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q,
{ {
unsigned long phys_aob = 0; unsigned long phys_aob = 0;
if (!q->use_cq)
return 0;
if (!q->aobs[bufnr]) { if (!q->aobs[bufnr]) {
struct qaob *aob = qdio_allocate_aob(); struct qaob *aob = qdio_allocate_aob();
q->aobs[bufnr] = aob; q->aobs[bufnr] = aob;
...@@ -1308,6 +1303,8 @@ static void qdio_detect_hsicq(struct qdio_irq *irq_ptr) ...@@ -1308,6 +1303,8 @@ static void qdio_detect_hsicq(struct qdio_irq *irq_ptr)
for_each_output_queue(irq_ptr, q, i) { for_each_output_queue(irq_ptr, q, i) {
if (use_cq) { if (use_cq) {
if (multicast_outbound(q))
continue;
if (qdio_enable_async_operation(&q->u.out) < 0) { if (qdio_enable_async_operation(&q->u.out) < 0) {
use_cq = 0; use_cq = 0;
continue; continue;
...@@ -1553,7 +1550,8 @@ static int handle_outbound(struct qdio_q *q, unsigned int callflags, ...@@ -1553,7 +1550,8 @@ static int handle_outbound(struct qdio_q *q, unsigned int callflags,
/* One SIGA-W per buffer required for unicast HSI */ /* One SIGA-W per buffer required for unicast HSI */
WARN_ON_ONCE(count > 1 && !multicast_outbound(q)); WARN_ON_ONCE(count > 1 && !multicast_outbound(q));
phys_aob = qdio_aob_for_buffer(&q->u.out, bufnr); if (q->u.out.use_cq)
phys_aob = qdio_aob_for_buffer(&q->u.out, bufnr);
rc = qdio_kick_outbound_q(q, phys_aob); rc = qdio_kick_outbound_q(q, phys_aob);
} else if (need_siga_sync(q)) { } else if (need_siga_sync(q)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment