Skip to content

Commit 5b08560

Browse files
sukadevdavem330
authored andcommitted
ibmvnic: drop bad optimization in reuse_tx_pools()
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: bbd8093 ("ibmvnic: Reuse tx pools when possible") Reported-by: Dany Madden <[email protected]> Signed-off-by: Sukadev Bhattiprolu <[email protected]> Reviewed-by: Dany Madden <[email protected]> Reviewed-by: Rick Lindsley <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 0584f49 commit 5b08560

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

drivers/net/ethernet/ibm/ibmvnic.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -866,17 +866,9 @@ static bool reuse_tx_pools(struct ibmvnic_adapter *adapter)
866866
old_mtu = adapter->prev_mtu;
867867
new_mtu = adapter->req_mtu;
868868

869-
/* Require MTU to be exactly same to reuse pools for now */
870-
if (old_mtu != new_mtu)
871-
return false;
872-
873-
if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
874-
return true;
875-
876-
if (old_num_pools < adapter->min_tx_queues ||
877-
old_num_pools > adapter->max_tx_queues ||
878-
old_pool_size < adapter->min_tx_entries_per_subcrq ||
879-
old_pool_size > adapter->max_tx_entries_per_subcrq)
869+
if (old_mtu != new_mtu ||
870+
old_num_pools != new_num_pools ||
871+
old_pool_size != new_pool_size)
880872
return false;
881873

882874
return true;

0 commit comments

Comments
 (0)