public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: <intel-wired-lan@lists.osuosl.org>, <netdev@vger.kernel.org>,
	<anthony.l.nguyen@intel.com>, <magnus.karlsson@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH iwl-next] ice: use ice_down_up() where applicable
Date: Tue, 13 Jun 2023 12:43:19 +0200	[thread overview]
Message-ID: <ZIhIRyFxM7Uz81og@boxer> (raw)
In-Reply-To: <44e523ad-e68c-725f-efb5-b1a1323adfb2@intel.com>

On Tue, Jun 13, 2023 at 12:25:08PM +0200, Przemek Kitszel wrote:
> On 6/12/23 16:17, 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>
> > ---
> >   drivers/net/ethernet/intel/ice/ice_main.c | 12 ++----------
> >   1 file changed, 2 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
> > index a1f7c8edc22f..609df077c314 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_main.c
> > +++ b/drivers/net/ethernet/intel/ice/ice_main.c
> > @@ -7634,17 +7634,9 @@ static int ice_change_mtu(struct net_device *netdev, int new_mtu)
> >   	/* if VSI is up, bring it down and then back up */
> >   	if (!test_and_set_bit(ICE_VSI_DOWN, vsi->state)) {
> 
> I would remove the above if(), as ice_down_up() starts with:
> 	if (test_and_set_bit(ICE_VSI_DOWN, vsi->state))
> 		return 0;
> 
> which, with your change applied would just return 0.

Yes, thanks a lot for paying attention, sending v2 shortly.

> 
> 
> > -		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);
> > +		err = ice_down_up(vsi);
> > +		if (err)
> >   			return err;
> > -		}
> >   	}
> >   	netdev_dbg(netdev, "changed MTU to %d\n", new_mtu);
> 

      reply	other threads:[~2023-06-13 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 14:17 [PATCH iwl-next] ice: use ice_down_up() where applicable Maciej Fijalkowski
2023-06-13 10:25 ` [Intel-wired-lan] " Przemek Kitszel
2023-06-13 10:43   ` Maciej Fijalkowski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZIhIRyFxM7Uz81og@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox