netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
@ 2018-09-23 14:48 Ido Schimmel
  2018-09-23 20:58 ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Ido Schimmel @ 2018-09-23 14:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, jiri, petrm, mlxsw, Ido Schimmel

From: Petr Machata <petrm@mellanox.com>

Up until now, mlxsw tolerated firmware versions that weren't exactly
matching the required version, if the branch number matched. That
allowed the users to test various firmware versions as long as they were
on the right branch.

On the other hand, it made it impossible for mlxsw to put a hard lower
bound on a version that fixes all problems known to date. If a user had
a somewhat older FW version installed, mlxsw would start up just fine,
possibly performing non-optimally as it would use features that trigger
problematic behavior.

Therefore tweak the check to accept any FW version that is:

- on the same branch as the preferred version, and
- the same as or newer than the preferred version.

Signed-off-by: Petr Machata <petrm@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 1fc20263b15b..33a024274a1f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -331,7 +331,10 @@ static int mlxsw_sp_fw_rev_validate(struct mlxsw_sp *mlxsw_sp)
 		return -EINVAL;
 	}
 	if (MLXSW_SP_FWREV_MINOR_TO_BRANCH(rev->minor) ==
-	    MLXSW_SP_FWREV_MINOR_TO_BRANCH(req_rev->minor))
+	    MLXSW_SP_FWREV_MINOR_TO_BRANCH(req_rev->minor) &&
+	    (rev->minor > req_rev->minor ||
+	     (rev->minor == req_rev->minor &&
+	      rev->subminor >= req_rev->subminor)))
 		return 0;
 
 	dev_info(mlxsw_sp->bus_info->dev, "The firmware version %d.%d.%d is incompatible with the driver\n",
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
  2018-09-23 14:48 [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement Ido Schimmel
@ 2018-09-23 20:58 ` Andrew Lunn
  2018-09-23 21:51   ` Ido Schimmel
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2018-09-23 20:58 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: netdev, davem, jiri, petrm, mlxsw

> Therefore tweak the check to accept any FW version that is:
> 
> - on the same branch as the preferred version, and
> - the same as or newer than the preferred version.

Hi Ido

Do you print this information out? If the check fails, it would be
useful to know what the minimal version is.

       Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
  2018-09-23 20:58 ` Andrew Lunn
@ 2018-09-23 21:51   ` Ido Schimmel
  2018-09-23 22:04     ` Andrew Lunn
  0 siblings, 1 reply; 6+ messages in thread
From: Ido Schimmel @ 2018-09-23 21:51 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Ido Schimmel, netdev, davem, jiri, petrm, mlxsw

On Sun, Sep 23, 2018 at 10:58:09PM +0200, Andrew Lunn wrote:
> > Therefore tweak the check to accept any FW version that is:
> > 
> > - on the same branch as the preferred version, and
> > - the same as or newer than the preferred version.
> 
> Hi Ido
> 
> Do you print this information out? If the check fails, it would be
> useful to know what the minimal version is.

Hi Andrew,

Yes, we do print it. It is the version the driver will try to load
during initialization in case current version is incompatible:

dev_info(mlxsw_sp->bus_info->dev, "Flashing firmware using file %s\n",
	 fw_filename);

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
  2018-09-23 21:51   ` Ido Schimmel
@ 2018-09-23 22:04     ` Andrew Lunn
  2018-09-23 22:28       ` Ido Schimmel
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2018-09-23 22:04 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: Ido Schimmel, netdev, davem, jiri, petrm, mlxsw

On Mon, Sep 24, 2018 at 12:51:00AM +0300, Ido Schimmel wrote:
> On Sun, Sep 23, 2018 at 10:58:09PM +0200, Andrew Lunn wrote:
> > > Therefore tweak the check to accept any FW version that is:
> > > 
> > > - on the same branch as the preferred version, and
> > > - the same as or newer than the preferred version.
> > 
> > Hi Ido
> > 
> > Do you print this information out? If the check fails, it would be
> > useful to know what the minimal version is.
> 
> Hi Andrew,
> 
> Yes, we do print it. It is the version the driver will try to load
> during initialization in case current version is incompatible:
> 
> dev_info(mlxsw_sp->bus_info->dev, "Flashing firmware using file %s\n",
> 	 fw_filename);

Ah. O.K. Thanks.

But doesn't that mean you reflash the device with the minimum version,
when in fact there could be a much newer version in /lib/firmware?

     Andrew

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
  2018-09-23 22:04     ` Andrew Lunn
@ 2018-09-23 22:28       ` Ido Schimmel
  2018-09-24 11:14         ` Petr Machata
  0 siblings, 1 reply; 6+ messages in thread
From: Ido Schimmel @ 2018-09-23 22:28 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: Ido Schimmel, netdev, davem, jiri, petrm, mlxsw

On Mon, Sep 24, 2018 at 12:04:17AM +0200, Andrew Lunn wrote:
> On Mon, Sep 24, 2018 at 12:51:00AM +0300, Ido Schimmel wrote:
> > On Sun, Sep 23, 2018 at 10:58:09PM +0200, Andrew Lunn wrote:
> > > > Therefore tweak the check to accept any FW version that is:
> > > > 
> > > > - on the same branch as the preferred version, and
> > > > - the same as or newer than the preferred version.
> > > 
> > > Hi Ido
> > > 
> > > Do you print this information out? If the check fails, it would be
> > > useful to know what the minimal version is.
> > 
> > Hi Andrew,
> > 
> > Yes, we do print it. It is the version the driver will try to load
> > during initialization in case current version is incompatible:
> > 
> > dev_info(mlxsw_sp->bus_info->dev, "Flashing firmware using file %s\n",
> > 	 fw_filename);
> 
> Ah. O.K. Thanks.
> 
> But doesn't that mean you reflash the device with the minimum version,
> when in fact there could be a much newer version in /lib/firmware?

No, because we always enforce the latest version we post to
linux-firmware. We try to keep firmware updates at a minimum, so if we
decided to post a new version it's either because the driver now
requires a feature from this version (which makes older versions
incompatible) or because a critical bug was fixed in that version.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement
  2018-09-23 22:28       ` Ido Schimmel
@ 2018-09-24 11:14         ` Petr Machata
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Machata @ 2018-09-24 11:14 UTC (permalink / raw)
  To: Ido Schimmel; +Cc: Andrew Lunn, Ido Schimmel, netdev, davem, jiri, mlxsw

Ido Schimmel <idosch@idosch.org> writes:

> On Mon, Sep 24, 2018 at 12:04:17AM +0200, Andrew Lunn wrote:
>> But doesn't that mean you reflash the device with the minimum version,
>> when in fact there could be a much newer version in /lib/firmware?
>
> No, because we always enforce the latest version we post to
> linux-firmware. We try to keep firmware updates at a minimum, so if we
> decided to post a new version it's either because the driver now
> requires a feature from this version (which makes older versions
> incompatible) or because a critical bug was fixed in that version.

If you consider the case of an older driver and a recent FW update that
the driver didn't know about, then yes, such FW would be ignored. You
can flash it by hand of course (ethtool -f), as long as it's on the
right branch.

Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-24 17:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-23 14:48 [PATCH net-next] mlxsw: Make MLXSW_SP1_FWREV_MINOR a hard requirement Ido Schimmel
2018-09-23 20:58 ` Andrew Lunn
2018-09-23 21:51   ` Ido Schimmel
2018-09-23 22:04     ` Andrew Lunn
2018-09-23 22:28       ` Ido Schimmel
2018-09-24 11:14         ` Petr Machata

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).