s390/qeth: fixes 2020-03-10
Subsystems (4)
cover s390/qeth: fixes 2020-03-10
Hi Dave,
please apply the following patch series for qeth to netdev's net tree.
This fixes three minor issues:
1) a setup parameter gets cleared unnecessarily when the HW config changes,
2) insufficient error handling when initially filling the RX ring, and
3) a rarely used worker that needs to be cancelled during tear down.
Thanks,
Julian
Julian Wiedmann (3):
s390/qeth: don't reset default_out_queue
s390/qeth: handle error when backing RX buffer
s390/qeth: cancel RX reclaim work earlier
drivers/s390/net/qeth_core_main.c | 15 +++++++++------ drivers/s390/net/qeth_l2_main.c | 1 + drivers/s390/net/qeth_l3_main.c | 1 + 3 files changed, 11 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/3 s390/qeth: don't reset default_out_queue
When an OSA device in prio-queue setup is reduced to 1 TX queue due to HW restrictions, we reset its the default_out_queue to 0.
In the old code this was needed so that qeth_get_priority_queue() gets the queue selection right. But with proper multiqueue support we already reduced dev->real_num_tx_queues to 1, and so the stack puts all traffic on txq 0 without even calling .ndo_select_queue.
Thus we can preserve the user's configuration, and apply it if the OSA device later re-gains support for multiple TX queues.
--- drivers/s390/net/qeth_core_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/s390/net/qeth_core_main.c +0 -1
@@ -1204,7 +1204,6 @@ static int qeth_osa_set_output_queues(struct qeth_card *card, bool single)if (count ==1 )dev_info (&card->gdev->dev,"Priority Queueing not supported\n" ); - card->qdio.default_out_queue = single ?0 :QETH_DEFAULT_QUEUE ; card->qdio.no_out_queues = count;return 0 ; }
Signature · 1 line
2.17.1
PATCH 2/3 s390/qeth: handle error when backing RX buffer
In reply to Julian Wiedmannqeth_init_qdio_queues() fills the RX ring with an initial set of RX buffers. If qeth_init_input_buffer() fails to back one of the RX buffers with memory, we need to bail out and report the error.
--- drivers/s390/net/qeth_core_main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/s390/net/qeth_core_main.c +9 -4
@@ -2624,12 +2624,12 @@ static int qeth_init_input_buffer(struct qeth_card *card,ETH_HLEN + sizeof(struct ipv6hdr));if (!buf->rx_skb) -return 1 ; +return -ENOMEM ; } pool_entry =qeth_find_free_buffer_pool_entry (card);if (!pool_entry) -return 1 ; +return -ENOBUFS ;/* * since the buffer is accessed only from the input_tasklet
@@ -2674,10 +2674,15 @@ static int qeth_init_qdio_queues(struct qeth_card *card)/* inbound queue */ qdio_reset_buffers (card->qdio.in_q->qdio_bufs,QDIO_MAX_BUFFERS_PER_Q );memset (&card->rx,0 ,sizeof (struct qeth_rx )); +qeth_initialize_working_pool_list (card);/*give only as many buffers to hardware as we have buffer pool entries*/ -for (i =0 ; i < card->qdio.in_buf_pool.buf_count -1 ; ++i) -qeth_init_input_buffer (card, &card->qdio.in_q->bufs[i]); +for (i =0 ; i < card->qdio.in_buf_pool.buf_count -1 ; i++) { + rc =qeth_init_input_buffer (card, &card->qdio.in_q->bufs[i]); +if (rc) +return rc; + } + card->qdio.in_q->next_buf_to_init = card->qdio.in_buf_pool.buf_count -1 ; rc = do_QDIO(CARD_DDEV(card), QDIO_FLAG_SYNC_INPUT, 0, 0,
Signature · 1 line
2.17.1
PATCH 3/3 s390/qeth: cancel RX reclaim work earlier
In reply to Julian WiedmannWhen qeth's napi poll code fails to refill an entirely empty RX ring, it kicks off buffer_reclaim_work to try again later.
Make sure that this worker is cancelled when setting the qeth device offline. Otherwise a RX refill action can unexpectedly end up running concurrently to bigger re-configurations (eg. resizing the buffer pool), without any locking.
--- drivers/s390/net/qeth_core_main.c | 1 - drivers/s390/net/qeth_l2_main.c | 1 + drivers/s390/net/qeth_l3_main.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-)
drivers/s390/net/qeth_core_main.c +0 -1
@@ -2392,7 +2392,6 @@ static void qeth_free_qdio_queues(struct qeth_card *card)return ;qeth_free_cq (card); -cancel_delayed_work_sync (&card->buffer_reclaim_work);for (j =0 ; j <QDIO_MAX_BUFFERS_PER_Q ; ++j) {if (card->qdio.in_q->bufs[j].rx_skb)dev_kfree_skb_any (card->qdio.in_q->bufs[j].rx_skb);
drivers/s390/net/qeth_l2_main.c +1 -0
@@ -284,6 +284,7 @@ static void qeth_l2_stop_card(struct qeth_card *card)if (card->state ==CARD_STATE_SOFTSETUP ) {qeth_clear_ipacmd_list (card);qeth_drain_output_queues (card); +cancel_delayed_work_sync (&card->buffer_reclaim_work); card->state =CARD_STATE_DOWN ; }
drivers/s390/net/qeth_l3_main.c +1 -0
@@ -1178,6 +1178,7 @@ static void qeth_l3_stop_card(struct qeth_card *card)qeth_l3_clear_ip_htable (card,1 );qeth_clear_ipacmd_list (card);qeth_drain_output_queues (card); +cancel_delayed_work_sync (&card->buffer_reclaim_work); card->state =CARD_STATE_DOWN ; }
Signature · 1 line
2.17.1
David Miller
maintainerFrom: Julian Wiedmann <[email protected]>
Date: Tue, 10 Mar 2020 18:38:00 +0100
Quoted 7 lines
please apply the following patch series for qeth to netdev's net tree.
This fixes three minor issues:
1) a setup parameter gets cleared unnecessarily when the HW config changes,
2) insufficient error handling when initially filling the RX ring, and
3) a rarely used worker that needs to be cancelled during tear down.
Series applied and queued up for -stable, thank you.