lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 27 May 2020 15:10:15 +0000
From:   Saeed Mahameed <saeedm@...lanox.com>
To:     "decui@...rosoft.com" <decui@...rosoft.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>
CC:     Mark Bloch <markb@...lanox.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Moshe Shemesh <moshe@...lanox.com>
Subject: Re: [net-next 12/16] net/mlx5: Add basic suspend/resume support

On Wed, 2020-05-27 at 07:36 +0000, Dexuan Cui wrote:
> > From: Saeed Mahameed <saeedm@...lanox.com>
> > Sent: Tuesday, May 26, 2020 6:49 PM
> > To: David S. Miller <davem@...emloft.net>; kuba@...nel.org
> > Cc: netdev@...r.kernel.org; Mark Bloch <markb@...lanox.com>; Dexuan
> > Cui
> > <decui@...rosoft.com>; Moshe Shemesh <moshe@...lanox.com>; Saeed
> > Mahameed <saeedm@...lanox.com>
> > Subject: [net-next 12/16] net/mlx5: Add basic suspend/resume
> > support
> > 
> > From: Mark Bloch <markb@...lanox.com>
> > 
> > Add callbacks so the NIC could be suspended and resumed.
> > 
> > Tested-by: Dexuan Cui <decui@...rosoft.com>
> > Signed-off-by: Mark Bloch <markb@...lanox.com>
> > Reviewed-by: Moshe Shemesh <moshe@...lanox.com>
> > Signed-off-by: Saeed Mahameed <saeedm@...lanox.com>
> > ---
> >  drivers/net/ethernet/mellanox/mlx5/core/main.c | 18
> > ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> > index 30de3bf35c6d..408ee64aa33b 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
> > @@ -1539,6 +1539,22 @@ static void shutdown(struct pci_dev *pdev)
> >  	mlx5_pci_disable_device(dev);
> >  }
> > 
> > +static int mlx5_suspend(struct pci_dev *pdev, pm_message_t state)
> > +{
> > +	struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
> > +
> > +	mlx5_unload_one(dev, false);
> > +
> > +	return 0;
> > +}
> > +
> > +static int mlx5_resume(struct pci_dev *pdev)
> > +{
> > +	struct mlx5_core_dev *dev = pci_get_drvdata(pdev);
> > +
> > +	return mlx5_load_one(dev, false);
> > +}
> > +
> >  static const struct pci_device_id mlx5_core_pci_table[] = {
> >  	{ PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_CONNECTIB) },
> >  	{ PCI_VDEVICE(MELLANOX, 0x1012), MLX5_PCI_DEV_IS_VF},	/*
> > Connect-IB VF */
> > @@ -1582,6 +1598,8 @@ static struct pci_driver mlx5_core_driver = {
> >  	.id_table       = mlx5_core_pci_table,
> >  	.probe          = init_one,
> >  	.remove         = remove_one,
> > +	.suspend        = mlx5_suspend,
> > +	.resume         = mlx5_resume,
> >  	.shutdown	= shutdown,
> >  	.err_handler	= &mlx5_err_handler,
> >  	.sriov_configure   = mlx5_core_sriov_configure,
> > --
> > 2.26.2
> 
> Hi David,
> Can you please consider this patch for v5.7 and the stable tree
> v5.6.y?
> 

Hi Dexuan, 

I will re-spin and do this for you, with a proper commit message and
Fixes tag this can go to net and -stable.

> I understand it's already v5.7-rc7 now, but IHMO applying this patch
> to v5.7 and v5.6.y can bring an immediate benefit and can not break
> anything existing: currently a Linux system with the mlx5 NIC always 
> crashes upon hibernation. With this patch, hibernation works fine
> with
> the NIC in my tests. 
> 
> Some users who are trying to hiberante their VMs (which run on Hyper-
> V
> and Azure) have reported the crash to me for several months, so IMHO
> it would be really great if the patch can land in v5.7 and v5.6.y
> rather 
> than land in v5.8 in ~2 months and is backported to v5.6.y and
> v5.7.y.
> 
> Thanks,
> -- Dexuan

Powered by blists - more mailing lists