From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net-next 1/3] devlink: Add fw_version_check generic parameter Date: Tue, 6 Nov 2018 20:05:00 +0000 Message-ID: <20181106200314.29918-2-idosch@mellanox.com> References: <20181106200314.29918-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "davem@davemloft.net" , Jiri Pirko , Shalom Toledo , Moshe Shemesh , "dsahern@gmail.com" , "jakub.kicinski@netronome.com" , "andrew@lunn.ch" , "f.fainelli@gmail.com" , mlxsw , Ido Schimmel To: "netdev@vger.kernel.org" Return-path: Received: from mail-eopbgr30068.outbound.protection.outlook.com ([40.107.3.68]:10370 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726184AbeKGFb7 (ORCPT ); Wed, 7 Nov 2018 00:31:59 -0500 In-Reply-To: <20181106200314.29918-1-idosch@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: From: Shalom Toledo Many drivers checking the device's firmware version during the initialization flow and flashing a compatible version if the current version is not. fw_version_check gives the ability to skip this check which allows to run the device with a different firmware version than required by the driver for testing and/or debugging purposes. Signed-off-by: Shalom Toledo Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel --- include/net/devlink.h | 4 ++++ net/core/devlink.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/include/net/devlink.h b/include/net/devlink.h index 45db0c79462d..d47ea9d38252 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -365,6 +365,7 @@ enum devlink_param_generic_id { DEVLINK_PARAM_GENERIC_ID_IGNORE_ARI, DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX, DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN, + DEVLINK_PARAM_GENERIC_ID_FW_VERSION_CHECK, =20 /* add new param generic ids above here*/ __DEVLINK_PARAM_GENERIC_ID_MAX, @@ -392,6 +393,9 @@ enum devlink_param_generic_id { #define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_NAME "msix_vec_per_pf_mi= n" #define DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_TYPE DEVLINK_PARAM_TYPE_= U32 =20 +#define DEVLINK_PARAM_GENERIC_FW_VERSION_CHECK_NAME "fw_version_check" +#define DEVLINK_PARAM_GENERIC_FW_VERSION_CHECK_TYPE DEVLINK_PARAM_TYPE_BOO= L + #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \ { \ .id =3D DEVLINK_PARAM_GENERIC_ID_##_id, \ diff --git a/net/core/devlink.c b/net/core/devlink.c index 3a4b29a13d31..1a09ad057851 100644 --- a/net/core/devlink.c +++ b/net/core/devlink.c @@ -2692,6 +2692,11 @@ static const struct devlink_param devlink_param_gene= ric[] =3D { .name =3D DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_NAME, .type =3D DEVLINK_PARAM_GENERIC_MSIX_VEC_PER_PF_MIN_TYPE, }, + { + .id =3D DEVLINK_PARAM_GENERIC_ID_FW_VERSION_CHECK, + .name =3D DEVLINK_PARAM_GENERIC_FW_VERSION_CHECK_NAME, + .type =3D DEVLINK_PARAM_GENERIC_FW_VERSION_CHECK_TYPE, + }, }; =20 static int devlink_param_generic_verify(const struct devlink_param *param) --=20 2.19.1