Skip to content

Commit

Permalink
net/amazon: Ensure that driver version is aligned to the linux kernel
Browse files Browse the repository at this point in the history
Upstream drivers are managed inside global repository and released all
together, this ensure that driver version is the same as linux kernel,
so update amazon drivers to properly reflect it.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Leon Romanovsky authored and David S. Miller committed Feb 24, 2020
1 parent f724dfc commit 1a63443
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 27 deletions.
1 change: 0 additions & 1 deletion drivers/net/ethernet/amazon/ena/ena_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,
struct ena_adapter *adapter = netdev_priv(dev);

strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
strlcpy(info->bus_info, pci_name(adapter->pdev),
sizeof(info->bus_info));
}
Expand Down
17 changes: 2 additions & 15 deletions drivers/net/ethernet/amazon/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@
#include <linux/bpf_trace.h>
#include "ena_pci_id_tbl.h"

static char version[] = DEVICE_NAME " v" DRV_MODULE_VERSION "\n";

MODULE_AUTHOR("Amazon.com, Inc. or its affiliates");
MODULE_DESCRIPTION(DEVICE_NAME);
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_MODULE_VERSION);

/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (5 * HZ)
Expand Down Expand Up @@ -3093,11 +3090,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev,
host_info->os_dist = 0;
strncpy(host_info->os_dist_str, utsname()->release,
sizeof(host_info->os_dist_str) - 1);
host_info->driver_version =
(DRV_MODULE_VER_MAJOR) |
(DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
(DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT) |
("K"[0] << ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT);
host_info->driver_version = LINUX_VERSION_CODE;
host_info->num_cpus = num_online_cpus();

host_info->driver_supported_features =
Expand Down Expand Up @@ -3476,9 +3469,7 @@ static int ena_restore_device(struct ena_adapter *adapter)
netif_carrier_on(adapter->netdev);

mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ));
dev_err(&pdev->dev,
"Device reset completed successfully, Driver info: %s\n",
version);
dev_err(&pdev->dev, "Device reset completed successfully\n");

return rc;
err_disable_msix:
Expand Down Expand Up @@ -4116,8 +4107,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

dev_dbg(&pdev->dev, "%s\n", __func__);

dev_info_once(&pdev->dev, "%s", version);

rc = pci_enable_device_mem(pdev);
if (rc) {
dev_err(&pdev->dev, "pci_enable_device_mem() failed!\n");
Expand Down Expand Up @@ -4429,8 +4418,6 @@ static struct pci_driver ena_pci_driver = {

static int __init ena_init(void)
{
pr_info("%s", version);

ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME);
if (!ena_wq) {
pr_err("Failed to create workqueue\n");
Expand Down
11 changes: 0 additions & 11 deletions drivers/net/ethernet/amazon/ena/ena_netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,7 @@
#include "ena_com.h"
#include "ena_eth_com.h"

#define DRV_MODULE_VER_MAJOR 2
#define DRV_MODULE_VER_MINOR 1
#define DRV_MODULE_VER_SUBMINOR 0

#define DRV_MODULE_NAME "ena"
#ifndef DRV_MODULE_VERSION
#define DRV_MODULE_VERSION \
__stringify(DRV_MODULE_VER_MAJOR) "." \
__stringify(DRV_MODULE_VER_MINOR) "." \
__stringify(DRV_MODULE_VER_SUBMINOR) "K"
#endif

#define DEVICE_NAME "Elastic Network Adapter (ENA)"

/* 1 for AENQ + ADMIN */
Expand Down

0 comments on commit 1a63443

Please sign in to comment.