Skip to content

Commit 0584f49

Browse files
sukadevdavem330
authored andcommitted
ibmvnic: drop bad optimization in reuse_rx_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: 489de95 ("ibmvnic: Reuse rx 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 789b6cc commit 0584f49

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
@@ -628,17 +628,9 @@ static bool reuse_rx_pools(struct ibmvnic_adapter *adapter)
628628
old_buff_size = adapter->prev_rx_buf_sz;
629629
new_buff_size = adapter->cur_rx_buf_sz;
630630

631-
/* Require buff size to be exactly same for now */
632-
if (old_buff_size != new_buff_size)
633-
return false;
634-
635-
if (old_num_pools == new_num_pools && old_pool_size == new_pool_size)
636-
return true;
637-
638-
if (old_num_pools < adapter->min_rx_queues ||
639-
old_num_pools > adapter->max_rx_queues ||
640-
old_pool_size < adapter->min_rx_add_entries_per_subcrq ||
641-
old_pool_size > adapter->max_rx_add_entries_per_subcrq)
631+
if (old_buff_size != new_buff_size ||
632+
old_num_pools != new_num_pools ||
633+
old_pool_size != new_pool_size)
642634
return false;
643635

644636
return true;

0 commit comments

Comments
 (0)