Message ID | 20211201054836.3488211-2-sukadev@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 5b08560181b513984e73372b2766eeac7aa39d1b |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net,1/2] ibmvnic: drop bad optimization in reuse_rx_pools() | expand |
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;
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; >
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;
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(-)