All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools()
@ 2021-12-01  5:48 Sukadev Bhattiprolu
  2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sukadev Bhattiprolu @ 2021-12-01  5:48 UTC (permalink / raw)
  To: netdev; +Cc: Brian King, Dany Madden, Rick Lindsley

When trying to decide whether or not reuse existing rx/tx pools
we tried to allow a range of values for the pool parameters rather
than exact matches. This was intended to reuse the resources for
instance when switching between two VIO servers with different
default parameters.

But this optimization is incomplete and breaks when we try to
change the number of queues for instance. The optimization needs
to be updated, so drop it for now and simplify the code.

Fixes: 489de956e7a2 ("ibmvnic: Reuse rx pools when possible")
Reported-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 3cca51735421..6df92a872f0f 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -628,17 +628,9 @@ static bool reuse_rx_pools(struct ibmvnic_adapter *adapter)
 	old_buff_size = adapter->prev_rx_buf_sz;
 	new_buff_size = adapter->cur_rx_buf_sz;
 
-	/* Require buff size to be exactly same for now */
-	if (old_buff_size != new_buff_size)
-		return false;
-
-	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
-		return true;
-
-	if (old_num_pools < adapter->min_rx_queues ||
-	    old_num_pools > adapter->max_rx_queues ||
-	    old_pool_size < adapter->min_rx_add_entries_per_subcrq ||
-	    old_pool_size > adapter->max_rx_add_entries_per_subcrq)
+	if (old_buff_size != new_buff_size ||
+	    old_num_pools != new_num_pools ||
+	    old_pool_size != new_pool_size)
 		return false;
 
 	return true;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools()
  2021-12-01  5:48 [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Sukadev Bhattiprolu
@ 2021-12-01  5:48 ` Sukadev Bhattiprolu
  2021-12-01 18:13   ` Dany Madden
  2021-12-01 18:18   ` Rick Lindsley
  2021-12-01 18:12 ` [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Dany Madden
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 7+ messages in thread
From: Sukadev Bhattiprolu @ 2021-12-01  5:48 UTC (permalink / raw)
  To: netdev; +Cc: Brian King, Dany Madden, Rick Lindsley

When trying to decide whether or not reuse existing rx/tx pools
we tried to allow a range of values for the pool parameters rather
than exact matches. This was intended to reuse the resources for
instance when switching between two VIO servers with different
default parameters.

But this optimization is incomplete and breaks when we try to
change the number of queues for instance. The optimization needs
to be updated, so drop it for now and simplify the code.

Fixes: bbd809305bc7 ("ibmvnic: Reuse tx pools when possible")
Reported-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
---
 drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
index 6df92a872f0f..0bb3911dd014 100644
--- a/drivers/net/ethernet/ibm/ibmvnic.c
+++ b/drivers/net/ethernet/ibm/ibmvnic.c
@@ -866,17 +866,9 @@ static bool reuse_tx_pools(struct ibmvnic_adapter *adapter)
 	old_mtu = adapter->prev_mtu;
 	new_mtu = adapter->req_mtu;
 
-	/* Require MTU to be exactly same to reuse pools for now */
-	if (old_mtu != new_mtu)
-		return false;
-
-	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
-		return true;
-
-	if (old_num_pools < adapter->min_tx_queues ||
-	    old_num_pools > adapter->max_tx_queues ||
-	    old_pool_size < adapter->min_tx_entries_per_subcrq ||
-	    old_pool_size > adapter->max_tx_entries_per_subcrq)
+	if (old_mtu != new_mtu ||
+	    old_num_pools != new_num_pools ||
+	    old_pool_size != new_pool_size)
 		return false;
 
 	return true;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools()
  2021-12-01  5:48 [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Sukadev Bhattiprolu
  2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
@ 2021-12-01 18:12 ` Dany Madden
  2021-12-01 18:18 ` Rick Lindsley
  2021-12-02 12:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: Dany Madden @ 2021-12-01 18:12 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: netdev, Brian King, Rick Lindsley

On 2021-11-30 21:48, Sukadev Bhattiprolu wrote:
> When trying to decide whether or not reuse existing rx/tx pools
> we tried to allow a range of values for the pool parameters rather
> than exact matches. This was intended to reuse the resources for
> instance when switching between two VIO servers with different
> default parameters.
> 
> But this optimization is incomplete and breaks when we try to
> change the number of queues for instance. The optimization needs
> to be updated, so drop it for now and simplify the code.
> 
> Fixes: 489de956e7a2 ("ibmvnic: Reuse rx pools when possible")
> Reported-by: Dany Madden <drt@linux.ibm.com>
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
>  drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index 3cca51735421..6df92a872f0f 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -628,17 +628,9 @@ static bool reuse_rx_pools(struct ibmvnic_adapter 
> *adapter)
>  	old_buff_size = adapter->prev_rx_buf_sz;
>  	new_buff_size = adapter->cur_rx_buf_sz;
> 
> -	/* Require buff size to be exactly same for now */
> -	if (old_buff_size != new_buff_size)
> -		return false;
> -
> -	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
> -		return true;
> -
> -	if (old_num_pools < adapter->min_rx_queues ||
> -	    old_num_pools > adapter->max_rx_queues ||
> -	    old_pool_size < adapter->min_rx_add_entries_per_subcrq ||
> -	    old_pool_size > adapter->max_rx_add_entries_per_subcrq)
> +	if (old_buff_size != new_buff_size ||
> +	    old_num_pools != new_num_pools ||
> +	    old_pool_size != new_pool_size)
>  		return false;
> 
>  	return true;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools()
  2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
@ 2021-12-01 18:13   ` Dany Madden
  2021-12-01 18:18   ` Rick Lindsley
  1 sibling, 0 replies; 7+ messages in thread
From: Dany Madden @ 2021-12-01 18:13 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: netdev, Brian King, Rick Lindsley

On 2021-11-30 21:48, Sukadev Bhattiprolu wrote:
> When trying to decide whether or not reuse existing rx/tx pools
> we tried to allow a range of values for the pool parameters rather
> than exact matches. This was intended to reuse the resources for
> instance when switching between two VIO servers with different
> default parameters.
> 
> But this optimization is incomplete and breaks when we try to
> change the number of queues for instance. The optimization needs
> to be updated, so drop it for now and simplify the code.
> 
> Fixes: bbd809305bc7 ("ibmvnic: Reuse tx pools when possible")
> Reported-by: Dany Madden <drt@linux.ibm.com>
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>

> ---
>  drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c
> b/drivers/net/ethernet/ibm/ibmvnic.c
> index 6df92a872f0f..0bb3911dd014 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -866,17 +866,9 @@ static bool reuse_tx_pools(struct ibmvnic_adapter 
> *adapter)
>  	old_mtu = adapter->prev_mtu;
>  	new_mtu = adapter->req_mtu;
> 
> -	/* Require MTU to be exactly same to reuse pools for now */
> -	if (old_mtu != new_mtu)
> -		return false;
> -
> -	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
> -		return true;
> -
> -	if (old_num_pools < adapter->min_tx_queues ||
> -	    old_num_pools > adapter->max_tx_queues ||
> -	    old_pool_size < adapter->min_tx_entries_per_subcrq ||
> -	    old_pool_size > adapter->max_tx_entries_per_subcrq)
> +	if (old_mtu != new_mtu ||
> +	    old_num_pools != new_num_pools ||
> +	    old_pool_size != new_pool_size)
>  		return false;
> 
>  	return true;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools()
  2021-12-01  5:48 [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Sukadev Bhattiprolu
  2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
  2021-12-01 18:12 ` [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Dany Madden
@ 2021-12-01 18:18 ` Rick Lindsley
  2021-12-02 12:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: Rick Lindsley @ 2021-12-01 18:18 UTC (permalink / raw)
  To: Sukadev Bhattiprolu, netdev; +Cc: Brian King, Dany Madden, Rick Lindsley

On 11/30/21 21:48, Sukadev Bhattiprolu wrote:
> When trying to decide whether or not reuse existing rx/tx pools
> we tried to allow a range of values for the pool parameters rather
> than exact matches. This was intended to reuse the resources for
> instance when switching between two VIO servers with different
> default parameters.
> 
> But this optimization is incomplete and breaks when we try to
> change the number of queues for instance. The optimization needs
> to be updated, so drop it for now and simplify the code.
> 
> Fixes: 489de956e7a2 ("ibmvnic: Reuse rx pools when possible")
> Reported-by: Dany Madden <drt@linux.ibm.com>
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>

Reviewed-by: Rick Lindsley <ricklind@linux.ibm.com>

> ---
>   drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
>   1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index 3cca51735421..6df92a872f0f 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -628,17 +628,9 @@ static bool reuse_rx_pools(struct ibmvnic_adapter *adapter)
>   	old_buff_size = adapter->prev_rx_buf_sz;
>   	new_buff_size = adapter->cur_rx_buf_sz;
>   
> -	/* Require buff size to be exactly same for now */
> -	if (old_buff_size != new_buff_size)
> -		return false;
> -
> -	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
> -		return true;
> -
> -	if (old_num_pools < adapter->min_rx_queues ||
> -	    old_num_pools > adapter->max_rx_queues ||
> -	    old_pool_size < adapter->min_rx_add_entries_per_subcrq ||
> -	    old_pool_size > adapter->max_rx_add_entries_per_subcrq)
> +	if (old_buff_size != new_buff_size ||
> +	    old_num_pools != new_num_pools ||
> +	    old_pool_size != new_pool_size)
>   		return false;
>   
>   	return true;
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools()
  2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
  2021-12-01 18:13   ` Dany Madden
@ 2021-12-01 18:18   ` Rick Lindsley
  1 sibling, 0 replies; 7+ messages in thread
From: Rick Lindsley @ 2021-12-01 18:18 UTC (permalink / raw)
  To: Sukadev Bhattiprolu, netdev; +Cc: Brian King, Dany Madden, Rick Lindsley

On 11/30/21 21:48, Sukadev Bhattiprolu wrote:
> When trying to decide whether or not reuse existing rx/tx pools
> we tried to allow a range of values for the pool parameters rather
> than exact matches. This was intended to reuse the resources for
> instance when switching between two VIO servers with different
> default parameters.
> 
> But this optimization is incomplete and breaks when we try to
> change the number of queues for instance. The optimization needs
> to be updated, so drop it for now and simplify the code.
> 
> Fixes: bbd809305bc7 ("ibmvnic: Reuse tx pools when possible")
> Reported-by: Dany Madden <drt@linux.ibm.com>
> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>

Reviewed-by: Rick Lindsley <ricklind@linux.ibm.com>

> ---
>   drivers/net/ethernet/ibm/ibmvnic.c | 14 +++-----------
>   1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index 6df92a872f0f..0bb3911dd014 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> @@ -866,17 +866,9 @@ static bool reuse_tx_pools(struct ibmvnic_adapter *adapter)
>   	old_mtu = adapter->prev_mtu;
>   	new_mtu = adapter->req_mtu;
>   
> -	/* Require MTU to be exactly same to reuse pools for now */
> -	if (old_mtu != new_mtu)
> -		return false;
> -
> -	if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
> -		return true;
> -
> -	if (old_num_pools < adapter->min_tx_queues ||
> -	    old_num_pools > adapter->max_tx_queues ||
> -	    old_pool_size < adapter->min_tx_entries_per_subcrq ||
> -	    old_pool_size > adapter->max_tx_entries_per_subcrq)
> +	if (old_mtu != new_mtu ||
> +	    old_num_pools != new_num_pools ||
> +	    old_pool_size != new_pool_size)
>   		return false;
>   
>   	return true;
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools()
  2021-12-01  5:48 [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Sukadev Bhattiprolu
                   ` (2 preceding siblings ...)
  2021-12-01 18:18 ` Rick Lindsley
@ 2021-12-02 12:20 ` patchwork-bot+netdevbpf
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-02 12:20 UTC (permalink / raw)
  To: Sukadev Bhattiprolu; +Cc: netdev, brking, drt, ricklind

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 30 Nov 2021 21:48:35 -0800 you wrote:
> When trying to decide whether or not reuse existing rx/tx pools
> we tried to allow a range of values for the pool parameters rather
> than exact matches. This was intended to reuse the resources for
> instance when switching between two VIO servers with different
> default parameters.
> 
> But this optimization is incomplete and breaks when we try to
> change the number of queues for instance. The optimization needs
> to be updated, so drop it for now and simplify the code.
> 
> [...]

Here is the summary with links:
  - [net,1/2] ibmvnic: drop bad optimization in reuse_rx_pools()
    https://git.kernel.org/netdev/net/c/0584f4949609
  - [net,2/2] ibmvnic: drop bad optimization in reuse_tx_pools()
    https://git.kernel.org/netdev/net/c/5b08560181b5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-02 12:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01  5:48 [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Sukadev Bhattiprolu
2021-12-01  5:48 ` [PATCH net 2/2] ibmvnic: drop bad optimization in reuse_tx_pools() Sukadev Bhattiprolu
2021-12-01 18:13   ` Dany Madden
2021-12-01 18:18   ` Rick Lindsley
2021-12-01 18:12 ` [PATCH net 1/2] ibmvnic: drop bad optimization in reuse_rx_pools() Dany Madden
2021-12-01 18:18 ` Rick Lindsley
2021-12-02 12:20 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.