Commit 7b579ce5 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: don't clear Output buffers on every queue init

On the first initialization of a queue, its Output Buffers are in a
clean state with no attached resources. On every subsequent
initialization, qeth_l?_stop_card() has previously put them in a clean
state via qeth_drain_output_queues(). So the call to
qeth_clear_output_buffer() is redundant and can be removed.

While at it, move the initialization of the queue's card pointer into
the queue allocation. It never changes afterwards.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 379ac99e
...@@ -2386,6 +2386,7 @@ static int qeth_alloc_qdio_queues(struct qeth_card *card) ...@@ -2386,6 +2386,7 @@ static int qeth_alloc_qdio_queues(struct qeth_card *card)
goto out_freeoutq; goto out_freeoutq;
QETH_DBF_TEXT_(SETUP, 2, "outq %i", i); QETH_DBF_TEXT_(SETUP, 2, "outq %i", i);
QETH_DBF_HEX(SETUP, 2, &card->qdio.out_qs[i], sizeof(void *)); QETH_DBF_HEX(SETUP, 2, &card->qdio.out_qs[i], sizeof(void *));
card->qdio.out_qs[i]->card = card;
card->qdio.out_qs[i]->queue_no = i; card->qdio.out_qs[i]->queue_no = i;
/* give outbound qeth_qdio_buffers their qdio_buffers */ /* give outbound qeth_qdio_buffers their qdio_buffers */
for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) { for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) {
...@@ -2697,7 +2698,7 @@ static int qeth_init_input_buffer(struct qeth_card *card, ...@@ -2697,7 +2698,7 @@ static int qeth_init_input_buffer(struct qeth_card *card,
int qeth_init_qdio_queues(struct qeth_card *card) int qeth_init_qdio_queues(struct qeth_card *card)
{ {
int i, j; unsigned int i;
int rc; int rc;
QETH_DBF_TEXT(SETUP, 2, "initqdqs"); QETH_DBF_TEXT(SETUP, 2, "initqdqs");
...@@ -2728,11 +2729,6 @@ int qeth_init_qdio_queues(struct qeth_card *card) ...@@ -2728,11 +2729,6 @@ int qeth_init_qdio_queues(struct qeth_card *card)
for (i = 0; i < card->qdio.no_out_queues; ++i) { for (i = 0; i < card->qdio.no_out_queues; ++i) {
qdio_reset_buffers(card->qdio.out_qs[i]->qdio_bufs, qdio_reset_buffers(card->qdio.out_qs[i]->qdio_bufs,
QDIO_MAX_BUFFERS_PER_Q); QDIO_MAX_BUFFERS_PER_Q);
for (j = 0; j < QDIO_MAX_BUFFERS_PER_Q; ++j) {
qeth_clear_output_buffer(card->qdio.out_qs[i],
card->qdio.out_qs[i]->bufs[j]);
}
card->qdio.out_qs[i]->card = card;
card->qdio.out_qs[i]->next_buf_to_fill = 0; card->qdio.out_qs[i]->next_buf_to_fill = 0;
card->qdio.out_qs[i]->do_pack = 0; card->qdio.out_qs[i]->do_pack = 0;
atomic_set(&card->qdio.out_qs[i]->used_buffers, 0); atomic_set(&card->qdio.out_qs[i]->used_buffers, 0);
......
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