s390/qeth: allocate initial TX Buffer structs with GFP_KERNEL
qeth_init_qdio_out_buf() is typically called during initialization, and the GFP_ATOMIC is only needed for a very specific & rare case during TX completion. Allow callers to specify a gfp mask, so that the initialization path can select GFP_KERNEL. While at it also clarify the function name. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c2ed62b997
commit
e47ded97f9
|
@ -2590,11 +2590,12 @@ static int qeth_ulp_setup(struct qeth_card *card)
|
|||
return qeth_send_control_data(card, iob, qeth_ulp_setup_cb, NULL);
|
||||
}
|
||||
|
||||
static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *q, int bidx)
|
||||
static int qeth_alloc_out_buf(struct qeth_qdio_out_q *q, unsigned int bidx,
|
||||
gfp_t gfp)
|
||||
{
|
||||
struct qeth_qdio_out_buffer *newbuf;
|
||||
|
||||
newbuf = kmem_cache_zalloc(qeth_qdio_outbuf_cache, GFP_ATOMIC);
|
||||
newbuf = kmem_cache_zalloc(qeth_qdio_outbuf_cache, gfp);
|
||||
if (!newbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@ -2629,7 +2630,7 @@ static struct qeth_qdio_out_q *qeth_alloc_output_queue(void)
|
|||
goto err_qdio_bufs;
|
||||
|
||||
for (i = 0; i < QDIO_MAX_BUFFERS_PER_Q; i++) {
|
||||
if (qeth_init_qdio_out_buf(q, i))
|
||||
if (qeth_alloc_out_buf(q, i, GFP_KERNEL))
|
||||
goto err_out_bufs;
|
||||
}
|
||||
|
||||
|
@ -6088,7 +6089,8 @@ static void qeth_iqd_tx_complete(struct qeth_qdio_out_q *queue,
|
|||
|
||||
/* Prepare the queue slot for immediate re-use: */
|
||||
qeth_scrub_qdio_buffer(buffer->buffer, queue->max_elements);
|
||||
if (qeth_init_qdio_out_buf(queue, bidx)) {
|
||||
if (qeth_alloc_out_buf(queue, bidx,
|
||||
GFP_ATOMIC)) {
|
||||
QETH_CARD_TEXT(card, 2, "outofbuf");
|
||||
qeth_schedule_recovery(card);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue