Message ID | 20230613113552.336520-1-maciej.fijalkowski@intel.com (mailing list archive) |
---|---|
State | Awaiting Upstream |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2,iwl-next] ice: use ice_down_up() where applicable | expand |
On 6/13/23 13:35, Maciej Fijalkowski wrote: > ice_change_mtu() is currently using a separate ice_down() and ice_up() > calls to reflect changed MTU. ice_down_up() serves this purpose, so do > the refactoring here. > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> > --- > > v1->v2: > - avoid setting ICE_VSI_DOWN bit as ice_down_up() covers it [Przemek] > > drivers/net/ethernet/intel/ice/ice_main.c | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-)
On Tue, Jun 13, 2023 at 01:35:52PM +0200, Maciej Fijalkowski wrote: > ice_change_mtu() is currently using a separate ice_down() and ice_up() > calls to reflect changed MTU. ice_down_up() serves this purpose, so do > the refactoring here. > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Reviewed-by: Simon Horman <simon.horman@corigine.com>
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Maciej Fijalkowski > Sent: Tuesday, June 13, 2023 5:06 PM > To: intel-wired-lan@lists.osuosl.org > Cc: netdev@vger.kernel.org; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; Karlsson, Magnus <magnus.karlsson@intel.com>; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com> > Subject: [Intel-wired-lan] [PATCH v2 iwl-next] ice: use ice_down_up() where applicable > > ice_change_mtu() is currently using a separate ice_down() and ice_up() calls to reflect changed MTU. ice_down_up() serves this purpose, so do the refactoring here. > > Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> > --- > > v1->v2: > - avoid setting ICE_VSI_DOWN bit as ice_down_up() covers it [Przemek] > > drivers/net/ethernet/intel/ice/ice_main.c | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-) > Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index a1f7c8edc22f..8f7c6ef3c487 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -7631,21 +7631,9 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu) } netdev->mtu = (unsigned int)new_mtu; - - /* if VSI is up, bring it down and then back up */ - if (!test_and_set_bit(ICE_VSI_DOWN, vsi->state)) { - err = ice_down(vsi); - if (err) { - netdev_err(netdev, "change MTU if_down err %d\n", err); - return err; - } - - err = ice_up(vsi); - if (err) { - netdev_err(netdev, "change MTU if_up err %d\n", err); - return err; - } - } + err = ice_down_up(vsi); + if (err) + return err; netdev_dbg(netdev, "changed MTU to %d\n", new_mtu); set_bit(ICE_FLAG_MTU_CHANGED, pf->flags);
ice_change_mtu() is currently using a separate ice_down() and ice_up() calls to reflect changed MTU. ice_down_up() serves this purpose, so do the refactoring here. Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> --- v1->v2: - avoid setting ICE_VSI_DOWN bit as ice_down_up() covers it [Przemek] drivers/net/ethernet/intel/ice/ice_main.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)