|
@@ -4103,7 +4103,8 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
|
|
flush_count);
|
|
flush_count);
|
|
atomic_set(&queue->state,
|
|
atomic_set(&queue->state,
|
|
QETH_OUT_Q_UNLOCKED);
|
|
QETH_OUT_Q_UNLOCKED);
|
|
- return -EBUSY;
|
|
|
|
|
|
+ rc = -EBUSY;
|
|
|
|
+ goto out;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4122,19 +4123,21 @@ int qeth_do_send_packet(struct qeth_card *card, struct qeth_qdio_out_q *queue,
|
|
* In that case we will enter this loop
|
|
* In that case we will enter this loop
|
|
*/
|
|
*/
|
|
while (atomic_dec_return(&queue->state)) {
|
|
while (atomic_dec_return(&queue->state)) {
|
|
- flush_count = 0;
|
|
|
|
start_index = queue->next_buf_to_fill;
|
|
start_index = queue->next_buf_to_fill;
|
|
/* check if we can go back to non-packing state */
|
|
/* check if we can go back to non-packing state */
|
|
- flush_count += qeth_switch_to_nonpacking_if_needed(queue);
|
|
|
|
|
|
+ tmp = qeth_switch_to_nonpacking_if_needed(queue);
|
|
/*
|
|
/*
|
|
* check if we need to flush a packing buffer to get a pci
|
|
* check if we need to flush a packing buffer to get a pci
|
|
* flag out on the queue
|
|
* flag out on the queue
|
|
*/
|
|
*/
|
|
- if (!flush_count && !atomic_read(&queue->set_pci_flags_count))
|
|
|
|
- flush_count += qeth_prep_flush_pack_buffer(queue);
|
|
|
|
- if (flush_count)
|
|
|
|
- qeth_flush_buffers(queue, start_index, flush_count);
|
|
|
|
|
|
+ if (!tmp && !atomic_read(&queue->set_pci_flags_count))
|
|
|
|
+ tmp = qeth_prep_flush_pack_buffer(queue);
|
|
|
|
+ if (tmp) {
|
|
|
|
+ qeth_flush_buffers(queue, start_index, tmp);
|
|
|
|
+ flush_count += tmp;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+out:
|
|
/* at this point the queue is UNLOCKED again */
|
|
/* at this point the queue is UNLOCKED again */
|
|
if (queue->card->options.performance_stats && do_pack)
|
|
if (queue->card->options.performance_stats && do_pack)
|
|
queue->card->perf_stats.bufs_sent_pack += flush_count;
|
|
queue->card->perf_stats.bufs_sent_pack += flush_count;
|