* [PATCH V1 net-next] net: ena: Fix bug where ring allocation backoff stopped too late
@ 2019-06-23 7:11 sameehj
2019-06-23 15:39 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: sameehj @ 2019-06-23 7:11 UTC (permalink / raw)
To: davem, netdev
Cc: Sameeh Jubran, dwmw, zorik, matua, saeedb, msw, aliguori, nafea,
gtzalik, netanel, alisaidi, benh, akiyano
From: Sameeh Jubran <sameehj@amazon.com>
The current code of create_queues_with_size_backoff() allows the ring size
to become as small as ENA_MIN_RING_SIZE/2. This is a bug since we don't
want the queue ring to be smaller than ENA_MIN_RING_SIZE
In this commit we change the loop's termination condition to look at the
queue size of the next iteration instead of that of the current one,
so that the minimal queue size again becomes ENA_MIN_RING_SIZE.
Fixes: eece4d2ab9d2 ("net: ena: add ethtool function for changing io queue sizes")
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
---
drivers/net/ethernet/amazon/ena/ena_netdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index b7865ee1d..20ec8ff03 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1839,8 +1839,8 @@ err_setup_tx:
if (cur_rx_ring_size >= cur_tx_ring_size)
new_rx_ring_size = cur_rx_ring_size / 2;
- if (cur_tx_ring_size < ENA_MIN_RING_SIZE ||
- cur_rx_ring_size < ENA_MIN_RING_SIZE) {
+ if (new_tx_ring_size < ENA_MIN_RING_SIZE ||
+ new_rx_ring_size < ENA_MIN_RING_SIZE) {
netif_err(adapter, ifup, adapter->netdev,
"Queue creation failed with the smallest possible queue size of %d for both queues. Not retrying with smaller queues\n",
ENA_MIN_RING_SIZE);
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V1 net-next] net: ena: Fix bug where ring allocation backoff stopped too late
2019-06-23 7:11 [PATCH V1 net-next] net: ena: Fix bug where ring allocation backoff stopped too late sameehj
@ 2019-06-23 15:39 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-23 15:39 UTC (permalink / raw)
To: sameehj
Cc: netdev, dwmw, zorik, matua, saeedb, msw, aliguori, nafea, gtzalik,
netanel, alisaidi, benh, akiyano
From: <sameehj@amazon.com>
Date: Sun, 23 Jun 2019 10:11:10 +0300
> From: Sameeh Jubran <sameehj@amazon.com>
>
> The current code of create_queues_with_size_backoff() allows the ring size
> to become as small as ENA_MIN_RING_SIZE/2. This is a bug since we don't
> want the queue ring to be smaller than ENA_MIN_RING_SIZE
>
> In this commit we change the loop's termination condition to look at the
> queue size of the next iteration instead of that of the current one,
> so that the minimal queue size again becomes ENA_MIN_RING_SIZE.
>
> Fixes: eece4d2ab9d2 ("net: ena: add ethtool function for changing io queue sizes")
>
> Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
> Signed-off-by: Sameeh Jubran <sameehj@amazon.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-23 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-23 7:11 [PATCH V1 net-next] net: ena: Fix bug where ring allocation backoff stopped too late sameehj
2019-06-23 15:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).