All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: Leon Romanovsky <leonro@nvidia.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Jason Wang <jasowang@redhat.com>,
	linux-rdma@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
	netdev@vger.kernel.org, Parav Pandit <parav@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>,
	virtualization@lists.linux-foundation.org,
	alsa-devel@alsa-project.org, tiwai@suse.de, broonie@kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	ranjani.sridharan@linux.intel.com,
	pierre-louis.bossart@linux.intel.com, fred.oh@linux.intel.com,
	shiraz.saleem@intel.com, dan.j.williams@intel.com,
	kiran.patil@intel.com, linux-kernel@vger.kernel.org
Subject: [PATCH mlx5-next 02/11] net/mlx5: Properly convey driver version to firmware
Date: Mon, 26 Oct 2020 13:18:40 +0200	[thread overview]
Message-ID: <20201026111849.1035786-3-leon@kernel.org> (raw)
In-Reply-To: <20201026111849.1035786-1-leon@kernel.org>

From: Leon Romanovsky <leonro@nvidia.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 8ff207aa1479..71e210f22f69 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), (u8)(LINUX_VERSION_CODE >> 8),
+		 (u16)(LINUX_VERSION_CODE & 0xff));

 	/*Send the command*/
 	MLX5_SET(set_driver_version_in, in, opcode,
--
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, kiran.patil@intel.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	Jason Wang <jasowang@redhat.com>,
	ranjani.sridharan@linux.intel.com,
	virtualization@lists.linux-foundation.org,
	fred.oh@linux.intel.com, tiwai@suse.de, broonie@kernel.org,
	Parav Pandit <parav@nvidia.com>, Roi Dayan <roid@nvidia.com>,
	shiraz.saleem@intel.com, Jakub Kicinski <kuba@kernel.org>,
	dan.j.williams@intel.com, Leon Romanovsky <leonro@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	linux-kernel@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH mlx5-next 02/11] net/mlx5: Properly convey driver version to firmware
Date: Mon, 26 Oct 2020 13:18:40 +0200	[thread overview]
Message-ID: <20201026111849.1035786-3-leon@kernel.org> (raw)
In-Reply-To: <20201026111849.1035786-1-leon@kernel.org>

From: Leon Romanovsky <leonro@nvidia.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 8ff207aa1479..71e210f22f69 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), (u8)(LINUX_VERSION_CODE >> 8),
+		 (u16)(LINUX_VERSION_CODE & 0xff));

 	/*Send the command*/
 	MLX5_SET(set_driver_version_in, in, opcode,
--
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@nvidia.com>
Cc: pierre-louis.bossart@linux.intel.com,
	alsa-devel@alsa-project.org, kiran.patil@intel.com,
	"Michael S. Tsirkin" <mst@redhat.com>,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	ranjani.sridharan@linux.intel.com,
	virtualization@lists.linux-foundation.org,
	fred.oh@linux.intel.com, tiwai@suse.de, broonie@kernel.org,
	Parav Pandit <parav@nvidia.com>, Roi Dayan <roid@nvidia.com>,
	shiraz.saleem@intel.com, Jakub Kicinski <kuba@kernel.org>,
	dan.j.williams@intel.com, Leon Romanovsky <leonro@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>,
	linux-kernel@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>
Subject: [PATCH mlx5-next 02/11] net/mlx5: Properly convey driver version to firmware
Date: Mon, 26 Oct 2020 13:18:40 +0200	[thread overview]
Message-ID: <20201026111849.1035786-3-leon@kernel.org> (raw)
In-Reply-To: <20201026111849.1035786-1-leon@kernel.org>

From: Leon Romanovsky <leonro@nvidia.com>

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>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 8ff207aa1479..71e210f22f69 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), (u8)(LINUX_VERSION_CODE >> 8),
+		 (u16)(LINUX_VERSION_CODE & 0xff));

 	/*Send the command*/
 	MLX5_SET(set_driver_version_in, in, opcode,
--
2.26.2

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2020-10-26 11:20 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 11:18 [PATCH mlx5-next 00/11] Convert mlx5 to use auxiliary bus Leon Romanovsky
2020-10-26 11:18 ` Leon Romanovsky
2020-10-26 11:18 ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 01/11] net/mlx5: Don't skip vport check Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` Leon Romanovsky [this message]
2020-10-26 11:18   ` [PATCH mlx5-next 02/11] net/mlx5: Properly convey driver version to firmware Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 03/11] net/mlx5_core: Clean driver version and name Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 04/11] vdpa/mlx5: Make hardware definitions visible to all mlx5 devices Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 05/11] net/mlx5: Register mlx5 devices to auxiliary virtual bus Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 06/11] vdpa/mlx5: Connect mlx5_vdpa to auxiliary bus Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 07/11] net/mlx5e: Connect ethernet part " Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 08/11] RDMA/mlx5: Convert mlx5_ib to use " Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 09/11] net/mlx5: Delete custom device management logic Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 10/11] net/mlx5: Simplify eswitch mode check Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18 ` [PATCH mlx5-next 11/11] RDMA/mlx5: Remove IB representors dead code Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky
2020-10-26 11:18   ` Leon Romanovsky

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=20201026111849.1035786-3-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=fred.oh@linux.intel.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@nvidia.com \
    --cc=kiran.patil@intel.com \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=parav@nvidia.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=roid@nvidia.com \
    --cc=saeedm@nvidia.com \
    --cc=shiraz.saleem@intel.com \
    --cc=tiwai@suse.de \
    --cc=virtualization@lists.linux-foundation.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.