Re: [PATCH net-next RFC 3/3] net/mlx5: Add FW upgrade reset support

From: Moshe Shemesh
Date: Thu Jan 16 2020 - 09:52:42 EST



On 1/15/2020 5:01 PM, Jakub Kicinski wrote:
> On Tue, 14 Jan 2020 17:55:28 +0200, Moshe Shemesh wrote:
>> Add support for FW upgrade reset.
>> On devlink reload the driver checks if there is a FW stored pending
>> upgrade reset. In such case the driver will set the device to FW upgrade
>> reset on next PCI link toggle and do link toggle after unload.
>>
>> To do PCI link toggle, the driver ensures that no other device ID under
>> the same bridge by checking that all the PF functions under the same PCI
>> bridge have same device ID. If no other device it uses PCI bridge link
>> control to turn link down and up.
>>
>> Signed-off-by: Moshe Shemesh <moshe@xxxxxxxxxxxx>
> I'd have a slight preference for the reset to be an explicit command
> rather than something the driver does automatically on the reload if
> there are pending changes. Won't there ever be scenarios where users
> just want to hard reset the device for their own reason?


Good point, I will take it with Jiri, may add a new devlink dev command
for that.

>
> If multiple devices under one bridge are a real concern (or otherwise
> interdependencies) would it make sense to mark the devices as "reload
> pending" and perform the reloads once all devices in the group has this
> mark set?

All mlx5 current devices support PCI - Express only.

PCI-Express device should have its own PCI-Express bridge, it is 1x1
connection.

So the check here is just to verify, all functions found under the
bridge are expected to be the same device functions (PFs and VFs).