netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Shannon Nelson <snelson@pensando.io>
Cc: netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH v2 net-next 2/2] ionic: add devlink firmware update
Date: Sat, 5 Sep 2020 15:07:39 -0700	[thread overview]
Message-ID: <20200905150739.4853fd0c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <c18aca84-7cd4-64be-1222-2c36c795f024@pensando.io>

On Sat, 5 Sep 2020 14:47:58 -0700 Shannon Nelson wrote:
> On 9/5/20 12:52 PM, Jakub Kicinski wrote:
> > On Thu,  3 Sep 2020 17:05:34 -0700 Shannon Nelson wrote:  
> >> +		if (offset > next_interval) {
> >> +			devlink_flash_update_status_notify(dl, "Downloading",
> >> +							   NULL, offset, fw->size);
> >> +			next_interval = offset + (fw->size / IONIC_FW_INTERVAL_FRACTION);
> >> +		}
> >> +	}
> >> +	devlink_flash_update_status_notify(dl, "Downloading", NULL, 1, 1);  
> > This is quite awkward. You send a notification with a different size,
> > and potentially an unnecessary one if last iteration of the loop
> > triggered offset > next_interval.
> >
> > Please just add || offset == fw->size to the condition at the end of
> > the loop and it will always trigger, with the correct length.  
> 
> Or maybe make that last one look like
>      devlink_flash_update_status_notify(dl, "Downloading", NULL, 
> fw->size, fw->size);
> to be less awkward and to keep the style of using a final status_notify 
> at the end of the block, as done in the Install and Select blocks 
> further along?
 
That may still generate two notifications at the end tho, no?
Unless the loop one in the loop is && offset != fw->size.

  reply	other threads:[~2020-09-05 22:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  0:05 [PATCH v2 net-next 0/2] ionic: add devlink dev flash support Shannon Nelson
2020-09-04  0:05 ` [PATCH v2 net-next 1/2] ionic: update the fw update api Shannon Nelson
2020-09-04  0:05 ` [PATCH v2 net-next 2/2] ionic: add devlink firmware update Shannon Nelson
2020-09-05 19:52   ` Jakub Kicinski
2020-09-05 21:47     ` Shannon Nelson
2020-09-05 22:07       ` Jakub Kicinski [this message]
2020-09-05 20:04   ` Jakub Kicinski
2020-09-05 22:06     ` Shannon Nelson
2020-09-05 22:19       ` Jakub Kicinski
2020-09-04 15:01 ` [PATCH v2 net-next 0/2] ionic: add devlink dev flash support Jakub Kicinski
2020-09-04 18:20   ` Shannon Nelson
2020-09-04 22:47     ` Jakub Kicinski
2020-09-04 22:52       ` Shannon Nelson

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=20200905150739.4853fd0c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=snelson@pensando.io \
    /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;
as well as URLs for NNTP newsgroup(s).