Subject: Re: [PATCH net-next 11/16] net/amazon: Ensure that driver version is aligned to the linux kernel

From: Leon Romanovsky <[email-masked]>
Date: Sun, 23 Feb 2020 11:10:31 +0200

On Sun, Feb 23, 2020 at 10:54:29AM +0200, Gal Pressman wrote:
> On 20/02/2020 16:58, Leon Romanovsky wrote:
> > From: Leon Romanovsky <[email-masked]>
> >
> >
> > 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 <[email-masked]>
> > ---
> >  drivers/net/ethernet/amazon/ena/ena_ethtool.c |  1 -
> >  drivers/net/ethernet/amazon/ena/ena_netdev.c  | 17 ++---------------
> >  drivers/net/ethernet/amazon/ena/ena_netdev.h  | 11 -----------
> >  3 files changed, 2 insertions(+), 27 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
> > index ced1d577b62a..19262f37db84 100644
> > --- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c
> > +++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
> > @@ -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));
> >  }
> > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> > index 0b2fd96b93d7..4faf81c456d8 100644
> > --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> > +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> > @@ -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)
> > @@ -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;
>
> Hey Leon,
> I'm not sure it's safe to replace this one, adding ENA people..

I tried to avoid any changes in FW<->SW interfaces and in this case
probably missed the handling of this info to the FW.

So can you please help me and point to the relevant call stack?

It will be great too, to hear how do you distinguish between various
distribution and their driver versions based on that string.

Thanks