diff options
author | Leon Romanovsky <leonro@nvidia.com> | 2020-10-15 13:52:00 +0200 |
---|---|---|
committer | Leon Romanovsky <leonro@nvidia.com> | 2020-12-04 13:46:55 +0100 |
commit | 907af0f0cab4ee5d5604f182ecec2c5b5119d294 (patch) | |
tree | 2314dada85860446f3f4add2b4d98d0dfe6e2839 /drivers | |
parent | Merge tag 'auxbus-5.11-rc1' of https://git.kernel.org/pub/scm/linux/kernel/gi... (diff) | |
download | linux-907af0f0cab4ee5d5604f182ecec2c5b5119d294.tar.xz linux-907af0f0cab4ee5d5604f182ecec2c5b5119d294.zip |
net/mlx5: Properly convey driver version to firmware
mlx5 firmware expects driver version in specific format X.X.X, so
make it always correct and based on real kernel version aligned with
the driver.
Fixes: 012e50e109fd ("net/mlx5: Set driver version into firmware")
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 8ff207aa1479..e455a2f31f07 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -50,6 +50,7 @@ #ifdef CONFIG_RFS_ACCEL #include <linux/cpu_rmap.h> #endif +#include <linux/version.h> #include <net/devlink.h> #include "mlx5_core.h" #include "lib/eq.h" @@ -233,7 +234,10 @@ static void mlx5_set_driver_version(struct mlx5_core_dev *dev) strncat(string, ",", remaining_size); remaining_size = max_t(int, 0, driver_ver_sz - strlen(string)); - strncat(string, DRIVER_VERSION, remaining_size); + + snprintf(string + strlen(string), remaining_size, "%u.%u.%u", + (u8)((LINUX_VERSION_CODE >> 16) & 0xff), (u8)((LINUX_VERSION_CODE >> 8) & 0xff), + (u16)(LINUX_VERSION_CODE & 0xffff)); /*Send the command*/ MLX5_SET(set_driver_version_in, in, opcode, |